/// <summary>
 /// Get an script execution resource by name in a private cloud
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='privateCloudName'>
 /// Name of the private cloud
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ScriptExecution> > ListAsync(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Create or update a script execution resource in a private cloud
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='privateCloudName'>
 /// The name of the private cloud.
 /// </param>
 /// <param name='scriptExecutionName'>
 /// Name of the user-invoked script execution resource
 /// </param>
 /// <param name='scriptExecution'>
 /// A script running in the private cloud
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ScriptExecution> BeginCreateOrUpdateAsync(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName, ScriptExecution scriptExecution, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get an script execution resource by name in a private cloud
 /// </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 <ScriptExecution> > ListNextAsync(this IScriptExecutionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Return the logs for a script execution resource
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='privateCloudName'>
 /// Name of the private cloud
 /// </param>
 /// <param name='scriptExecutionName'>
 /// Name of the user-invoked script execution resource
 /// </param>
 /// <param name='scriptOutputStreamType'>
 /// Name of the desired output stream to return. If not provided, will return
 /// all. An empty array will return nothing
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ScriptExecution> GetExecutionLogsAsync(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName, IList <string> scriptOutputStreamType = default(IList <string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetExecutionLogsWithHttpMessagesAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptOutputStreamType, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Operations             = new Operations(this);
     Locations              = new LocationsOperations(this);
     PrivateClouds          = new PrivateCloudsOperations(this);
     Clusters               = new ClustersOperations(this);
     Datastores             = new DatastoresOperations(this);
     HcxEnterpriseSites     = new HcxEnterpriseSitesOperations(this);
     Authorizations         = new AuthorizationsOperations(this);
     GlobalReachConnections = new GlobalReachConnectionsOperations(this);
     WorkloadNetworks       = new WorkloadNetworksOperations(this);
     CloudLinks             = new CloudLinksOperations(this);
     Addons           = new AddonsOperations(this);
     ScriptPackages   = new ScriptPackagesOperations(this);
     ScriptCmdlets    = new ScriptCmdletsOperations(this);
     ScriptExecutions = new ScriptExecutionsOperations(this);
     BaseUri          = new System.Uri("https://management.azure.com");
     ApiVersion       = "2021-06-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()
         }
     };
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <AddonProperties>("addonType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <AddonProperties>("addonType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <WorkloadNetworkDhcpEntity>("dhcpType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <WorkloadNetworkDhcpEntity>("dhcpType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <ScriptExecutionParameter>("type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <ScriptExecutionParameter>("type"));
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
 /// <summary>
 /// Get an script execution resource by name in a private cloud
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='privateCloudName'>
 /// Name of the private cloud
 /// </param>
 /// <param name='scriptExecutionName'>
 /// Name of the user-invoked script execution resource
 /// </param>
 public static ScriptExecution Get(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName)
 {
     return(operations.GetAsync(resourceGroupName, privateCloudName, scriptExecutionName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get an script execution resource by name in a private cloud
 /// </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 <ScriptExecution> ListNext(this IScriptExecutionsOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Cancel a ScriptExecution in a private cloud
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='privateCloudName'>
 /// Name of the private cloud
 /// </param>
 /// <param name='scriptExecutionName'>
 /// Name of the user-invoked script execution resource
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginDeleteAsync(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, scriptExecutionName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Cancel a ScriptExecution in a private cloud
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='privateCloudName'>
 /// Name of the private cloud
 /// </param>
 /// <param name='scriptExecutionName'>
 /// Name of the user-invoked script execution resource
 /// </param>
 public static void BeginDelete(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName)
 {
     operations.BeginDeleteAsync(resourceGroupName, privateCloudName, scriptExecutionName).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Create or update a script execution resource in a private cloud
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='privateCloudName'>
 /// The name of the private cloud.
 /// </param>
 /// <param name='scriptExecutionName'>
 /// Name of the user-invoked script execution resource
 /// </param>
 /// <param name='scriptExecution'>
 /// A script running in the private cloud
 /// </param>
 public static ScriptExecution BeginCreateOrUpdate(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName, ScriptExecution scriptExecution)
 {
     return(operations.BeginCreateOrUpdateAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Return the logs for a script execution resource
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='privateCloudName'>
 /// Name of the private cloud
 /// </param>
 /// <param name='scriptExecutionName'>
 /// Name of the user-invoked script execution resource
 /// </param>
 /// <param name='scriptOutputStreamType'>
 /// Name of the desired output stream to return. If not provided, will return
 /// all. An empty array will return nothing
 /// </param>
 public static ScriptExecution GetExecutionLogs(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName, IList <string> scriptOutputStreamType = default(IList <string>))
 {
     return(operations.GetExecutionLogsAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptOutputStreamType).GetAwaiter().GetResult());
 }