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 @@ -7,6 +7,7 @@
using Microsoft.Azure.Management.DataFactory.Models;
using Microsoft.Rest.Serialization;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Globalization;
using Xunit;
Expand Down Expand Up @@ -57,6 +58,34 @@ public void ExecutePipelineActivity_SDKSample()
public void ExecuteSsisPackageActivity_SDKSample()
{
string triggeredPipelineName = "MyExecuteSsisPackagePipelineActivity";
var projectParameters = new Dictionary<string, SSISExecutionParameter>();
projectParameters["project_param_1"] = new SSISExecutionParameter()
{
Value = "123",
};
projectParameters["project_param_2"] = new SSISExecutionParameter()
{
Value = 1,
};
var packageParameters = new Dictionary<string, SSISExecutionParameter>();
packageParameters["package_param_1"] = new SSISExecutionParameter()
{
Value = "06A9E439-6C23-43A1-AF56-F73A54B0F17D",
};
packageParameters["project_param_2"] = new SSISExecutionParameter()
{
Value = DateTimeOffset.UtcNow,
};
var projectCMs = new Dictionary<string, IDictionary<string, SSISExecutionParameter>>();
projectCMs["MyOledbCM"] = new Dictionary<string, SSISExecutionParameter>();
projectCMs["MyOledbCM"]["userName"] = new SSISExecutionParameter() { Value = "sa" };
projectCMs["MyOledbCM"]["passWord"] = new SSISExecutionParameter() { Value = new SecureString() { Value = "123" } };
var packageCMs = new Dictionary<string, IDictionary<string, SSISExecutionParameter>>();
packageCMs["MyOledbCM"] = new Dictionary<string, SSISExecutionParameter>();
packageCMs["MyOledbCM"]["userName"] = new SSISExecutionParameter() { Value = "sa" };
packageCMs["MyOledbCM"]["passWord"] = new SSISExecutionParameter() { Value = new SecureString() { Value = "123" } };
var propertyOverrides = new Dictionary<string, SSISPropertyOverride>();
propertyOverrides["\\package.dtsx\\maxparralcount"] = new SSISPropertyOverride() { Value = 3, IsSensitive = false };
ExecuteSSISPackageActivity activity = new ExecuteSSISPackageActivity
{
Name = triggeredPipelineName,
Expand All @@ -71,7 +100,12 @@ public void ExecuteSsisPackageActivity_SDKSample()
ConnectVia = new IntegrationRuntimeReference
{
ReferenceName = "myIntegrationRuntime"
}
},
ProjectParameters = projectParameters,
PackageParameters = packageParameters,
ProjectConnectionManagers = projectCMs,
PackageConnectionManagers = packageCMs,
PropertyOverrides = propertyOverrides
};
var handler = new RecordedDelegatingHandler();
var client = this.CreateWorkflowClient(handler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,19 @@ public ExecuteSSISPackageActivity()
/// package. Possible values include: 'x64', 'x86'</param>
/// <param name="loggingLevel">The logging level of SSIS package
/// execution.</param>
/// <param name="environmentPath">The environment path to execution the
/// <param name="environmentPath">The environment path to execute the
/// SSIS package.</param>
public ExecuteSSISPackageActivity(string name, SSISPackageLocation packageLocation, IntegrationRuntimeReference connectVia, IDictionary<string, object> additionalProperties = default(IDictionary<string, object>), string description = default(string), IList<ActivityDependency> dependsOn = default(IList<ActivityDependency>), LinkedServiceReference linkedServiceName = default(LinkedServiceReference), ActivityPolicy policy = default(ActivityPolicy), string runtime = default(string), string loggingLevel = default(string), string environmentPath = default(string))
/// <param name="projectParameters">The project level parameters to
/// execute the SSIS package.</param>
/// <param name="packageParameters">The package level parameters to
/// execute the SSIS package.</param>
/// <param name="projectConnectionManagers">The project level
/// connection managers to execute the SSIS package.</param>
/// <param name="packageConnectionManagers">The package level
/// connection managers to execute the SSIS package.</param>
/// <param name="propertyOverrides">The property overrides to execute
/// the SSIS package.</param>
public ExecuteSSISPackageActivity(string name, SSISPackageLocation packageLocation, IntegrationRuntimeReference connectVia, IDictionary<string, object> additionalProperties = default(IDictionary<string, object>), string description = default(string), IList<ActivityDependency> dependsOn = default(IList<ActivityDependency>), LinkedServiceReference linkedServiceName = default(LinkedServiceReference), ActivityPolicy policy = default(ActivityPolicy), string runtime = default(string), string loggingLevel = default(string), string environmentPath = default(string), IDictionary<string, SSISExecutionParameter> projectParameters = default(IDictionary<string, SSISExecutionParameter>), IDictionary<string, SSISExecutionParameter> packageParameters = default(IDictionary<string, SSISExecutionParameter>), IDictionary<string, IDictionary<string, SSISExecutionParameter>> projectConnectionManagers = default(IDictionary<string, IDictionary<string, SSISExecutionParameter>>), IDictionary<string, IDictionary<string, SSISExecutionParameter>> packageConnectionManagers = default(IDictionary<string, IDictionary<string, SSISExecutionParameter>>), IDictionary<string, SSISPropertyOverride> propertyOverrides = default(IDictionary<string, SSISPropertyOverride>))
: base(name, additionalProperties, description, dependsOn, linkedServiceName, policy)
{
ConnectVia = new IntegrationRuntimeReference();
Expand All @@ -61,6 +71,11 @@ public ExecuteSSISPackageActivity()
LoggingLevel = loggingLevel;
EnvironmentPath = environmentPath;
ConnectVia = connectVia;
ProjectParameters = projectParameters;
PackageParameters = packageParameters;
ProjectConnectionManagers = projectConnectionManagers;
PackageConnectionManagers = packageConnectionManagers;
PropertyOverrides = propertyOverrides;
CustomInit();
}

Expand Down Expand Up @@ -89,7 +104,7 @@ public ExecuteSSISPackageActivity()
public string LoggingLevel { get; set; }

/// <summary>
/// Gets or sets the environment path to execution the SSIS package.
/// Gets or sets the environment path to execute the SSIS package.
/// </summary>
[JsonProperty(PropertyName = "typeProperties.environmentPath")]
public string EnvironmentPath { get; set; }
Expand All @@ -100,6 +115,40 @@ public ExecuteSSISPackageActivity()
[JsonProperty(PropertyName = "typeProperties.connectVia")]
public IntegrationRuntimeReference ConnectVia { get; set; }

/// <summary>
/// Gets or sets the project level parameters to execute the SSIS
/// package.
/// </summary>
[JsonProperty(PropertyName = "typeProperties.projectParameters")]
public IDictionary<string, SSISExecutionParameter> ProjectParameters { get; set; }

/// <summary>
/// Gets or sets the package level parameters to execute the SSIS
/// package.
/// </summary>
[JsonProperty(PropertyName = "typeProperties.packageParameters")]
public IDictionary<string, SSISExecutionParameter> PackageParameters { get; set; }

/// <summary>
/// Gets or sets the project level connection managers to execute the
/// SSIS package.
/// </summary>
[JsonProperty(PropertyName = "typeProperties.projectConnectionManagers")]
public IDictionary<string, IDictionary<string, SSISExecutionParameter>> ProjectConnectionManagers { get; set; }

/// <summary>
/// Gets or sets the package level connection managers to execute the
/// SSIS package.
/// </summary>
[JsonProperty(PropertyName = "typeProperties.packageConnectionManagers")]
public IDictionary<string, IDictionary<string, SSISExecutionParameter>> PackageConnectionManagers { get; set; }

/// <summary>
/// Gets or sets the property overrides to execute the SSIS package.
/// </summary>
[JsonProperty(PropertyName = "typeProperties.propertyOverrides")]
public IDictionary<string, SSISPropertyOverride> PropertyOverrides { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
Expand All @@ -125,6 +174,68 @@ public override void Validate()
{
ConnectVia.Validate();
}
if (ProjectParameters != null)
{
foreach (var valueElement in ProjectParameters.Values)
{
if (valueElement != null)
{
valueElement.Validate();
}
}
}
if (PackageParameters != null)
{
foreach (var valueElement1 in PackageParameters.Values)
{
if (valueElement1 != null)
{
valueElement1.Validate();
}
}
}
if (ProjectConnectionManagers != null)
{
foreach (var valueElement2 in ProjectConnectionManagers.Values)
{
if (valueElement2 != null)
{
foreach (var valueElement3 in valueElement2.Values)
{
if (valueElement3 != null)
{
valueElement3.Validate();
}
}
}
}
}
if (PackageConnectionManagers != null)
{
foreach (var valueElement4 in PackageConnectionManagers.Values)
{
if (valueElement4 != null)
{
foreach (var valueElement5 in valueElement4.Values)
{
if (valueElement5 != null)
{
valueElement5.Validate();
}
}
}
}
}
if (PropertyOverrides != null)
{
foreach (var valueElement6 in PropertyOverrides.Values)
{
if (valueElement6 != null)
{
valueElement6.Validate();
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// <auto-generated>
// 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.
// </auto-generated>

namespace Microsoft.Azure.Management.DataFactory.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// SSIS execution parameter.
/// </summary>
public partial class SSISExecutionParameter
{
/// <summary>
/// Initializes a new instance of the SSISExecutionParameter class.
/// </summary>
public SSISExecutionParameter()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the SSISExecutionParameter class.
/// </summary>
/// <param name="value">SSIS package execution parameter value. Type:
/// string (or Expression with resultType string).</param>
public SSISExecutionParameter(object value)
{
Value = value;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets SSIS package execution parameter value. Type: string
/// (or Expression with resultType string).
/// </summary>
[JsonProperty(PropertyName = "value")]
public object Value { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (Value == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Value");
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// <auto-generated>
// 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.
// </auto-generated>

namespace Microsoft.Azure.Management.DataFactory.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// SSIS property override.
/// </summary>
public partial class SSISPropertyOverride
{
/// <summary>
/// Initializes a new instance of the SSISPropertyOverride class.
/// </summary>
public SSISPropertyOverride()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the SSISPropertyOverride class.
/// </summary>
/// <param name="value">SSIS package property override value. Type:
/// string (or Expression with resultType string).</param>
/// <param name="isSensitive">Whether SSIS package property override
/// value is sensitive data. Value will be encrypted in SSISDB if it is
/// true</param>
public SSISPropertyOverride(object value, bool? isSensitive = default(bool?))
{
Value = value;
IsSensitive = isSensitive;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets SSIS package property override value. Type: string (or
/// Expression with resultType string).
/// </summary>
[JsonProperty(PropertyName = "value")]
public object Value { get; set; }

/// <summary>
/// Gets or sets whether SSIS package property override value is
/// sensitive data. Value will be encrypted in SSISDB if it is true
/// </summary>
[JsonProperty(PropertyName = "isSensitive")]
public bool? IsSensitive { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (Value == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Value");
}
}
}
}
Loading