/// <summary> /// Lists compute usages for a subscription. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Compute.IUsageOperations. /// </param> /// <param name='location'> /// Required. The location upon which resource usage is queried. /// </param> /// <returns> /// The List Usages operation response. /// </returns> public static ListUsagesResponse List(this IUsageOperations operations, string location) { return(Task.Factory.StartNew((object s) => { return ((IUsageOperations)s).ListAsync(location); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Initializes a new instance of the StorageManagementClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public StorageManagementClient(HttpClient httpClient) : base(httpClient) { this._storageAccounts = new StorageAccountOperations(this); this._usage = new UsageOperations(this); this._apiVersion = "2015-06-15"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { this.HttpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); this.Certificates = new CertificatesOperations(this); this.ClassicMobileServices = new ClassicMobileServicesOperations(this); this.Domains = new DomainsOperations(this); this.GlobalModel = new GlobalModelOperations(this); this.GlobalDomainRegistration = new GlobalDomainRegistrationOperations(this); this.GlobalResourceGroups = new GlobalResourceGroupsOperations(this); this.HostingEnvironments = new HostingEnvironmentsOperations(this); this.ManagedHostingEnvironments = new ManagedHostingEnvironmentsOperations(this); this.Provider = new ProviderOperations(this); this.Recommendations = new RecommendationsOperations(this); this.ServerFarms = new ServerFarmsOperations(this); this.Sites = new SitesOperations(this); this.TopLevelDomains = new TopLevelDomainsOperations(this); this.Usage = new UsageOperations(this); this.BaseUri = new Uri("https://management.azure.com"); this.ApiVersion = "2015-08-01"; this.AcceptLanguage = "en-US"; this.LongRunningOperationRetryTimeout = 30; this.GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Formatting.Indented, DateFormatHandling = DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = DateTimeZoneHandling.Utc, NullValueHandling = NullValueHandling.Ignore, ReferenceLoopHandling = ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new ResourceJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = DateTimeZoneHandling.Utc, NullValueHandling = NullValueHandling.Ignore, ReferenceLoopHandling = ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings.Converters.Add(new ResourceJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// Initializes a new instance of the ComputeManagementClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public ComputeManagementClient(HttpClient httpClient) : base(httpClient) { this._availabilitySets = new AvailabilitySetOperations(this); this._usage = new UsageOperations(this); this._virtualMachineExtensionImages = new VirtualMachineExtensionImageOperations(this); this._virtualMachineExtensions = new VirtualMachineExtensionOperations(this); this._virtualMachineImages = new VirtualMachineImageOperations(this); this._virtualMachines = new VirtualMachineOperations(this); this._virtualMachineSizes = new VirtualMachineSizeOperations(this); this._apiVersion = "2015-06-15"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Initializes a new instance of the NetworkResourceProviderClient /// class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public NetworkResourceProviderClient(HttpClient httpClient) : base(httpClient) { this._loadBalancers = new LoadBalancerOperations(this); this._localNetworkGateways = new LocalNetworkGatewayOperations(this); this._networkInterfaces = new NetworkInterfaceOperations(this); this._networkSecurityGroups = new NetworkSecurityGroupOperations(this); this._publicIpAddresses = new PublicIpAddressOperations(this); this._securityRules = new SecurityRuleOperations(this); this._subnets = new SubnetOperations(this); this._usages = new UsageOperations(this); this._virtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionOperations(this); this._virtualNetworkGateways = new VirtualNetworkGatewayOperations(this); this._virtualNetworks = new VirtualNetworkOperations(this); this._apiVersion = "2015-05-01-preview"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { DataSources = new DataSources(this); Indexers = new Indexers(this); Indexes = new Indexes(this); StorageAccounts = new StorageAccounts(this); Usage = new UsageOperations(this); BaseUri = new System.Uri("https://management.azure.com"); 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() } }; SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <DataChangeDetectionPolicy>("@odata.type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <DataChangeDetectionPolicy>("@odata.type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <DataDeletionDetectionPolicy>("@odata.type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <DataDeletionDetectionPolicy>("@odata.type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <ScoringFunction>("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <ScoringFunction>("type")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Operations = new Operations(this); Skus = new SkusOperations(this); StorageAccounts = new StorageAccountsOperations(this); Usage = new UsageOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2017-10-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()); }
/// <summary> /// Initializes a new instance of the AutomationManagementClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public AutomationManagementClient(HttpClient httpClient) : base(httpClient) { this._activities = new ActivityOperations(this); this._agentRegistrationInformation = new AgentRegistrationOperation(this); this._automationAccounts = new AutomationAccountOperations(this); this._certificates = new CertificateOperations(this); this._connections = new ConnectionOperations(this); this._connectionTypes = new ConnectionTypeOperations(this); this._psCredentials = new CredentialOperations(this); this._compilationJobs = new DscCompilationJobOperations(this); this._configurations = new DscConfigurationOperations(this); this._nodeConfigurations = new DscNodeConfigurationOperations(this); this._nodes = new DscNodeOperations(this); this._nodeReports = new DscNodeReportsOperations(this); this._hybridRunbookWorkerGroups = new HybridRunbookWorkerGroupOperations(this); this._jobs = new JobOperations(this); this._jobSchedules = new JobScheduleOperations(this); this._jobStreams = new JobStreamOperations(this); this._linkedWorkspace = new LinkedWorkspaceOperations(this); this._modules = new ModuleOperations(this); this._objectDataTypes = new ObjectDataTypeOperations(this); this._runbookDraft = new RunbookDraftOperations(this); this._runbooks = new RunbookOperations(this); this._schedules = new ScheduleOperations(this); this._statistics = new StatisticsOperations(this); this._testJobs = new TestJobOperations(this); this._typeFields = new TypeFieldOperations(this); this._usages = new UsageOperations(this); this._variables = new VariableOperations(this); this._watcherActions = new WatcherActionOperations(this); this._watchers = new WatcherOperations(this); this._watcherStreams = new WatcherStreamOperations(this); this._webhooks = new WebhookOperations(this); this._resourceNamespace = "Microsoft.Automation"; this._apiVersion = "2014-06-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { this.StorageAccounts = new StorageAccountsOperations(this); this.Usage = new UsageOperations(this); this.BaseUri = new Uri("https://management.azure.com"); this.ApiVersion = "2016-01-01"; this.AcceptLanguage = "en-US"; this.LongRunningOperationRetryTimeout = 30; this.GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Formatting.Indented, DateFormatHandling = DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = DateTimeZoneHandling.Utc, NullValueHandling = NullValueHandling.Ignore, ReferenceLoopHandling = ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = DateTimeZoneHandling.Utc, NullValueHandling = NullValueHandling.Ignore, ReferenceLoopHandling = ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { this.StorageAccounts = new StorageAccountsOperations(this); this.Usage = new UsageOperations(this); this.BaseUri = new System.Uri("https://management.azure.com"); this.ApiVersion = "2015-06-15"; this.AcceptLanguage = "en-US"; this.LongRunningOperationRetryTimeout = 30; this.GenerateClientRequestId = true; SerializationSettings = new Newtonsoft.Json.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 Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter> { new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter> { new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); }
/// <summary> /// Gets, for the specified location, the current compute resource usage /// information as well as the limits for compute resources under the /// subscription. /// </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 <Usage> ListNext(this IUsageOperations operations, string nextPageLink) { return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Retrieve the usage for the account id. (see /// http://aka.ms/azureautomationsdk/usageoperations for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Automation.IUsageOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group /// </param> /// <param name='automationAccount'> /// Required. The automation account name. /// </param> /// <returns> /// The response model for the get usage operation. /// </returns> public static Task <UsageListResponse> ListAsync(this IUsageOperations operations, string resourceGroupName, string automationAccount) { return(operations.ListAsync(resourceGroupName, automationAccount, CancellationToken.None)); }
/// <summary> /// Gets the current usage count and the limit for the resources under /// the subscription. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Storage.IUsageOperations. /// </param> /// <returns> /// The List Usages operation response. /// </returns> public static Task <UsageListResponse> ListAsync(this IUsageOperations operations) { return(operations.ListAsync(CancellationToken.None)); }
/// <summary> /// Lists compute usages for a subscription. /// </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 <Usage> ListNext(this IUsageOperations operations, string nextPageLink) { return(Task.Factory.StartNew(s => ((IUsageOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Gets the current usage count and the limit for the resources under the /// subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static UsageListResult List(this IUsageOperations operations) { return(operations.ListAsync().GetAwaiter().GetResult()); }
/// <summary> /// Gets the current usage count and the limit for the resources under the /// subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IEnumerable <Usage> List(this IUsageOperations operations) { return(operations.ListAsync().GetAwaiter().GetResult()); }
/// <summary> /// Returns usage records for specified subscription and resource groups /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of resource group /// </param> /// <param name='environmentName'> /// Environment name /// </param> /// <param name='lastId'> /// Last marker that was returned from the batch /// </param> /// <param name='batchSize'> /// size of the batch to be returned. /// </param> public static object GetUsage(this IUsageOperations operations, string resourceGroupName, string environmentName, string lastId, int?batchSize) { return(Task.Factory.StartNew(s => ((IUsageOperations)s).GetUsageAsync(resourceGroupName, environmentName, lastId, batchSize), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Gets the current usage count and the limit for the resources under the /// subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static System.Collections.Generic.IEnumerable <Usage> List(this IUsageOperations operations) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsageOperations)s).ListAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Gets the current usage count and the limit for the resources under the /// subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static UsageListResult List(this IUsageOperations operations) { return(Task.Factory.StartNew(s => ((IUsageOperations)s).ListAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Lists compute usages for a subscription. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Compute.IUsageOperations. /// </param> /// <param name='location'> /// Required. The location upon which resource usage is queried. /// </param> /// <returns> /// The List Usages operation response. /// </returns> public static Task <ListUsagesResponse> ListAsync(this IUsageOperations operations, string location) { return(operations.ListAsync(location, CancellationToken.None)); }
/// <summary> /// Gets the current usage count and the limit for the resources under the /// subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <System.Collections.Generic.IEnumerable <Usage> > ListAsync(this IUsageOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Lists compute usages for a subscription. /// </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 <Usage> > ListNextAsync(this IUsageOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false); return(_result.Body); }
/// <summary> /// Gets, for the specified location, the current compute resource usage /// information as well as the limits for compute resources under the /// subscription. /// </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 <Usage> List(this IUsageOperations operations, string location) { return(operations.ListAsync(location).GetAwaiter().GetResult()); }
///GENMHASH:35D07311D3F5A0FC20A86A7B024BE1D1:FCBE9313644315745EDD2396965C2FE2 internal UsagesImpl(IUsageOperations client) { this.client = client; }