diff --git a/src/SDKs/DataFactory/DataFactory.Tests/JsonSamples/TriggerJsonSamples.cs b/src/SDKs/DataFactory/DataFactory.Tests/JsonSamples/TriggerJsonSamples.cs index 303ded5755fd..ec5412d84cdb 100644 --- a/src/SDKs/DataFactory/DataFactory.Tests/JsonSamples/TriggerJsonSamples.cs +++ b/src/SDKs/DataFactory/DataFactory.Tests/JsonSamples/TriggerJsonSamples.cs @@ -43,6 +43,78 @@ public class TriggerJsonSamples : JsonSampleCollection ] } }"; - + + [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}"" + }, + } + } + } +} +"; + } } diff --git a/src/SDKs/DataFactory/DataFactory.Tests/Utils/ExampleCapture.cs b/src/SDKs/DataFactory/DataFactory.Tests/Utils/ExampleCapture.cs index 2b0184aaa1cc..840dea0facfb 100644 --- a/src/SDKs/DataFactory/DataFactory.Tests/Utils/ExampleCapture.cs +++ b/src/SDKs/DataFactory/DataFactory.Tests/Utils/ExampleCapture.cs @@ -11,6 +11,7 @@ using System.Linq; using System.Collections.Generic; using Newtonsoft.Json.Linq; +using System.Globalization; namespace DataFactory.Tests.Utils { @@ -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 @@ -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[] 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; } diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/DataFactoryManagementClient.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/DataFactoryManagementClient.cs index 598553f51972..cafe7f996b10 100644 --- a/src/SDKs/DataFactory/Management.DataFactory/Generated/DataFactoryManagementClient.cs +++ b/src/SDKs/DataFactory/Management.DataFactory/Generated/DataFactoryManagementClient.cs @@ -380,8 +380,6 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/AzureDataLakeStoreDataset.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/AzureDataLakeStoreDataset.cs index de1c6efa0d02..e1a27320a047 100644 --- a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/AzureDataLakeStoreDataset.cs +++ b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/AzureDataLakeStoreDataset.cs @@ -49,16 +49,13 @@ public AzureDataLakeStoreDataset() /// The format of the Data Lake Store. /// The data compression method used for the /// item(s) in the Azure Data Lake Store. - /// Specify a dynamic path and filename for - /// time series data. - public AzureDataLakeStoreDataset(LinkedServiceReference linkedServiceName, object folderPath, string description = default(string), object structure = default(object), IDictionary parameters = default(IDictionary), object fileName = default(object), DatasetStorageFormat format = default(DatasetStorageFormat), DatasetCompression compression = default(DatasetCompression), IList partitionedBy = default(IList)) + public AzureDataLakeStoreDataset(LinkedServiceReference linkedServiceName, object folderPath, string description = default(string), object structure = default(object), IDictionary parameters = default(IDictionary), 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(); } @@ -94,13 +91,6 @@ public AzureDataLakeStoreDataset() [JsonProperty(PropertyName = "typeProperties.compression")] public DatasetCompression Compression { get; set; } - /// - /// Gets or sets specify a dynamic path and filename for time series - /// data. - /// - [JsonProperty(PropertyName = "typeProperties.partitionedBy")] - public IList PartitionedBy { get; set; } - /// /// Validate the object. /// diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/BlobTrigger.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/BlobTrigger.cs index 47f0b6956818..456c00cb2baa 100644 --- a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/BlobTrigger.cs +++ b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/BlobTrigger.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DataFactory.Models /// Trigger that runs everytime the selected Blob container changes. /// [Rest.Serialization.JsonTransformation] - public partial class BlobTrigger : Trigger + public partial class BlobTrigger : MultiplePipelineTrigger { /// /// Initializes a new instance of the BlobTrigger class. @@ -35,18 +35,18 @@ public BlobTrigger() /// Initializes a new instance of the BlobTrigger class. /// /// Trigger description. - /// Pipelines that need to be started. /// Indicates if trigger is running or not. /// Updated when Start/Stop APIs are called on the Trigger. Possible /// values include: 'Started', 'Stopped', 'Disabled' + /// Pipelines that need to be started. /// The path of the container/folder that will /// trigger the pipeline. /// The max number of parallel files to /// handle when it is triggered. /// The Azure Storage linked service /// reference. - public BlobTrigger(string description = default(string), IList pipelines = default(IList), 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 pipelines = default(IList), string folderPath = default(string), int? maxConcurrency = default(int?), LinkedServiceReference linkedService = default(LinkedServiceReference)) + : base(description, runtimeState, pipelines) { FolderPath = folderPath; MaxConcurrency = maxConcurrency; diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/DatasetDateTimePartitionValue.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/DatasetDateTimePartitionValue.cs deleted file mode 100644 index cf5be90477de..000000000000 --- a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/DatasetDateTimePartitionValue.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.DataFactory.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The date/time value of a partition. - /// - [Newtonsoft.Json.JsonObject("DateTime")] - public partial class DatasetDateTimePartitionValue : DatasetPartitionValue - { - /// - /// Initializes a new instance of the DatasetDateTimePartitionValue - /// class. - /// - public DatasetDateTimePartitionValue() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DatasetDateTimePartitionValue - /// class. - /// - /// Name of variable containing date. Type: string - /// (or Expression with resultType string). - /// Format string for the Date value. Type: string - /// (or Expression with resultType string). - public DatasetDateTimePartitionValue(object date = default(object), object format = default(object)) - { - Date = date; - Format = format; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of variable containing date. Type: string (or - /// Expression with resultType string). - /// - [JsonProperty(PropertyName = "date")] - public object Date { get; set; } - - /// - /// Gets or sets format string for the Date value. Type: string (or - /// Expression with resultType string). - /// - [JsonProperty(PropertyName = "format")] - public object Format { get; set; } - - } -} diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/DatasetPartition.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/DatasetPartition.cs deleted file mode 100644 index 23cfdfcf0b8e..000000000000 --- a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/DatasetPartition.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.DataFactory.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The partition definition. - /// - public partial class DatasetPartition - { - /// - /// Initializes a new instance of the DatasetPartition class. - /// - public DatasetPartition() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DatasetPartition class. - /// - /// Name of the partition. Type: string (or - /// Expression with resultType string). - /// Value of the partition. - public DatasetPartition(object name = default(object), DatasetPartitionValue value = default(DatasetPartitionValue)) - { - Name = name; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the partition. Type: string (or Expression - /// with resultType string). - /// - [JsonProperty(PropertyName = "name")] - public object Name { get; set; } - - /// - /// Gets or sets value of the partition. - /// - [JsonProperty(PropertyName = "value")] - public DatasetPartitionValue Value { get; set; } - - } -} diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/DatasetPartitionValue.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/DatasetPartitionValue.cs deleted file mode 100644 index 775e7b4ef659..000000000000 --- a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/DatasetPartitionValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.DataFactory.Models -{ - using System.Linq; - - /// - /// The value of a partition. - /// - public partial class DatasetPartitionValue - { - /// - /// Initializes a new instance of the DatasetPartitionValue class. - /// - public DatasetPartitionValue() - { - CustomInit(); - } - - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - } -} diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/DatasetZipDeflateCompression.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/DatasetZipDeflateCompression.cs new file mode 100644 index 000000000000..3ebaf88048b4 --- /dev/null +++ b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/DatasetZipDeflateCompression.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The ZipDeflate compression method used on a dataset. + /// + [Newtonsoft.Json.JsonObject("ZipDeflate")] + public partial class DatasetZipDeflateCompression : DatasetCompression + { + /// + /// Initializes a new instance of the DatasetZipDeflateCompression + /// class. + /// + public DatasetZipDeflateCompression() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DatasetZipDeflateCompression + /// class. + /// + /// The ZipDeflate compression level. Possible + /// values include: 'Optimal', 'Fastest' + public DatasetZipDeflateCompression(string level = default(string)) + { + Level = level; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ZipDeflate compression level. Possible values + /// include: 'Optimal', 'Fastest' + /// + [JsonProperty(PropertyName = "level")] + public string Level { get; set; } + + } +} diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/HttpDataset.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/HttpDataset.cs index 143bd76eac98..252e0a1f2906 100644 --- a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/HttpDataset.cs +++ b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/HttpDataset.cs @@ -54,19 +54,16 @@ public HttpDataset() /// ... /// request-header-name-n:request-header-value-n Type: string (or /// Expression with resultType string). - /// The HTTP method for the HTTP - /// request. /// The format of files. /// The data compression method used on /// files. - public HttpDataset(LinkedServiceReference linkedServiceName, string description = default(string), object structure = default(object), IDictionary parameters = default(IDictionary), object relativeUrl = default(object), object requestMethod = default(object), object requestBody = default(object), object additionalHeaders = default(object), DatasetPartition partitionedBy = default(DatasetPartition), DatasetStorageFormat format = default(DatasetStorageFormat), DatasetCompression compression = default(DatasetCompression)) + public HttpDataset(LinkedServiceReference linkedServiceName, string description = default(string), object structure = default(object), IDictionary parameters = default(IDictionary), object relativeUrl = default(object), object requestMethod = default(object), object requestBody = default(object), object additionalHeaders = default(object), DatasetStorageFormat format = default(DatasetStorageFormat), DatasetCompression compression = default(DatasetCompression)) : base(linkedServiceName, description, structure, parameters) { RelativeUrl = relativeUrl; RequestMethod = requestMethod; RequestBody = requestBody; AdditionalHeaders = additionalHeaders; - PartitionedBy = partitionedBy; Format = format; Compression = compression; CustomInit(); @@ -109,12 +106,6 @@ public HttpDataset() [JsonProperty(PropertyName = "typeProperties.additionalHeaders")] public object AdditionalHeaders { get; set; } - /// - /// Gets or sets the HTTP method for the HTTP request. - /// - [JsonProperty(PropertyName = "typeProperties.partitionedBy")] - public DatasetPartition PartitionedBy { get; set; } - /// /// Gets or sets the format of files. /// diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/MultiplePipelineTrigger.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/MultiplePipelineTrigger.cs new file mode 100644 index 000000000000..89ed9b4271b6 --- /dev/null +++ b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/MultiplePipelineTrigger.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Base class for all triggers that support one to many model for trigger + /// to pipeline. + /// + public partial class MultiplePipelineTrigger : Trigger + { + /// + /// Initializes a new instance of the MultiplePipelineTrigger class. + /// + public MultiplePipelineTrigger() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MultiplePipelineTrigger class. + /// + /// Trigger description. + /// Indicates if trigger is running or not. + /// Updated when Start/Stop APIs are called on the Trigger. Possible + /// values include: 'Started', 'Stopped', 'Disabled' + /// Pipelines that need to be started. + public MultiplePipelineTrigger(string description = default(string), string runtimeState = default(string), IList pipelines = default(IList)) + : base(description, runtimeState) + { + Pipelines = pipelines; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets pipelines that need to be started. + /// + [JsonProperty(PropertyName = "pipelines")] + public IList Pipelines { get; set; } + + } +} diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/RedirectIncompatibleRowSettings.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/RedirectIncompatibleRowSettings.cs index f1382a467c58..bd46068716fa 100644 --- a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/RedirectIncompatibleRowSettings.cs +++ b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/RedirectIncompatibleRowSettings.cs @@ -32,12 +32,13 @@ public RedirectIncompatibleRowSettings() /// Initializes a new instance of the RedirectIncompatibleRowSettings /// class. /// - /// Name of the Azure Storage or - /// Storage SAS linked service used for redirecting incompatible row. - /// Must be specified if redirectIncompatibleRowSettings is specified. - /// Type: string (or Expression with resultType string). - /// The path to storage for storing the redirect - /// incompatible row data Type: string (or Expression with resultType + /// Name of the Azure Storage, Storage + /// SAS, or Azure Data Lake Store linked service used for redirecting + /// incompatible row. Must be specified if + /// redirectIncompatibleRowSettings is specified. Type: string (or + /// Expression with resultType string). + /// The path for storing the redirect incompatible + /// row data. Type: string (or Expression with resultType /// string). public RedirectIncompatibleRowSettings(object linkedServiceName, object path = default(object)) { @@ -52,18 +53,17 @@ public RedirectIncompatibleRowSettings() partial void CustomInit(); /// - /// Gets or sets name of the Azure Storage or Storage SAS linked - /// service used for redirecting incompatible row. Must be specified if - /// redirectIncompatibleRowSettings is specified. Type: string (or - /// Expression with resultType string). + /// Gets or sets name of the Azure Storage, Storage SAS, or Azure Data + /// Lake Store linked service used for redirecting incompatible row. + /// Must be specified if redirectIncompatibleRowSettings is specified. + /// Type: string (or Expression with resultType string). /// [JsonProperty(PropertyName = "linkedServiceName")] public object LinkedServiceName { get; set; } /// - /// Gets or sets the path to storage for storing the redirect - /// incompatible row data Type: string (or Expression with resultType - /// string). + /// Gets or sets the path for storing the redirect incompatible row + /// data. Type: string (or Expression with resultType string). /// [JsonProperty(PropertyName = "path")] public object Path { get; set; } diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/RetryPolicy.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/RetryPolicy.cs new file mode 100644 index 000000000000..3f7162a05438 --- /dev/null +++ b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/RetryPolicy.cs @@ -0,0 +1,81 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataFactory.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Execution policy for an activity. + /// + public partial class RetryPolicy + { + /// + /// Initializes a new instance of the RetryPolicy class. + /// + public RetryPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RetryPolicy class. + /// + /// Maximum ordinary retry attempts. Default is 0. + /// Type: integer (or Expression with resultType integer), minimum: + /// 0. + /// Interval between retries in + /// seconds. Default is 30. + public RetryPolicy(object count = default(object), int? intervalInSeconds = default(int?)) + { + Count = count; + IntervalInSeconds = intervalInSeconds; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets maximum ordinary retry attempts. Default is 0. Type: + /// integer (or Expression with resultType integer), minimum: 0. + /// + [JsonProperty(PropertyName = "count")] + public object Count { get; set; } + + /// + /// Gets or sets interval between retries in seconds. Default is 30. + /// + [JsonProperty(PropertyName = "intervalInSeconds")] + public int? IntervalInSeconds { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (IntervalInSeconds > 86400) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "IntervalInSeconds", 86400); + } + if (IntervalInSeconds < 30) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "IntervalInSeconds", 30); + } + } + } +} diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/ScheduleTrigger.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/ScheduleTrigger.cs index c466053ef103..c21473e52263 100644 --- a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/ScheduleTrigger.cs +++ b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/ScheduleTrigger.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.DataFactory.Models /// Trigger that creates pipeline runs periodically, on schedule. /// [Rest.Serialization.JsonTransformation] - public partial class ScheduleTrigger : Trigger + public partial class ScheduleTrigger : MultiplePipelineTrigger { /// /// Initializes a new instance of the ScheduleTrigger class. @@ -35,13 +35,13 @@ public ScheduleTrigger() /// Initializes a new instance of the ScheduleTrigger class. /// /// Trigger description. - /// Pipelines that need to be started. /// Indicates if trigger is running or not. /// Updated when Start/Stop APIs are called on the Trigger. Possible /// values include: 'Started', 'Stopped', 'Disabled' + /// Pipelines that need to be started. /// Recurrence schedule configuration. - public ScheduleTrigger(string description = default(string), IList pipelines = default(IList), string runtimeState = default(string), ScheduleTriggerRecurrence recurrence = default(ScheduleTriggerRecurrence)) - : base(description, pipelines, runtimeState) + public ScheduleTrigger(string description = default(string), string runtimeState = default(string), IList pipelines = default(IList), ScheduleTriggerRecurrence recurrence = default(ScheduleTriggerRecurrence)) + : base(description, runtimeState, pipelines) { Recurrence = recurrence; CustomInit(); diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/Trigger.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/Trigger.cs index 1fd81a501435..900512af5ab3 100644 --- a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/Trigger.cs +++ b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/Trigger.cs @@ -11,8 +11,6 @@ namespace Microsoft.Azure.Management.DataFactory.Models { using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -33,14 +31,12 @@ public Trigger() /// Initializes a new instance of the Trigger class. /// /// Trigger description. - /// Pipelines that need to be started. /// Indicates if trigger is running or not. /// Updated when Start/Stop APIs are called on the Trigger. Possible /// values include: 'Started', 'Stopped', 'Disabled' - public Trigger(string description = default(string), IList pipelines = default(IList), string runtimeState = default(string)) + public Trigger(string description = default(string), string runtimeState = default(string)) { Description = description; - Pipelines = pipelines; RuntimeState = runtimeState; CustomInit(); } @@ -56,12 +52,6 @@ public Trigger() [JsonProperty(PropertyName = "description")] public string Description { get; set; } - /// - /// Gets or sets pipelines that need to be started. - /// - [JsonProperty(PropertyName = "pipelines")] - public IList Pipelines { get; set; } - /// /// Gets indicates if trigger is running or not. Updated when /// Start/Stop APIs are called on the Trigger. Possible values include: diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/TumblingWindowFrequency.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/TumblingWindowFrequency.cs new file mode 100644 index 000000000000..cb9b05f7a2cc --- /dev/null +++ b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/TumblingWindowFrequency.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataFactory.Models +{ + + /// + /// Defines values for TumblingWindowFrequency. + /// + public static class TumblingWindowFrequency + { + public const string Minute = "Minute"; + public const string Hour = "Hour"; + } +} diff --git a/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/TumblingWindowTrigger.cs b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/TumblingWindowTrigger.cs new file mode 100644 index 000000000000..9e70d8f428ab --- /dev/null +++ b/src/SDKs/DataFactory/Management.DataFactory/Generated/Models/TumblingWindowTrigger.cs @@ -0,0 +1,174 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataFactory.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Trigger that schedules pipeline runs for all fixed time interval + /// windows from a start time without gaps and also supports backfill + /// scenarios (when start time is in the past). + /// + [Rest.Serialization.JsonTransformation] + public partial class TumblingWindowTrigger : Trigger + { + /// + /// Initializes a new instance of the TumblingWindowTrigger class. + /// + public TumblingWindowTrigger() + { + Pipeline = new TriggerPipelineReference(); + CustomInit(); + } + + /// + /// Initializes a new instance of the TumblingWindowTrigger class. + /// + /// Pipeline for which runs are created when an + /// event is fired for trigger window that is ready. + /// Trigger description. + /// Indicates if trigger is running or not. + /// Updated when Start/Stop APIs are called on the Trigger. Possible + /// values include: 'Started', 'Stopped', 'Disabled' + /// The frequency of the time windows. Possible + /// values include: 'Minute', 'Hour' + /// The interval of the time windows. The + /// minimum interval allowed is 15 Minutes. + /// The start time for the time period for the + /// trigger during which events are fired for windows that are ready. + /// Only UTC time is currently supported. + /// The end time for the time period for the + /// trigger during which events are fired for windows that are ready. + /// Only UTC time is currently supported. + /// Specifies how long the trigger waits past due + /// time before triggering new run. It doesn't alter window start and + /// end time. The default is 0. Type: string (or Expression with + /// resultType string), pattern: + /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + /// The max number of parallel time + /// windows (ready for execution) for which a new run is + /// triggered. + /// Retry policy that will be applied for + /// failed pipeline runs. + public TumblingWindowTrigger(TriggerPipelineReference pipeline, string description = default(string), string runtimeState = default(string), string frequency = default(string), int? interval = default(int?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), object delay = default(object), int? maxConcurrency = default(int?), RetryPolicy retryPolicy = default(RetryPolicy)) + : base(description, runtimeState) + { + Pipeline = pipeline; + Frequency = frequency; + Interval = interval; + StartTime = startTime; + EndTime = endTime; + Delay = delay; + MaxConcurrency = maxConcurrency; + RetryPolicy = retryPolicy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets pipeline for which runs are created when an event is + /// fired for trigger window that is ready. + /// + [JsonProperty(PropertyName = "pipeline")] + public TriggerPipelineReference Pipeline { get; set; } + + /// + /// Gets or sets the frequency of the time windows. Possible values + /// include: 'Minute', 'Hour' + /// + [JsonProperty(PropertyName = "typeProperties.frequency")] + public string Frequency { get; set; } + + /// + /// Gets or sets the interval of the time windows. The minimum interval + /// allowed is 15 Minutes. + /// + [JsonProperty(PropertyName = "typeProperties.interval")] + public int? Interval { get; set; } + + /// + /// Gets or sets the start time for the time period for the trigger + /// during which events are fired for windows that are ready. Only UTC + /// time is currently supported. + /// + [JsonProperty(PropertyName = "typeProperties.startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets the end time for the time period for the trigger + /// during which events are fired for windows that are ready. Only UTC + /// time is currently supported. + /// + [JsonProperty(PropertyName = "typeProperties.endTime")] + public System.DateTime? EndTime { get; set; } + + /// + /// Gets or sets specifies how long the trigger waits past due time + /// before triggering new run. It doesn't alter window start and end + /// time. The default is 0. Type: string (or Expression with resultType + /// string), pattern: + /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + /// + [JsonProperty(PropertyName = "typeProperties.delay")] + public object Delay { get; set; } + + /// + /// Gets or sets the max number of parallel time windows (ready for + /// execution) for which a new run is triggered. + /// + [JsonProperty(PropertyName = "typeProperties.maxConcurrency")] + public int? MaxConcurrency { get; set; } + + /// + /// Gets or sets retry policy that will be applied for failed pipeline + /// runs. + /// + [JsonProperty(PropertyName = "typeProperties.retryPolicy")] + public RetryPolicy RetryPolicy { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Pipeline == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Pipeline"); + } + if (Pipeline != null) + { + Pipeline.Validate(); + } + if (MaxConcurrency > 50) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxConcurrency", 50); + } + if (MaxConcurrency < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxConcurrency", 1); + } + if (RetryPolicy != null) + { + RetryPolicy.Validate(); + } + } + } +} diff --git a/src/SDKs/DataFactory/Management.DataFactory/changelog.md b/src/SDKs/DataFactory/Management.DataFactory/changelog.md index 56e981f27aa0..6517fa954e62 100644 --- a/src/SDKs/DataFactory/Management.DataFactory/changelog.md +++ b/src/SDKs/DataFactory/Management.DataFactory/changelog.md @@ -7,6 +7,7 @@ * Add SAP Cloud For Customer Dataset * Add SAP Cloud For Customer Sink * Support providing a Dynamics password as a SecureString, a secret in Azure Key Vault, or as an encrypted credential. + * App model for Tumbling Window Trigger ## Version 0.2.1-preview diff --git a/src/SDKs/_metadata/datafactory_resource-manager.txt b/src/SDKs/_metadata/datafactory_resource-manager.txt index e7da835b962f..f7b64c0b9367 100644 --- a/src/SDKs/_metadata/datafactory_resource-manager.txt +++ b/src/SDKs/_metadata/datafactory_resource-manager.txt @@ -1,10 +1,11 @@ -2017-11-09 09:18:16 UTC +2017-11-17 22:44:04 UTC 1) azure-rest-api-specs repository information GitHub user: Azure Branch: current -Commit: 76718235cc24729845c495620de826bfc8bc74cb +Commit: 69fc8095833c9fb0e15cb1b635c0abe24f3942af 2) AutoRest information Requested version: latest -Bootstrapper version: C:\Users\peshen\AppData\Roaming\npm `-- autorest@2.0.4166 +Bootstrapper version: C:\Users\sharmm\AppData\Roaming\npm +-- autorest@2.0.4166 `-- oad@0.1.7 `-- autorest@1.9.1 +Latest installed version: 2.0.4168