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

Add Postgres/MySql/ManagedInstance online migration scenarios #5120

Merged
merged 4 commits into from
Jan 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -46,6 +46,11 @@ public partial class DataMigrationServiceClient : ServiceClient<DataMigrationSer
/// </summary>
public ServiceClientCredentials Credentials { get; private set; }

/// <summary>
/// Version of the API
/// </summary>
public string ApiVersion { get; private set; }

/// <summary>
/// Identifier of the subscription
/// </summary>
Expand Down Expand Up @@ -353,6 +358,7 @@ private void Initialize()
Operations = new Operations(this);
Files = new FilesOperations(this);
BaseUri = new System.Uri("https://management.azure.com");
ApiVersion = "2018-07-15-preview";
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
GenerateClientRequestId = true;
Expand Down Expand Up @@ -394,6 +400,8 @@ private void Initialize()
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<MigrateSqlServerSqlDbSyncTaskOutput>("resultType"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<MigrateSqlServerSqlDbTaskOutput>("resultType"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<MigrateSqlServerSqlDbTaskOutput>("resultType"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<MigrateSqlServerSqlMISyncTaskOutput>("resultType"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<MigrateSqlServerSqlMISyncTaskOutput>("resultType"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<MigrateSqlServerSqlMITaskOutput>("resultType"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<MigrateSqlServerSqlMITaskOutput>("resultType"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<ConnectToSourceSqlServerTaskOutput>("resultType"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ internal FilesOperations(DataMigrationServiceClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "projectName");
}
string apiVersion = "2018-07-15-preview";
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand All @@ -116,7 +119,6 @@ internal FilesOperations(DataMigrationServiceClient client)
tracingParameters.Add("groupName", groupName);
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("projectName", projectName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
Expand All @@ -128,9 +130,9 @@ internal FilesOperations(DataMigrationServiceClient client)
_url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName));
_url = _url.Replace("{projectName}", System.Uri.EscapeDataString(projectName));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
Expand Down Expand Up @@ -315,7 +317,10 @@ internal FilesOperations(DataMigrationServiceClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "fileName");
}
string apiVersion = "2018-07-15-preview";
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand All @@ -327,7 +332,6 @@ internal FilesOperations(DataMigrationServiceClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("projectName", projectName);
tracingParameters.Add("fileName", fileName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
Expand All @@ -340,9 +344,9 @@ internal FilesOperations(DataMigrationServiceClient client)
_url = _url.Replace("{projectName}", System.Uri.EscapeDataString(projectName));
_url = _url.Replace("{fileName}", System.Uri.EscapeDataString(fileName));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
Expand Down Expand Up @@ -532,7 +536,10 @@ internal FilesOperations(DataMigrationServiceClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "fileName");
}
string apiVersion = "2018-07-15-preview";
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand All @@ -545,7 +552,6 @@ internal FilesOperations(DataMigrationServiceClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("projectName", projectName);
tracingParameters.Add("fileName", fileName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
Expand All @@ -558,9 +564,9 @@ internal FilesOperations(DataMigrationServiceClient client)
_url = _url.Replace("{projectName}", System.Uri.EscapeDataString(projectName));
_url = _url.Replace("{fileName}", System.Uri.EscapeDataString(fileName));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
Expand Down Expand Up @@ -764,7 +770,10 @@ internal FilesOperations(DataMigrationServiceClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "fileName");
}
string apiVersion = "2018-07-15-preview";
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand All @@ -776,7 +785,6 @@ internal FilesOperations(DataMigrationServiceClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("projectName", projectName);
tracingParameters.Add("fileName", fileName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
Expand All @@ -789,9 +797,9 @@ internal FilesOperations(DataMigrationServiceClient client)
_url = _url.Replace("{projectName}", System.Uri.EscapeDataString(projectName));
_url = _url.Replace("{fileName}", System.Uri.EscapeDataString(fileName));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
Expand Down Expand Up @@ -963,7 +971,10 @@ internal FilesOperations(DataMigrationServiceClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "fileName");
}
string apiVersion = "2018-07-15-preview";
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand All @@ -976,7 +987,6 @@ internal FilesOperations(DataMigrationServiceClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("projectName", projectName);
tracingParameters.Add("fileName", fileName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
}
Expand All @@ -989,9 +999,9 @@ internal FilesOperations(DataMigrationServiceClient client)
_url = _url.Replace("{projectName}", System.Uri.EscapeDataString(projectName));
_url = _url.Replace("{fileName}", System.Uri.EscapeDataString(fileName));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
Expand Down Expand Up @@ -1181,7 +1191,10 @@ internal FilesOperations(DataMigrationServiceClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "fileName");
}
string apiVersion = "2018-07-15-preview";
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand All @@ -1193,7 +1206,6 @@ internal FilesOperations(DataMigrationServiceClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("projectName", projectName);
tracingParameters.Add("fileName", fileName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Read", tracingParameters);
}
Expand All @@ -1206,9 +1218,9 @@ internal FilesOperations(DataMigrationServiceClient client)
_url = _url.Replace("{projectName}", System.Uri.EscapeDataString(projectName));
_url = _url.Replace("{fileName}", System.Uri.EscapeDataString(fileName));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
Expand Down Expand Up @@ -1392,7 +1404,10 @@ internal FilesOperations(DataMigrationServiceClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "fileName");
}
string apiVersion = "2018-07-15-preview";
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
Expand All @@ -1404,7 +1419,6 @@ internal FilesOperations(DataMigrationServiceClient client)
tracingParameters.Add("serviceName", serviceName);
tracingParameters.Add("projectName", projectName);
tracingParameters.Add("fileName", fileName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ReadWrite", tracingParameters);
}
Expand All @@ -1417,9 +1431,9 @@ internal FilesOperations(DataMigrationServiceClient client)
_url = _url.Replace("{projectName}", System.Uri.EscapeDataString(projectName));
_url = _url.Replace("{fileName}", System.Uri.EscapeDataString(fileName));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public partial interface IDataMigrationServiceClient : System.IDisposable
/// </summary>
ServiceClientCredentials Credentials { get; }

/// <summary>
/// Version of the API
/// </summary>
string ApiVersion { get; }

/// <summary>
/// Identifier of the subscription
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public partial interface ITasksOperations
/// The tasks resource is a nested, proxy-only resource representing
/// work performed by a DMS instance. The PUT method creates a new task
/// or updates an existing one, although since tasks have no mutable
/// custom properties, there is little reason to update an exising one.
/// custom properties, there is little reason to update an existing
/// one.
/// </remarks>
/// <param name='parameters'>
/// Information about the task
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// <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>
/// Azure Active Directory Application
/// </summary>
public partial class AzureActiveDirectoryApp
{
/// <summary>
/// Initializes a new instance of the AzureActiveDirectoryApp class.
/// </summary>
public AzureActiveDirectoryApp()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the AzureActiveDirectoryApp class.
/// </summary>
/// <param name="applicationId">Application ID of the Azure Active
/// Directory Application</param>
/// <param name="appKey">Key used to authenticate to the Azure Active
/// Directory Application</param>
/// <param name="tenantId">Tenant id of the customer</param>
public AzureActiveDirectoryApp(string applicationId, string appKey, string tenantId)
{
ApplicationId = applicationId;
AppKey = appKey;
TenantId = tenantId;
CustomInit();
}

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

/// <summary>
/// Gets or sets application ID of the Azure Active Directory
/// Application
/// </summary>
[JsonProperty(PropertyName = "applicationId")]
public string ApplicationId { get; set; }

/// <summary>
/// Gets or sets key used to authenticate to the Azure Active Directory
/// Application
/// </summary>
[JsonProperty(PropertyName = "appKey")]
public string AppKey { get; set; }

/// <summary>
/// Gets or sets tenant id of the customer
/// </summary>
[JsonProperty(PropertyName = "tenantId")]
public string TenantId { get; set; }

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