/// <summary>
 /// The Begin Creating Service Certificate operation adds a certificate
 /// to a hosted service. This operation is an asynchronous operation.
 /// To determine whether the management service has finished
 /// processing the request, call Get Operation Status.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460817.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The DNS prefix name of your service.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Begin Creating Service
 /// Certificate operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse BeginCreating(this IServiceCertificateOperations operations, string serviceName, ServiceCertificateCreateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IServiceCertificateOperations)s).BeginCreatingAsync(serviceName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// The List Service Certificates operation lists all of the service
 /// certificates associated with the specified hosted service.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154105.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The DNS prefix name of your hosted service.
 /// </param>
 /// <returns>
 /// The List Service Certificates operation response.
 /// </returns>
 public static ServiceCertificateListResponse List(this IServiceCertificateOperations operations, string serviceName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IServiceCertificateOperations)s).ListAsync(serviceName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// The Get Service Certificate operation returns the public data for
 /// the specified X.509 certificate associated with a hosted service.
 /// (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460792.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Get Service Certificate
 /// operation.
 /// </param>
 /// <returns>
 /// The Get Service Certificate operation response.
 /// </returns>
 public static ServiceCertificateGetResponse Get(this IServiceCertificateOperations operations, ServiceCertificateGetParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IServiceCertificateOperations)s).GetAsync(parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the ComputeManagementClient class.
 /// </summary>
 private ComputeManagementClient()
     : base()
 {
     this._deployments              = new DeploymentOperations(this);
     this._hostedServices           = new HostedServiceOperations(this);
     this._operatingSystems         = new OperatingSystemOperations(this);
     this._serviceCertificates      = new ServiceCertificateOperations(this);
     this._virtualMachineDisks      = new VirtualMachineDiskOperations(this);
     this._virtualMachineExtensions = new VirtualMachineExtensionOperations(this);
     this._virtualMachineImages     = new VirtualMachineImageOperations(this);
     this._virtualMachines          = new VirtualMachineOperations(this);
     this.HttpClient.Timeout        = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// The Add Service Certificate operation adds a certificate to a
 /// hosted service.  The Add Service Certificate operation is an
 /// asynchronous operation. To determine whether the management
 /// service has finished processing the request, call Get Operation
 /// Status.   (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460817.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='serviceName'>
 /// The DNS prefix name of your service.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Service Certificate operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse BeginCreating(this IServiceCertificateOperations operations, string serviceName, ServiceCertificateCreateParameters parameters)
 {
     try
     {
         return(operations.BeginCreatingAsync(serviceName, parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The List Service Certificates operation lists all of the service
 /// certificates associated with the specified hosted service.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154105.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='serviceName'>
 /// The DNS prefix name of your hosted service.
 /// </param>
 /// <returns>
 /// The List Service Certificates operation response.
 /// </returns>
 public static ServiceCertificateListResponse List(this IServiceCertificateOperations operations, string serviceName)
 {
     try
     {
         return(operations.ListAsync(serviceName).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Get Service Certificate operation returns the public data for
 /// the specified X.509 certificate associated with a hosted service.
 /// (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460792.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Get Service Certificate operation.
 /// </param>
 /// <returns>
 /// The Get Service Certificate operation response.
 /// </returns>
 public static ServiceCertificateGetResponse Get(this IServiceCertificateOperations operations, ServiceCertificateGetParameters parameters)
 {
     try
     {
         return(operations.GetAsync(parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Delete Service Certificate operation deletes a service
 /// certificate from the certificate store of a hosted service.  The
 /// Delete Service Certificate operation is an asynchronous operation.
 /// To determine whether the management service has finished
 /// processing the request, call Get Operation Status.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460803.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Delete Service Certificate 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 also includes error
 /// information regarding the failure.
 /// </returns>
 public static ComputeOperationStatusResponse Delete(this IServiceCertificateOperations operations, ServiceCertificateDeleteParameters parameters)
 {
     try
     {
         return(operations.DeleteAsync(parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Initializes a new instance of the ComputeManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 private ComputeManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._deployments              = new DeploymentOperations(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-05-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// The List Service Certificates operation lists all of the service
 /// certificates associated with the specified hosted service.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154105.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='serviceName'>
 /// The DNS prefix name of your hosted service.
 /// </param>
 /// <returns>
 /// The List Service Certificates operation response.
 /// </returns>
 public static Task <ServiceCertificateListResponse> ListAsync(this IServiceCertificateOperations operations, string serviceName)
 {
     return(operations.ListAsync(serviceName, CancellationToken.None));
 }
 /// <summary>
 /// The Get Service Certificate operation returns the public data for
 /// the specified X.509 certificate associated with a hosted service.
 /// (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460792.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Get Service Certificate operation.
 /// </param>
 /// <returns>
 /// The Get Service Certificate operation response.
 /// </returns>
 public static Task <ServiceCertificateGetResponse> GetAsync(this IServiceCertificateOperations operations, ServiceCertificateGetParameters parameters)
 {
     return(operations.GetAsync(parameters, CancellationToken.None));
 }
 /// <summary>
 /// The Delete Service Certificate operation deletes a service
 /// certificate from the certificate store of a hosted service.  The
 /// Delete Service Certificate operation is an asynchronous operation.
 /// To determine whether the management service has finished
 /// processing the request, call Get Operation Status.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460803.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Delete Service Certificate 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 also includes error
 /// information regarding the failure.
 /// </returns>
 public static Task <ComputeOperationStatusResponse> DeleteAsync(this IServiceCertificateOperations operations, ServiceCertificateDeleteParameters parameters)
 {
     return(operations.DeleteAsync(parameters, CancellationToken.None));
 }
 /// <summary>
 /// The Add Service Certificate operation adds a certificate to a
 /// hosted service.  The Add Service Certificate operation is an
 /// asynchronous operation. To determine whether the management
 /// service has finished processing the request, call Get Operation
 /// Status.  This overload will   (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460817.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='serviceName'>
 /// The DNS prefix name of your service.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Service Certificate 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 also includes error
 /// information regarding the failure.
 /// </returns>
 public static Task <ComputeOperationStatusResponse> CreateAsync(this IServiceCertificateOperations operations, string serviceName, ServiceCertificateCreateParameters parameters)
 {
     return(operations.CreateAsync(serviceName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// The Delete Service Certificate operation deletes a service
 /// certificate from the certificate store of a hosted service.  The
 /// Delete Service Certificate operation is an asynchronous operation.
 /// To determine whether the management service has finished
 /// processing the request, call Get Operation Status.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460803.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Delete Service Certificate operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <OperationResponse> BeginDeletingAsync(this IServiceCertificateOperations operations, ServiceCertificateDeleteParameters parameters)
 {
     return(operations.BeginDeletingAsync(parameters, CancellationToken.None));
 }
 /// <summary>
 /// The Add Service Certificate operation adds a certificate to a
 /// hosted service.  The Add Service Certificate operation is an
 /// asynchronous operation. To determine whether the management
 /// service has finished processing the request, call Get Operation
 /// Status.   (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460817.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IServiceCertificateOperations.
 /// </param>
 /// <param name='serviceName'>
 /// The DNS prefix name of your service.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Service Certificate operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <OperationResponse> BeginCreatingAsync(this IServiceCertificateOperations operations, string serviceName, ServiceCertificateCreateParameters parameters)
 {
     return(operations.BeginCreatingAsync(serviceName, parameters, CancellationToken.None));
 }