/// <summary>
 /// Returns a list of destination shares that the system considers as best
 /// candidates for migration.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group name.
 /// </param>
 /// <param name='farmId'>
 /// Farm Id.
 /// </param>
 /// <param name='shareName'>
 /// Share name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <Share> > ListDestinationSharesAsync(this IContainersOperations operations, string resourceGroupName, string farmId, string shareName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListDestinationSharesWithHttpMessagesAsync(resourceGroupName, farmId, shareName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Returns the list of containers which can be migrated in the specified
 /// share.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group name.
 /// </param>
 /// <param name='farmId'>
 /// Farm Id.
 /// </param>
 /// <param name='shareName'>
 /// Share name.
 /// </param>
 /// <param name='intent'>
 /// The container migration intent.
 /// </param>
 /// <param name='maxCount'>
 /// The maximum number of containers.
 /// </param>
 /// <param name='startIndex'>
 /// The starting index the resource provider uses.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <Container> > ListAsync(this IContainersOperations operations, string resourceGroupName, string farmId, string shareName, string intent, int?maxCount = default(int?), int?startIndex = default(int?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, farmId, shareName, intent, maxCount, startIndex, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Attach to the output of a specific container instance.
 /// </summary>
 /// <remarks>
 /// Attach to the output stream of a specific container instance in a specified
 /// resource group and container group.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='containerGroupName'>
 /// The name of the container group.
 /// </param>
 /// <param name='containerName'>
 /// The name of the container instance.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ContainerAttachResponse> AttachAsync(this IContainersOperations operations, string resourceGroupName, string containerGroupName, string containerName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.AttachWithHttpMessagesAsync(resourceGroupName, containerGroupName, containerName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get the logs for a specified container instance.
 /// </summary>
 /// <remarks>
 /// Get the logs for a specified container instance in a specified resource
 /// group and container group.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='containerGroupName'>
 /// The name of the container group.
 /// </param>
 /// <param name='containerName'>
 /// The name of the container instance.
 /// </param>
 /// <param name='tail'>
 /// The number of lines to show from the tail of the container instance log. If
 /// not provided, all available logs are shown up to 4mb.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Logs> ListLogsAsync(this IContainersOperations operations, string resourceGroupName, string containerGroupName, string containerName, int?tail, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListLogsWithHttpMessagesAsync(resourceGroupName, containerGroupName, containerName, tail, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Creates a new container or updates an existing container on the device.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='deviceName'>
 /// The device name.
 /// </param>
 /// <param name='storageAccountName'>
 /// The Storage Account Name
 /// </param>
 /// <param name='containerName'>
 /// The container name.
 /// </param>
 /// <param name='container'>
 /// The container properties.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Container> BeginCreateOrUpdateAsync(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, Container container, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, storageAccountName, containerName, container, resourceGroupName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists all the containers of a storage Account in a Data Box Edge/Data Box
 /// Gateway device.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <Container> > ListByStorageAccountNextAsync(this IContainersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByStorageAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Executes a command in a specific container instance.
 /// </summary>
 /// <remarks>
 /// Executes a command for a specific container instance in a specified
 /// resource group and container group.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='containerGroupName'>
 /// The name of the container group.
 /// </param>
 /// <param name='containerName'>
 /// The name of the container instance.
 /// </param>
 /// <param name='containerExecRequest'>
 /// The request for the exec command.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ContainerExecResponse> ExecuteCommandAsync(this IContainersOperations operations, string resourceGroupName, string containerGroupName, string containerName, ContainerExecRequest containerExecRequest, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ExecuteCommandWithHttpMessagesAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists all the containers of a storage Account in a Data Box Edge/Data Box
 /// Gateway device.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='deviceName'>
 /// The device name.
 /// </param>
 /// <param name='storageAccountName'>
 /// The storage Account name.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <Container> > ListByStorageAccountAsync(this IContainersOperations operations, string deviceName, string storageAccountName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByStorageAccountWithHttpMessagesAsync(deviceName, storageAccountName, resourceGroupName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Starts a container migration job to migrate containers to the specified
 /// destination share.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group name.
 /// </param>
 /// <param name='farmId'>
 /// Farm Id.
 /// </param>
 /// <param name='shareName'>
 /// Share name.
 /// </param>
 /// <param name='migrationParameters'>
 /// The parameters of container migration job.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MigrationResult> BeginMigrateAsync(this IContainersOperations operations, string resourceGroupName, string farmId, string shareName, MigrationParameters migrationParameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginMigrateWithHttpMessagesAsync(resourceGroupName, farmId, shareName, migrationParameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Cancel a container migration job.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group name.
 /// </param>
 /// <param name='farmId'>
 /// Farm Id.
 /// </param>
 /// <param name='operationId'>
 /// Operation Id.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MigrationResult> CancelMigrationAsync(this IContainersOperations operations, string resourceGroupName, string farmId, string operationId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CancelMigrationWithHttpMessagesAsync(resourceGroupName, farmId, operationId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #11
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     ContainerGroups = new ContainerGroupsOperations(this);
     Operations      = new Operations(this);
     Location        = new LocationOperations(this);
     Containers      = new ContainersOperations(this);
     BaseUri         = new System.Uri("https://management.azure.com");
     ApiVersion      = "2021-07-01";
     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());
 }
 /// <summary>
 /// Gets a container by name.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='deviceName'>
 /// The device name.
 /// </param>
 /// <param name='storageAccountName'>
 /// The Storage Account Name
 /// </param>
 /// <param name='containerName'>
 /// The container Name
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 public static Container Get(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName)
 {
     return(operations.GetAsync(deviceName, storageAccountName, containerName, resourceGroupName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Attach to the output of a specific container instance.
 /// </summary>
 /// <remarks>
 /// Attach to the output stream of a specific container instance in a specified
 /// resource group and container group.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='containerGroupName'>
 /// The name of the container group.
 /// </param>
 /// <param name='containerName'>
 /// The name of the container instance.
 /// </param>
 public static ContainerAttachResponse Attach(this IContainersOperations operations, string resourceGroupName, string containerGroupName, string containerName)
 {
     return(operations.AttachAsync(resourceGroupName, containerGroupName, containerName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get the logs for a specified container instance.
 /// </summary>
 /// <remarks>
 /// Get the logs for a specified container instance in a specified resource
 /// group and container group.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='containerGroupName'>
 /// The name of the container group.
 /// </param>
 /// <param name='containerName'>
 /// The name of the container instance.
 /// </param>
 /// <param name='tail'>
 /// The number of lines to show from the tail of the container instance log. If
 /// not provided, all available logs are shown up to 4mb.
 /// </param>
 public static Logs ListLogs(this IContainersOperations operations, string resourceGroupName, string containerGroupName, string containerName, int?tail = default(int?))
 {
     return(operations.ListLogsAsync(resourceGroupName, containerGroupName, containerName, tail).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Executes a command in a specific container instance.
 /// </summary>
 /// <remarks>
 /// Executes a command for a specific container instance in a specified
 /// resource group and container group.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='containerGroupName'>
 /// The name of the container group.
 /// </param>
 /// <param name='containerName'>
 /// The name of the container instance.
 /// </param>
 /// <param name='containerExecRequest'>
 /// The request for the exec command.
 /// </param>
 public static ContainerExecResponse ExecuteCommand(this IContainersOperations operations, string resourceGroupName, string containerGroupName, string containerName, ContainerExecRequest containerExecRequest)
 {
     return(operations.ExecuteCommandAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Refreshes the container metadata with the data from the cloud.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='deviceName'>
 /// The device name.
 /// </param>
 /// <param name='storageAccountName'>
 /// The Storage Account Name
 /// </param>
 /// <param name='containerName'>
 /// The container name.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginRefreshAsync(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginRefreshWithHttpMessagesAsync(deviceName, storageAccountName, containerName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Lists all the containers of a storage Account in a Data Box Edge/Data Box
 /// Gateway device.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <Container> ListByStorageAccountNext(this IContainersOperations operations, string nextPageLink)
 {
     return(operations.ListByStorageAccountNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Lists all the containers of a storage Account in a Data Box Edge/Data Box
 /// Gateway device.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='deviceName'>
 /// The device name.
 /// </param>
 /// <param name='storageAccountName'>
 /// The storage Account name.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 public static IPage <Container> ListByStorageAccount(this IContainersOperations operations, string deviceName, string storageAccountName, string resourceGroupName)
 {
     return(operations.ListByStorageAccountAsync(deviceName, storageAccountName, resourceGroupName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Refreshes the container metadata with the data from the cloud.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='deviceName'>
 /// The device name.
 /// </param>
 /// <param name='storageAccountName'>
 /// The Storage Account Name
 /// </param>
 /// <param name='containerName'>
 /// The container name.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 public static void BeginRefresh(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName)
 {
     operations.BeginRefreshAsync(deviceName, storageAccountName, containerName, resourceGroupName).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Returns the list of containers which can be migrated in the specified
 /// share.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group name.
 /// </param>
 /// <param name='farmId'>
 /// Farm Id.
 /// </param>
 /// <param name='shareName'>
 /// Share name.
 /// </param>
 /// <param name='intent'>
 /// The container migration intent.
 /// </param>
 /// <param name='maxCount'>
 /// The maximum number of containers.
 /// </param>
 /// <param name='startIndex'>
 /// The starting index the resource provider uses.
 /// </param>
 public static IList <Container> List(this IContainersOperations operations, string resourceGroupName, string farmId, string shareName, string intent, int?maxCount = default(int?), int?startIndex = default(int?))
 {
     return(operations.ListAsync(resourceGroupName, farmId, shareName, intent, maxCount, startIndex).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Creates a new container or updates an existing container on the device.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='deviceName'>
 /// The device name.
 /// </param>
 /// <param name='storageAccountName'>
 /// The Storage Account Name
 /// </param>
 /// <param name='containerName'>
 /// The container name.
 /// </param>
 /// <param name='container'>
 /// The container properties.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 public static Container BeginCreateOrUpdate(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, Container container, string resourceGroupName)
 {
     return(operations.BeginCreateOrUpdateAsync(deviceName, storageAccountName, containerName, container, resourceGroupName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Returns the status of a container migration job.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group name.
 /// </param>
 /// <param name='farmId'>
 /// Farm Id.
 /// </param>
 /// <param name='operationId'>
 /// Operation Id.
 /// </param>
 public static MigrationResult MigrationStatus(this IContainersOperations operations, string resourceGroupName, string farmId, string operationId)
 {
     return(operations.MigrationStatusAsync(resourceGroupName, farmId, operationId).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Returns a list of destination shares that the system considers as best
 /// candidates for migration.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group name.
 /// </param>
 /// <param name='farmId'>
 /// Farm Id.
 /// </param>
 /// <param name='shareName'>
 /// Share name.
 /// </param>
 public static IList <Share> ListDestinationShares(this IContainersOperations operations, string resourceGroupName, string farmId, string shareName)
 {
     return(operations.ListDestinationSharesAsync(resourceGroupName, farmId, shareName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Starts a container migration job to migrate containers to the specified
 /// destination share.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group name.
 /// </param>
 /// <param name='farmId'>
 /// Farm Id.
 /// </param>
 /// <param name='shareName'>
 /// Share name.
 /// </param>
 /// <param name='migrationParameters'>
 /// The parameters of container migration job.
 /// </param>
 public static MigrationResult BeginMigrate(this IContainersOperations operations, string resourceGroupName, string farmId, string shareName, MigrationParameters migrationParameters)
 {
     return(operations.BeginMigrateAsync(resourceGroupName, farmId, shareName, migrationParameters).GetAwaiter().GetResult());
 }