/// <summary>
 /// Deletes a job collection.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// Required. The name of the cloud service.
 /// </param>
 /// <param name='jobCollectionName'>
 /// Required. The name of the job collection to delete.
 /// </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 SchedulerOperationStatusResponse Delete(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IJobCollectionOperations)s).DeleteAsync(cloudServiceName, jobCollectionName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create a job collection.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// Required. The name of the cloud service containing the job
 /// collection.
 /// </param>
 /// <param name='jobCollectionName'>
 /// Required. The name of the job collection to create.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Create Job Collection
 /// operation.
 /// </param>
 /// <returns>
 /// The Create Job Collection operation response.
 /// </returns>
 public static JobCollectionCreateResponse BeginCreating(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName, JobCollectionCreateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IJobCollectionOperations)s).BeginCreatingAsync(cloudServiceName, jobCollectionName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Initializes a new instance of the SchedulerManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 private SchedulerManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._jobCollections = new JobCollectionOperations(this);
     this._apiVersion     = "2013-03-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Beispiel #4
0
 /// <summary>
 /// Create a job collection.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// The name of the cloud service containing the job collection.
 /// </param>
 /// <param name='jobCollectionName'>
 /// The name of the job collection to create.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Job Collection operation.
 /// </param>
 /// <returns>
 /// The Create Job Collection operation response.
 /// </returns>
 public static JobCollectionCreateResponse BeginCreating(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName, JobCollectionCreateParameters parameters)
 {
     try
     {
         return(operations.BeginCreatingAsync(cloudServiceName, jobCollectionName, parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Beispiel #5
0
 /// <summary>
 /// Update a job collection.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// The name of the cloud service containing the job collection.
 /// </param>
 /// <param name='jobCollectionName'>
 /// The name of the job collection to update.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Update Job Collection 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 SchedulerOperationStatusResponse Update(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName, JobCollectionUpdateParameters parameters)
 {
     try
     {
         return(operations.UpdateAsync(cloudServiceName, jobCollectionName, parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Beispiel #6
0
 /// <summary>
 /// Retreive a job collection.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// Name of the cloud service.
 /// </param>
 /// <param name='jobCollectionName'>
 /// Name of the job collection.
 /// </param>
 /// <returns>
 /// The Get Job Collection operation response.
 /// </returns>
 public static JobCollectionGetResponse Get(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName)
 {
     try
     {
         return(operations.GetAsync(cloudServiceName, jobCollectionName).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Create a job collection.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// Required. The name of the cloud service containing the job
 /// collection.
 /// </param>
 /// <param name='jobCollectionName'>
 /// Required. The name of the job collection to create.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Create Job Collection
 /// operation.
 /// </param>
 /// <returns>
 /// The Create Job Collection operation response.
 /// </returns>
 public static Task <JobCollectionCreateResponse> BeginCreatingAsync(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName, JobCollectionCreateParameters parameters)
 {
     return(operations.BeginCreatingAsync(cloudServiceName, jobCollectionName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Update a job collection.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// Required. The name of the cloud service containing the job
 /// collection.
 /// </param>
 /// <param name='jobCollectionName'>
 /// Required. The name of the job collection to update.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Update Job Collection
 /// 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 <SchedulerOperationStatusResponse> UpdateAsync(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName, JobCollectionUpdateParameters parameters)
 {
     return(operations.UpdateAsync(cloudServiceName, jobCollectionName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Retreive a job collection.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// Required. Name of the cloud service.
 /// </param>
 /// <param name='jobCollectionName'>
 /// Required. Name of the job collection.
 /// </param>
 /// <returns>
 /// The Get Job Collection operation response.
 /// </returns>
 public static Task <JobCollectionGetResponse> GetAsync(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName)
 {
     return(operations.GetAsync(cloudServiceName, jobCollectionName, CancellationToken.None));
 }
 /// <summary>
 /// Deletes a job collection.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// Required. The name of the cloud service.
 /// </param>
 /// <param name='jobCollectionName'>
 /// Required. The name of the job collection to delete.
 /// </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 <SchedulerOperationStatusResponse> DeleteAsync(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName)
 {
     return(operations.DeleteAsync(cloudServiceName, jobCollectionName, CancellationToken.None));
 }
 /// <summary>
 /// Determine if the JobCollection name is available to be used.
 /// JobCollection names must be unique within a cloud-service.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// Required. The name of the cloud service.
 /// </param>
 /// <param name='jobCollectionName'>
 /// Required. A name for the JobCollection. The name must be unique as
 /// scoped within the CloudService.  The name can be up to 100
 /// characters in length.
 /// </param>
 /// <returns>
 /// The Check Name Availability operation response.
 /// </returns>
 public static Task <JobCollectionCheckNameAvailabilityResponse> CheckNameAvailabilityAsync(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName)
 {
     return(operations.CheckNameAvailabilityAsync(cloudServiceName, jobCollectionName, CancellationToken.None));
 }
 /// <summary>
 /// Deletes a job collection.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// Required. The name of the cloud service.
 /// </param>
 /// <param name='jobCollectionName'>
 /// Required. The name of the job collection to delete.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <OperationResponse> BeginDeletingAsync(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName)
 {
     return(operations.BeginDeletingAsync(cloudServiceName, jobCollectionName, CancellationToken.None));
 }
Beispiel #13
0
 /// <summary>
 /// Initializes a new instance of the SchedulerManagementClient class.
 /// </summary>
 private SchedulerManagementClient()
     : base()
 {
     this._jobCollections    = new JobCollectionOperations(this);
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }