Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Azure Database Migration Service to add Managed Instance as target #4098

Merged
merged 6 commits into from
Mar 5, 2018
Merged
Show file tree
Hide file tree
Changes from 5 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
7 changes: 7 additions & 0 deletions src/SDKs/DataMigration/AzSdk.RP.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--This file and it's contents are updated at build time moving or editing might result in build failure. Take due deligence while editing this file-->
<PropertyGroup>
<AzureApiTag />
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags>
</PropertyGroup>
</Project>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private void Initialize()
Usages = new UsagesOperations(this);
Operations = new Operations(this);
BaseUri = new System.Uri("https://management.azure.com");
ApiVersion = "2017-11-15-preview";
ApiVersion = "2018-03-15-preview";
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
GenerateClientRequestId = true;
Expand Down Expand Up @@ -341,10 +341,12 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<MigrateSqlServerSqlDbTaskOutput>("resultType"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<MigrateSqlServerSqlDbTaskOutput>("resultType"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<ConnectionInfo>("type"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<ConnectionInfo>("type"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<MigrateSqlServerSqlDbTaskOutput>("resultType"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<MigrateSqlServerSqlDbTaskOutput>("resultType"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<MigrateSqlServerSqlMITaskOutput>("resultType"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<MigrateSqlServerSqlMITaskOutput>("resultType"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<ConnectToSourceSqlServerTaskOutput>("resultType"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<ConnectToSourceSqlServerTaskOutput>("resultType"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<ProjectTaskProperties>("taskType"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,69 +10,16 @@

namespace Microsoft.Azure.Management.DataMigration.Models
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime;
using System.Runtime.Serialization;

/// <summary>
/// Defines values for AuthenticationType.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum AuthenticationType
public static class AuthenticationType
{
[EnumMember(Value = "None")]
None,
[EnumMember(Value = "WindowsAuthentication")]
WindowsAuthentication,
[EnumMember(Value = "SqlAuthentication")]
SqlAuthentication,
[EnumMember(Value = "ActiveDirectoryIntegrated")]
ActiveDirectoryIntegrated,
[EnumMember(Value = "ActiveDirectoryPassword")]
ActiveDirectoryPassword
}
internal static class AuthenticationTypeEnumExtension
{
internal static string ToSerializedValue(this AuthenticationType? value)
{
return value == null ? null : ((AuthenticationType)value).ToSerializedValue();
}

internal static string ToSerializedValue(this AuthenticationType value)
{
switch( value )
{
case AuthenticationType.None:
return "None";
case AuthenticationType.WindowsAuthentication:
return "WindowsAuthentication";
case AuthenticationType.SqlAuthentication:
return "SqlAuthentication";
case AuthenticationType.ActiveDirectoryIntegrated:
return "ActiveDirectoryIntegrated";
case AuthenticationType.ActiveDirectoryPassword:
return "ActiveDirectoryPassword";
}
return null;
}

internal static AuthenticationType? ParseAuthenticationType(this string value)
{
switch( value )
{
case "None":
return AuthenticationType.None;
case "WindowsAuthentication":
return AuthenticationType.WindowsAuthentication;
case "SqlAuthentication":
return AuthenticationType.SqlAuthentication;
case "ActiveDirectoryIntegrated":
return AuthenticationType.ActiveDirectoryIntegrated;
case "ActiveDirectoryPassword":
return AuthenticationType.ActiveDirectoryPassword;
}
return null;
}
public const string None = "None";
public const string WindowsAuthentication = "WindowsAuthentication";
public const string SqlAuthentication = "SqlAuthentication";
public const string ActiveDirectoryIntegrated = "ActiveDirectoryIntegrated";
public const string ActiveDirectoryPassword = "ActiveDirectoryPassword";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public AvailableServiceSkuCapacity()
/// <param name="defaultProperty">The default capacity</param>
/// <param name="scaleType">The scalability approach. Possible values
/// include: 'none', 'manual', 'automatic'</param>
public AvailableServiceSkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? defaultProperty = default(int?), ServiceScalability? scaleType = default(ServiceScalability?))
public AvailableServiceSkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string))
{
Minimum = minimum;
Maximum = maximum;
Expand Down Expand Up @@ -73,7 +73,7 @@ public AvailableServiceSkuCapacity()
/// 'none', 'manual', 'automatic'
/// </summary>
[JsonProperty(PropertyName = "scaleType")]
public ServiceScalability? ScaleType { get; set; }
public string ScaleType { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// <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.DataMigration.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// Blob container storage information.
/// </summary>
public partial class BlobShare
{
/// <summary>
/// Initializes a new instance of the BlobShare class.
/// </summary>
public BlobShare()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the BlobShare class.
/// </summary>
/// <param name="sasUri">SAS URI of Azure Storage Account
/// Container.</param>
public BlobShare(string sasUri)
{
SasUri = sasUri;
CustomInit();
}

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

/// <summary>
/// Gets or sets SAS URI of Azure Storage Account Container.
/// </summary>
[JsonProperty(PropertyName = "sasUri")]
public string SasUri { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (SasUri == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "SasUri");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ConnectToSourceSqlServerTaskInput()
/// <param name="checkPermissionsGroup">Permission group for
/// validations. Possible values include: 'Default',
/// 'MigrationFromSqlServerToAzureDB'</param>
public ConnectToSourceSqlServerTaskInput(SqlConnectionInfo sourceConnectionInfo, ServerLevelPermissionsGroup? checkPermissionsGroup = default(ServerLevelPermissionsGroup?))
public ConnectToSourceSqlServerTaskInput(SqlConnectionInfo sourceConnectionInfo, string checkPermissionsGroup = default(string))
{
SourceConnectionInfo = sourceConnectionInfo;
CheckPermissionsGroup = checkPermissionsGroup;
Expand All @@ -61,7 +61,7 @@ public ConnectToSourceSqlServerTaskInput()
/// include: 'Default', 'MigrationFromSqlServerToAzureDB'
/// </summary>
[JsonProperty(PropertyName = "checkPermissionsGroup")]
public ServerLevelPermissionsGroup? CheckPermissionsGroup { get; set; }
public string CheckPermissionsGroup { get; set; }

/// <summary>
/// Validate the object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public ConnectToSourceSqlServerTaskOutputDatabaseLevel()
/// include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending',
/// 'Suspect', 'Emergency', 'Offline', 'Copying',
/// 'OfflineSecondary'</param>
public ConnectToSourceSqlServerTaskOutputDatabaseLevel(string id = default(string), string name = default(string), double? sizeMB = default(double?), IList<DatabaseFileInfo> databaseFiles = default(IList<DatabaseFileInfo>), DatabaseCompatLevel? compatibilityLevel = default(DatabaseCompatLevel?), DatabaseState? databaseState = default(DatabaseState?))
public ConnectToSourceSqlServerTaskOutputDatabaseLevel(string id = default(string), string name = default(string), double? sizeMB = default(double?), IList<DatabaseFileInfo> databaseFiles = default(IList<DatabaseFileInfo>), string compatibilityLevel = default(string), string databaseState = default(string))
: base(id)
{
Name = name;
Expand Down Expand Up @@ -88,15 +88,15 @@ public ConnectToSourceSqlServerTaskOutputDatabaseLevel()
/// 'CompatLevel140'
/// </summary>
[JsonProperty(PropertyName = "compatibilityLevel")]
public DatabaseCompatLevel? CompatibilityLevel { get; private set; }
public string CompatibilityLevel { get; private set; }

/// <summary>
/// Gets state of the database. Possible values include: 'Online',
/// 'Restoring', 'Recovering', 'RecoveryPending', 'Suspect',
/// 'Emergency', 'Offline', 'Copying', 'OfflineSecondary'
/// </summary>
[JsonProperty(PropertyName = "databaseState")]
public DatabaseState? DatabaseState { get; private set; }
public string DatabaseState { get; private set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public ConnectToSourceSqlServerTaskProperties()
/// <param name="input">Task input</param>
/// <param name="output">Task output. This is ignored if
/// submitted.</param>
public ConnectToSourceSqlServerTaskProperties(IList<ODataError> errors = default(IList<ODataError>), TaskState? state = default(TaskState?), ConnectToSourceSqlServerTaskInput input = default(ConnectToSourceSqlServerTaskInput), IList<ConnectToSourceSqlServerTaskOutput> output = default(IList<ConnectToSourceSqlServerTaskOutput>))
public ConnectToSourceSqlServerTaskProperties(IList<ODataError> errors = default(IList<ODataError>), string state = default(string), ConnectToSourceSqlServerTaskInput input = default(ConnectToSourceSqlServerTaskInput), IList<ConnectToSourceSqlServerTaskOutput> output = default(IList<ConnectToSourceSqlServerTaskOutput>))
: base(errors, state)
{
Input = input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public ConnectToTargetSqlDbTaskProperties()
/// <param name="input">Task input</param>
/// <param name="output">Task output. This is ignored if
/// submitted.</param>
public ConnectToTargetSqlDbTaskProperties(IList<ODataError> errors = default(IList<ODataError>), TaskState? state = default(TaskState?), ConnectToTargetSqlDbTaskInput input = default(ConnectToTargetSqlDbTaskInput), IList<ConnectToTargetSqlDbTaskOutput> output = default(IList<ConnectToTargetSqlDbTaskOutput>))
public ConnectToTargetSqlDbTaskProperties(IList<ODataError> errors = default(IList<ODataError>), string state = default(string), ConnectToTargetSqlDbTaskInput input = default(ConnectToTargetSqlDbTaskInput), IList<ConnectToTargetSqlDbTaskOutput> output = default(IList<ConnectToTargetSqlDbTaskOutput>))
: base(errors, state)
{
Input = input;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// <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.DataMigration.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// Input for the task that validates connection to Azure SQL Database
/// Managed Instance.
/// </summary>
public partial class ConnectToTargetSqlMITaskInput
{
/// <summary>
/// Initializes a new instance of the ConnectToTargetSqlMITaskInput
/// class.
/// </summary>
public ConnectToTargetSqlMITaskInput()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the ConnectToTargetSqlMITaskInput
/// class.
/// </summary>
/// <param name="targetConnectionInfo">Connection information for
/// target SQL Server</param>
public ConnectToTargetSqlMITaskInput(SqlConnectionInfo targetConnectionInfo)
{
TargetConnectionInfo = targetConnectionInfo;
CustomInit();
}

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

/// <summary>
/// Gets or sets connection information for target SQL Server
/// </summary>
[JsonProperty(PropertyName = "targetConnectionInfo")]
public SqlConnectionInfo TargetConnectionInfo { get; set; }

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