/// <summary>
 /// Add a definition for a DNS server to an existing deployment. VM's
 /// in this deployment will be programmed to use this DNS server for
 /// all DNS resolutions
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IDNSServerOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of the service.
 /// </param>
 /// <param name='deploymentName'>
 /// Required. The name of the deployment.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Add DNS Server operation.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request and error information regarding
 /// the failure.
 /// </returns>
 public static OperationStatusResponse AddDNSServer(this IDNSServerOperations operations, string serviceName, string deploymentName, DNSAddParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDNSServerOperations)s).AddDNSServerAsync(serviceName, deploymentName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the ComputeManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public ComputeManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._deployments                        = new DeploymentOperations(this);
     this._dnsServer                          = new DNSServerOperations(this);
     this._extensionImages                    = new ExtensionImageOperations(this);
     this._hostedServices                     = new HostedServiceOperations(this);
     this._loadBalancers                      = new LoadBalancerOperations(this);
     this._operatingSystems                   = new OperatingSystemOperations(this);
     this._serviceCertificates                = new ServiceCertificateOperations(this);
     this._virtualMachineDisks                = new VirtualMachineDiskOperations(this);
     this._virtualMachineExtensions           = new VirtualMachineExtensionOperations(this);
     this._virtualMachines                    = new VirtualMachineOperations(this);
     this._virtualMachineOSImages             = new VirtualMachineOSImageOperations(this);
     this._virtualMachineVMImages             = new VirtualMachineVMImageOperations(this);
     this._apiVersion                         = "2014-10-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout                  = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Deletes a definition for an existing DNS server from the deployment
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IDNSServerOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of the service.
 /// </param>
 /// <param name='deploymentName'>
 /// Required. The name of the deployment.
 /// </param>
 /// <param name='dnsServerName'>
 /// Required. The name of the dns server.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request and error information regarding
 /// the failure.
 /// </returns>
 public static Task <OperationStatusResponse> DeleteDNSServerAsync(this IDNSServerOperations operations, string serviceName, string deploymentName, string dnsServerName)
 {
     return(operations.DeleteDNSServerAsync(serviceName, deploymentName, dnsServerName, CancellationToken.None));
 }
 /// <summary>
 /// Updates a definition for an existing DNS server. Updates to address
 /// is the only change allowed. DNS server name cannot be changed
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IDNSServerOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of the service.
 /// </param>
 /// <param name='deploymentName'>
 /// Required. The name of the deployment.
 /// </param>
 /// <param name='dnsServerName'>
 /// Required. The name of the dns server.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Update DNS Server operation.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request and error information regarding
 /// the failure.
 /// </returns>
 public static Task <OperationStatusResponse> UpdateDNSServerAsync(this IDNSServerOperations operations, string serviceName, string deploymentName, string dnsServerName, DNSUpdateParameters parameters)
 {
     return(operations.UpdateDNSServerAsync(serviceName, deploymentName, dnsServerName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Add a definition for a DNS server to an existing deployment. VM's
 /// in this deployment will be programmed to use this DNS server for
 /// all DNS resolutions
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IDNSServerOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of the service.
 /// </param>
 /// <param name='deploymentName'>
 /// Required. The name of the deployment.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Add DNS Server operation.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request and error information regarding
 /// the failure.
 /// </returns>
 public static Task <OperationStatusResponse> BeginAddingDNSServerAsync(this IDNSServerOperations operations, string serviceName, string deploymentName, DNSAddParameters parameters)
 {
     return(operations.BeginAddingDNSServerAsync(serviceName, deploymentName, parameters, CancellationToken.None));
 }