/// <summary>
 /// Gets the Batch service quotas for the specified subscription at the given
 /// location.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='locationName'>
 /// The region for which to retrieve Batch service quotas.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <BatchLocationQuota> GetQuotasAsync(this ILocationOperations operations, string locationName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetQuotasWithHttpMessagesAsync(locationName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <Merchant> > GetAsync(this ILocationOperations operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get the list of capabilities of the location.
 /// </summary>
 /// <remarks>
 /// Get the list of CPU/memory/GPU capabilities of a region.
 /// </remarks>
 /// <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 <Capabilities> > ListCapabilitiesNextAsync(this ILocationOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListCapabilitiesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get the list of cached images.
 /// </summary>
 /// <remarks>
 /// Get the list of cached images on specific OS type for a subscription in a
 /// region.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// The identifier for the physical azure location.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <CachedImages> > ListCachedImagesAsync(this ILocationOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListCachedImagesWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemple #5
0
 /// <summary>
 /// The List Locations operation lists all of the data center locations
 /// that are valid for your subscription.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/gg441293.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ILocationOperations.
 /// </param>
 /// <returns>
 /// The List Locations operation response.
 /// </returns>
 public static LocationsListResponse List(this ILocationOperations operations)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ILocationOperations)s).ListAsync();
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the ManagementClient class.
 /// </summary>
 private ManagementClient()
     : base()
 {
     this._affinityGroups         = new AffinityGroupOperations(this);
     this._locations              = new LocationOperations(this);
     this._managementCertificates = new ManagementCertificateOperations(this);
     this._roleSizes              = new RoleSizeOperations(this);
     this._subscriptions          = new SubscriptionOperations(this);
     this.HttpClient.Timeout      = TimeSpan.FromSeconds(300);
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IList <Merchant> Get(this ILocationOperations operations)
 {
     return(Task
            .Factory
            .StartNew(s => ((ILocationOperations)s).GetAsync(),
                      operations,
                      CancellationToken.None,
                      TaskCreationOptions.None,
                      TaskScheduler.Default).Unwrap()
            .GetAwaiter()
            .GetResult());
 }
 /// <summary>
 /// Initializes a new instance of the ManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 private ManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._affinityGroups                     = new AffinityGroupOperations(this);
     this._locations                          = new LocationOperations(this);
     this._managementCertificates             = new ManagementCertificateOperations(this);
     this._roleSizes                          = new RoleSizeOperations(this);
     this._subscriptions                      = new SubscriptionOperations(this);
     this._apiVersion                         = "2014-05-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout                  = TimeSpan.FromSeconds(300);
 }
