Exemplo n.º 1
0
 /// <summary>
 /// Returns the requested disk migration job.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='migrationId'>
 /// The migration job guid name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <DiskMigrationJob> GetAsync(this IDiskMigrationJobsOperations operations, string location, string migrationId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(location, migrationId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Returns a list of disk migration jobs.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='status'>
 /// The parameters of disk migration job status.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IEnumerable <DiskMigrationJob> > ListAsync(this IDiskMigrationJobsOperations operations, string location, string status = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(location, status, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create a disk migration job.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='migrationId'>
 /// The migration job guid name.
 /// </param>
 /// <param name='targetShare'>
 /// The target share name.
 /// </param>
 /// <param name='disks'>
 /// The parameters of disk list.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <DiskMigrationJob> CreateAsync(this IDiskMigrationJobsOperations operations, string location, string migrationId, string targetShare, IList <Disk> disks, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(location, migrationId, targetShare, disks, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Operations        = new Operations(this);
     PlatformImages    = new PlatformImagesOperations(this);
     Quotas            = new QuotasOperations(this);
     VMExtensions      = new VMExtensionsOperations(this);
     Disks             = new DisksOperations(this);
     DiskMigrationJobs = new DiskMigrationJobsOperations(this);
     BaseUri           = new System.Uri("https://adminmanagement.local.azurestack.external");
     AcceptLanguage    = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Exemplo n.º 5
0
 /// <summary>
 /// Returns the requested disk migration job.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='migrationId'>
 /// The migration job guid name.
 /// </param>
 public static DiskMigrationJob Get(this IDiskMigrationJobsOperations operations, string location, string migrationId)
 {
     return(operations.GetAsync(location, migrationId).GetAwaiter().GetResult());
 }
Exemplo n.º 6
0
 /// <summary>
 /// Returns a list of disk migration jobs.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='status'>
 /// The parameters of disk migration job status.
 /// </param>
 public static IEnumerable <DiskMigrationJob> List(this IDiskMigrationJobsOperations operations, string location, string status = default(string))
 {
     return(operations.ListAsync(location, status).GetAwaiter().GetResult());
 }
Exemplo n.º 7
0
 /// <summary>
 /// Create a disk migration job.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='migrationId'>
 /// The migration job guid name.
 /// </param>
 /// <param name='targetShare'>
 /// The target share name.
 /// </param>
 /// <param name='disks'>
 /// The parameters of disk list.
 /// </param>
 public static DiskMigrationJob Create(this IDiskMigrationJobsOperations operations, string location, string migrationId, string targetShare, IList <Disk> disks)
 {
     return(operations.CreateAsync(location, migrationId, targetShare, disks).GetAwaiter().GetResult());
 }