Example #1
0
 /// <summary>
 /// Gets the currently assigned Workspace Quotas based on VMFamily.
 /// </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 <ResourceQuota> > ListNextAsync(this IQuotasOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #2
0
 /// <summary>
 /// Update quota for each VM family in workspace.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// The location for update quota is queried.
 /// </param>
 /// <param name='parameters'>
 /// Quota update parameters.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <UpdateWorkspaceQuotasResult> UpdateAsync(this IQuotasOperations operations, string location, QuotaUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #3
0
 /// <summary>
 /// Creates or Updates a Compute Quota.
 /// </summary>
 /// <remarks>
 /// Creates or Updates a Compute Quota with the provided quota parameters.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='quotaName'>
 /// Name of the quota.
 /// </param>
 /// <param name='newQuota'>
 /// New quota to create.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Quota> CreateOrUpdateAsync(this IQuotasOperations operations, string location, string quotaName, Quota newQuota, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(location, quotaName, newQuota, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// List all quotas.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IEnumerable <Quota> > ListAsync(this IQuotasOperations operations, string location, ODataQuery <Quota> odataQuery = default(ODataQuery <Quota>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(location, odataQuery, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get a quota by name.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='resourceName'>
 /// Name of the resource.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Quota> GetAsync(this IQuotasOperations operations, string location, string resourceName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(location, resourceName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #6
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Operations              = new Operations(this);
     Subscriptions           = new SubscriptionsOperations(this);
     AcquiredPlans           = new AcquiredPlansOperations(this);
     DelegatedProviders      = new DelegatedProvidersOperations(this);
     DelegatedProviderOffers = new DelegatedProviderOffersOperations(this);
     DirectoryTenants        = new DirectoryTenantsOperations(this);
     Locations        = new LocationsOperations(this);
     Offers           = new OffersOperations(this);
     OfferDelegations = new OfferDelegationsOperations(this);
     Plans            = new PlansOperations(this);
     Quotas           = new QuotasOperations(this);
     BaseUri          = new System.Uri("https://adminmanagement.local.azurestack.external");
     ApiVersion       = "2015-11-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()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Example #7
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Jobs           = new JobsOperations(this);
     Providers      = new ProvidersOperations(this);
     Storage        = new StorageOperations(this);
     Quotas         = new QuotasOperations(this);
     BaseUri        = new System.Uri("https://quantum.azure.com");
     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()
         }
     };
     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()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Example #8
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Operations     = new Operations(this);
     Quotas         = new QuotasOperations(this);
     BaseUri        = new System.Uri("https://management.local.azurestack.external");
     ApiVersion     = "2017-02-01-preview";
     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()
         }
     };
     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()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Example #9
0
 /// <summary>
 /// Update quota for each VM family in workspace.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// The location for update quota is queried.
 /// </param>
 /// <param name='parameters'>
 /// Quota update parameters.
 /// </param>
 public static UpdateWorkspaceQuotasResult Update(this IQuotasOperations operations, string location, QuotaUpdateParameters parameters)
 {
     return(operations.UpdateAsync(location, parameters).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get a quota by name.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='resourceName'>
 /// Name of the resource.
 /// </param>
 public static Quota Get(this IQuotasOperations operations, string location, string resourceName)
 {
     return(operations.GetAsync(location, resourceName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// List all quotas.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 public static IEnumerable <Quota> List(this IQuotasOperations operations, string location, ODataQuery <Quota> odataQuery = default(ODataQuery <Quota>))
 {
     return(operations.ListAsync(location, odataQuery).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Delete a quota by name.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='resourceName'>
 /// Name of the resource.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginDeleteAsync(this IQuotasOperations operations, string location, string resourceName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginDeleteWithHttpMessagesAsync(location, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Delete a quota by name.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='resourceName'>
 /// Name of the resource.
 /// </param>
 public static void BeginDelete(this IQuotasOperations operations, string location, string resourceName)
 {
     operations.BeginDeleteAsync(location, resourceName).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Create or update a quota.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='resourceName'>
 /// Name of the resource.
 /// </param>
 /// <param name='quota'>
 /// New network quota to create.
 /// </param>
 public static Quota CreateOrUpdate(this IQuotasOperations operations, string location, string resourceName, Quota quota)
 {
     return(operations.CreateOrUpdateAsync(location, resourceName, quota).GetAwaiter().GetResult());
 }
Example #15
0
 /// <summary>
 /// Gets the currently assigned Workspace Quotas based on VMFamily.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// The location for which resource usage is queried.
 /// </param>
 public static IPage <ResourceQuota> List(this IQuotasOperations operations, string location)
 {
     return(operations.ListAsync(location).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets a quota by name.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// The AzureStack location.
 /// </param>
 /// <param name='quota'>
 /// Name of the quota.
 /// </param>
 public static Quota Get(this IQuotasOperations operations, string location, string quota)
 {
     return(operations.GetAsync(location, quota).GetAwaiter().GetResult());
 }
Example #17
0
 /// <summary>
 /// List quotas for the given workspace.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IPage <Quota> List(this IQuotasOperations operations)
 {
     return(operations.ListAsync().GetAwaiter().GetResult());
 }
Example #18
0
 /// <summary>
 /// Gets the currently assigned Workspace Quotas based on VMFamily.
 /// </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 <ResourceQuota> ListNext(this IQuotasOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
Example #19
0
 /// <summary>
 /// Lists all Compute quotas.
 /// </summary>
 /// <remarks>
 /// Get a list of existing Compute quotas.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 public static IEnumerable <Quota> List(this IQuotasOperations operations, string location)
 {
     return(operations.ListAsync(location).GetAwaiter().GetResult());
 }
Example #20
0
 /// <summary>
 /// Deletes specified Compute quota
 /// </summary>
 /// <remarks>
 /// Delete an existing Compute quota.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='quotaName'>
 /// Name of the quota.
 /// </param>
 public static void Delete(this IQuotasOperations operations, string location, string quotaName)
 {
     operations.DeleteAsync(location, quotaName).GetAwaiter().GetResult();
 }