Exemple #9
0
 /// <summary>
 /// Initializes a new instance of the ManagementClient class.
 /// </summary>
 public ManagementClient()
     : base()
 {
     this._affinityGroups                     = new AffinityGroupOperations(this);
     this._locations                          = new LocationOperations(this);
     this._managementCertificates             = new ManagementCertificateOperations(this);
     this._roleSizes                          = new RoleSizeOperations(this);
     this._subscriptions                      = new SubscriptionOperations(this);
     this._subscriptionServicePrincipals      = new SubscriptionServicePrincipalOperations(this);
     this._apiVersion                         = "2018-06-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout                  = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// The List Locations operation lists all of the data center locations
 /// that are valid for your subscription.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/gg441293.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ILocationOperations.
 /// </param>
 /// <returns>
 /// The List Locations operation response.
 /// </returns>
 public static LocationsListResponse List(this ILocationOperations operations)
 {
     try
     {
         return(operations.ListAsync().Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Get the list of cached images.
 /// </summary>
 /// <remarks>
 /// Get the list of cached images on specific OS type for a subscription in a
 /// region.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// The identifier for the physical azure location.
 /// </param>
 public static IPage <CachedImages> ListCachedImages(this ILocationOperations operations, string location)
 {
     return(operations.ListCachedImagesAsync(location).GetAwaiter().GetResult());
 }
Exemple #12
0
 /// <summary>
 /// The List Locations operation lists all of the data center locations
 /// that are valid for your subscription.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/gg441293.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ILocationOperations.
 /// </param>
 /// <returns>
 /// The List Locations operation response.
 /// </returns>
 public static Task <LocationsListResponse> ListAsync(this ILocationOperations operations)
 {
     return(operations.ListAsync(CancellationToken.None));
 }
Exemple #13
0
 /// <summary>
 /// Gets the list of Batch supported Cloud Service VM sizes available at the
 /// given location.
 /// </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 <SupportedSku> ListSupportedCloudServiceSkusNext(this ILocationOperations operations, string nextPageLink)
 {
     return(operations.ListSupportedCloudServiceSkusNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get the usage for a subscription
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// The identifier for the physical azure location.
 /// </param>
 public static IEnumerable <Usage> ListUsage(this ILocationOperations operations, string location)
 {
     return(operations.ListUsageAsync(location).GetAwaiter().GetResult());
 }
Exemple #15
0
 /// <summary>
 /// Gets the list of Batch supported Virtual Machine VM sizes available at the
 /// given location.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='locationName'>
 /// The region for which to retrieve Batch service supported SKUs.
 /// </param>
 /// <param name='maxresults'>
 /// The maximum number of items to return in the response.
 /// </param>
 /// <param name='filter'>
 /// OData filter expression. Valid properties for filtering are "familyName".
 /// </param>
 public static IPage <SupportedSku> ListSupportedVirtualMachineSkus(this ILocationOperations operations, string locationName, int?maxresults = default(int?), string filter = default(string))
 {
     return(operations.ListSupportedVirtualMachineSkusAsync(locationName, maxresults, filter).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get the list of capabilities of the location.
 /// </summary>
 /// <remarks>
 /// Get the list of CPU/memory/GPU capabilities of a region.
 /// </remarks>
 /// <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 <Capabilities> ListCapabilitiesNext(this ILocationOperations operations, string nextPageLink)
 {
     return(operations.ListCapabilitiesNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Checks whether the Batch account name is available in the specified region.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='locationName'>
 /// The desired region for the name check.
 /// </param>
 /// <param name='name'>
 /// The name to check for availability
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <CheckNameAvailabilityResult> CheckNameAvailabilityAsync(this ILocationOperations operations, string locationName, string name, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(locationName, name, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Checks whether the Batch account name is available in the specified region.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='locationName'>
 /// The desired region for the name check.
 /// </param>
 /// <param name='name'>
 /// The name to check for availability
 /// </param>
 public static CheckNameAvailabilityResult CheckNameAvailability(this ILocationOperations operations, string locationName, string name)
 {
     return(operations.CheckNameAvailabilityAsync(locationName, name).GetAwaiter().GetResult());
 }
Exemple #19
0
 /// <summary>
 /// Gets the list of Batch supported Virtual Machine VM sizes available at the
 /// given location.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='locationName'>
 /// The region for which to retrieve Batch service supported SKUs.
 /// </param>
 /// <param name='maxresults'>
 /// The maximum number of items to return in the response.
 /// </param>
 /// <param name='filter'>
 /// OData filter expression. Valid properties for filtering are "familyName".
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <SupportedSku> > ListSupportedVirtualMachineSkusAsync(this ILocationOperations operations, string locationName, int?maxresults = default(int?), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListSupportedVirtualMachineSkusWithHttpMessagesAsync(locationName, maxresults, filter, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets the Batch service quotas for the specified subscription at the given
 /// location.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='locationName'>
 /// The region for which to retrieve Batch service quotas.
 /// </param>
 public static BatchLocationQuota GetQuotas(this ILocationOperations operations, string locationName)
 {
     return(operations.GetQuotasAsync(locationName).GetAwaiter().GetResult());
 }
Exemple #21
0
 /// <summary>
 /// Gets the list of Batch supported Virtual Machine VM sizes available at the
 /// given location.
 /// </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 <SupportedSku> > ListSupportedVirtualMachineSkusNextAsync(this ILocationOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListSupportedVirtualMachineSkusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }