Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,78 @@ public class TriggerJsonSamples : JsonSampleCollection<TriggerJsonSamples>
]
}
}";


[JsonSample]
public const string ScheduleTriggerSample = @"
{
name: ""myDemoScheduleTrigger"",
properties: {
type: ""ScheduleTrigger"",
typeProperties: {
recurrence: {
frequency: ""Month"",
interval: 1,
timeZone: ""UTC"",
startTime: ""2017-04-14T13:00:00Z"",
endTime: ""2018-04-14T13:00:00Z""
}
},
pipelines: [
{
pipelineReference: {
type: ""PipelineReference"",
referenceName: ""myPipeline""
},
parameters: {
mySinkDatasetFolderPath: {
type: ""Expression"",
value: ""@{concat('output',formatDateTime(trigger().startTime,'-dd-MM-yyyy-HH-mm-ss-ffff'))}""
},
mySourceDatasetFolderPath: ""input/""
}
}
]
}
}
";

[JsonSample]
public const string TumblingWindowTriggerSample = @"
{
name: ""myDemoTWTrigger"",
properties: {
type: ""TumblingWindowTrigger"",
typeProperties: {
frequency: ""Hour"",
interval: 24,
startTime: ""2017-04-14T13:00:00Z"",
endTime: ""2018-04-14T13:00:00Z"",
delay: ""00:00:01"",
retryPolicy: {
count: 3,
intervalInSeconds: 30
},
maxConcurrency: 10
},
pipeline: {
pipelineReference: {
type: ""PipelineReference"",
referenceName: ""myPipeline""
},
parameters: {
windowStart: {
type: ""Expression"",
value: ""@{trigger().outputs.windowStartTime}""
},
windowEnd: {
type: ""Expression"",
value: ""@{trigger().outputs.windowEndTime}""
},
}
}
}
}
";

}
}
42 changes: 40 additions & 2 deletions src/SDKs/DataFactory/DataFactory.Tests/Utils/ExampleCapture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using System.Globalization;

namespace DataFactory.Tests.Utils
{
Expand Down Expand Up @@ -73,7 +74,7 @@ public void CaptureAllExamples()
CaptureIntegrationRuntimes_ListAuthKeys(); // 200
CaptureIntegrationRuntimes_RegenerateAuthKey(); // 200
CaptureIntegrationRuntimes_GetStatus(); // 200

// Start LinkedServices operations, leaving linked service available
CaptureLinkedServices_Create(); // 200
CaptureLinkedServices_Update(); // 200
Expand Down Expand Up @@ -671,7 +672,44 @@ private TriggerResource GetTriggerResource(string description)

triggerPipelineReference.Parameters.Add("OutputBlobNameList", outputBlobNameArray);

resource.Properties.Pipelines.Add(triggerPipelineReference);
(resource.Properties as MultiplePipelineTrigger).Pipelines.Add(triggerPipelineReference);

return resource;
}

private TriggerResource GetTWTriggerResource(string description)
{
TriggerResource resource = new TriggerResource()
{
Properties = new TumblingWindowTrigger()
{
Description = description,
StartTime = DateTime.UtcNow.AddMinutes(-10),
EndTime = DateTime.UtcNow.AddMinutes(5),
Frequency = RecurrenceFrequency.Minute,
Interval = 1,
Delay = "00:00:01",
MaxConcurrency = 1,
RetryPolicy = new RetryPolicy(1, 1),
Pipeline = new TriggerPipelineReference()
}
};

TriggerPipelineReference triggerPipelineReference = new TriggerPipelineReference()
{
PipelineReference = new PipelineReference(pipelineName),
Parameters = new Dictionary<string, object>()
};

string[] outputBlobNameList = new string[1];
outputBlobNameList[0] = string.Format(CultureInfo.InvariantCulture, "{0}-{1}", outputBlobName, "@{concat('output',formatDateTime(trigger().outputs.windowStartTime,'-dd-MM-yyyy-HH-mm-ss-ffff'))}");
outputBlobNameList[0] = string.Format(CultureInfo.InvariantCulture, "{0}-{1}", outputBlobName, "@{concat('output',formatDateTime(trigger().outputs.windowEndTime,'-dd-MM-yyyy-HH-mm-ss-ffff'))}");

JArray outputBlobNameArray = JArray.FromObject(outputBlobNameList);

triggerPipelineReference.Parameters.Add("OutputBlobNameList", outputBlobNameArray);

(resource.Properties as TumblingWindowTrigger).Pipeline = triggerPipelineReference;

return resource;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,6 @@ private void Initialize()
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<DatasetCompression>("type"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<DatasetStorageFormat>("type"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<DatasetStorageFormat>("type"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<DatasetPartitionValue>("type"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<DatasetPartitionValue>("type"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<CopySource>("type"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<CopySource>("type"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<CopyTranslator>("type"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,13 @@ public AzureDataLakeStoreDataset()
/// <param name="format">The format of the Data Lake Store.</param>
/// <param name="compression">The data compression method used for the
/// item(s) in the Azure Data Lake Store.</param>
/// <param name="partitionedBy">Specify a dynamic path and filename for
/// time series data.</param>
public AzureDataLakeStoreDataset(LinkedServiceReference linkedServiceName, object folderPath, string description = default(string), object structure = default(object), IDictionary<string, ParameterSpecification> parameters = default(IDictionary<string, ParameterSpecification>), object fileName = default(object), DatasetStorageFormat format = default(DatasetStorageFormat), DatasetCompression compression = default(DatasetCompression), IList<DatasetPartition> partitionedBy = default(IList<DatasetPartition>))
public AzureDataLakeStoreDataset(LinkedServiceReference linkedServiceName, object folderPath, string description = default(string), object structure = default(object), IDictionary<string, ParameterSpecification> parameters = default(IDictionary<string, ParameterSpecification>), object fileName = default(object), DatasetStorageFormat format = default(DatasetStorageFormat), DatasetCompression compression = default(DatasetCompression))
: base(linkedServiceName, description, structure, parameters)
{
FolderPath = folderPath;
FileName = fileName;
Format = format;
Compression = compression;
PartitionedBy = partitionedBy;
CustomInit();
}

Expand Down Expand Up @@ -94,13 +91,6 @@ public AzureDataLakeStoreDataset()
[JsonProperty(PropertyName = "typeProperties.compression")]
public DatasetCompression Compression { get; set; }

/// <summary>
/// Gets or sets specify a dynamic path and filename for time series
/// data.
/// </summary>
[JsonProperty(PropertyName = "typeProperties.partitionedBy")]
public IList<DatasetPartition> PartitionedBy { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DataFactory.Models
/// Trigger that runs everytime the selected Blob container changes.
/// </summary>
[Rest.Serialization.JsonTransformation]
public partial class BlobTrigger : Trigger
public partial class BlobTrigger : MultiplePipelineTrigger
{
/// <summary>
/// Initializes a new instance of the BlobTrigger class.
Expand All @@ -35,18 +35,18 @@ public BlobTrigger()
/// Initializes a new instance of the BlobTrigger class.
/// </summary>
/// <param name="description">Trigger description.</param>
/// <param name="pipelines">Pipelines that need to be started.</param>
/// <param name="runtimeState">Indicates if trigger is running or not.
/// Updated when Start/Stop APIs are called on the Trigger. Possible
/// values include: 'Started', 'Stopped', 'Disabled'</param>
/// <param name="pipelines">Pipelines that need to be started.</param>
/// <param name="folderPath">The path of the container/folder that will
/// trigger the pipeline.</param>
/// <param name="maxConcurrency">The max number of parallel files to
/// handle when it is triggered.</param>
/// <param name="linkedService">The Azure Storage linked service
/// reference.</param>
public BlobTrigger(string description = default(string), IList<TriggerPipelineReference> pipelines = default(IList<TriggerPipelineReference>), string runtimeState = default(string), string folderPath = default(string), int? maxConcurrency = default(int?), LinkedServiceReference linkedService = default(LinkedServiceReference))
: base(description, pipelines, runtimeState)
public BlobTrigger(string description = default(string), string runtimeState = default(string), IList<TriggerPipelineReference> pipelines = default(IList<TriggerPipelineReference>), string folderPath = default(string), int? maxConcurrency = default(int?), LinkedServiceReference linkedService = default(LinkedServiceReference))
: base(description, runtimeState, pipelines)
{
FolderPath = folderPath;
MaxConcurrency = maxConcurrency;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading