/// <summary>
 /// Starts the exec command for a specific container instance.
 /// </summary>
 /// <remarks>
 /// Starts the exec command 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='containerExecRequest'>
 /// The request for the exec command.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ContainerExecResponseInner> LaunchExecAsync(this IStartContainerOperations operations, string resourceGroupName, string containerGroupName, string containerName, ContainerExecRequestInner containerExecRequest, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.LaunchExecWithHttpMessagesAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     ContainerGroups     = new ContainerGroupsOperations(this);
     Operations          = new Operations(this);
     ContainerGroupUsage = new ContainerGroupUsageOperations(this);
     ContainerLogs       = new ContainerLogsOperations(this);
     StartContainer      = new StartContainerOperations(this);
     BaseUri             = new System.Uri("https://management.azure.com");
     ApiVersion          = "2018-04-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());
 }