From 0285b1b29c8f80af89addf719a30058840ee778d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 7 Jan 2021 23:23:55 +0000 Subject: [PATCH] CodeGen from PR 12324 in Azure/azure-rest-api-specs Merge 5c6fbf03bd5ba8842da9d0fb49e802fc28f6e06b into 718ed16a9fe05c50b01fa56c050623929de35930 --- ...=> CloudServiceRoleInstancesOperations.cs} | 927 +++-- ...erviceRoleInstancesOperationsExtensions.cs | 579 +++ .../Generated/CloudServiceRolesOperations.cs | 624 ++++ .../CloudServiceRolesOperationsExtensions.cs | 145 + .../src/Generated/CloudServicesOperations.cs | 3122 +++++++++++++++++ .../CloudServicesOperationsExtensions.cs | 1047 ++++++ .../CloudServicesUpdateDomainOperations.cs | 839 +++++ ...ervicesUpdateDomainOperationsExtensions.cs | 247 ++ .../src/Generated/ComputeManagementClient.cs | 24 +- .../ContainerServicesOperationsExtensions.cs | 479 --- .../ICloudServiceRoleInstancesOperations.cs | 362 ++ .../Generated/ICloudServiceRolesOperations.cs | 102 + .../src/Generated/ICloudServicesOperations.cs | 638 ++++ .../ICloudServicesUpdateDomainOperations.cs | 160 + .../src/Generated/IComputeManagementClient.cs | 19 +- .../Generated/IContainerServicesOperations.cs | 298 -- ...alMachineScaleSetVMExtensionsOperations.cs | 12 +- .../Generated/IVirtualMachinesOperations.cs | 12 +- .../src/Generated/Models/CloudService.cs | 106 + .../Models/CloudServiceExtensionProfile.cs | 56 + .../Models/CloudServiceExtensionProperties.cs | 179 + .../Models/CloudServiceInstanceView.cs | 67 + .../Models/CloudServiceNetworkProfile.cs | 61 + .../Generated/Models/CloudServiceOsProfile.cs | 55 + .../Models/CloudServiceProperties.cs | 157 + .../src/Generated/Models/CloudServiceRole.cs | 87 + .../Models/CloudServiceRoleProfile.cs | 53 + .../CloudServiceRoleProfileProperties.cs | 59 + .../Models/CloudServiceRoleProperties.cs | 50 + .../Generated/Models/CloudServiceRoleSku.cs | 78 + .../Generated/Models/CloudServiceUpdate.cs | 50 + .../Models/CloudServiceUpgradeMode.cs | 23 + .../CloudServiceVaultAndSecretReference.cs | 54 + .../Models/CloudServiceVaultCertificate.cs | 56 + .../Models/CloudServiceVaultSecretGroup.cs | 67 + .../src/Generated/Models/ContainerService.cs | 192 - .../ContainerServiceAgentPoolProfile.cs | 149 - .../ContainerServiceDiagnosticsProfile.cs | 69 - .../Models/ContainerServiceLinuxProfile.cs | 91 - .../Models/ContainerServiceMasterProfile.cs | 87 - .../ContainerServiceOrchestratorProfile.cs | 67 - .../ContainerServiceOrchestratorTypes.cs | 72 - ...ContainerServiceServicePrincipalProfile.cs | 82 - .../ContainerServiceSshConfiguration.cs | 81 - .../Models/ContainerServiceSshPublicKey.cs | 71 - .../Models/ContainerServiceVMDiagnostics.cs | 74 - .../Models/ContainerServiceVMSizeTypes.cs | 67 - .../Models/ContainerServiceWindowsProfile.cs | 95 - .../src/Generated/Models/Extension.cs | 57 + .../src/Generated/Models/HardwareProfile.cs | 65 +- .../src/Generated/Models/InstanceSku.cs | 57 + .../Models/InstanceViewStatusesSummary.cs | 53 + .../Models/LoadBalancerConfiguration.cs | 57 + .../LoadBalancerConfigurationProperties.cs | 52 + .../LoadBalancerFrontendIPConfiguration.cs | 54 + ...lancerFrontendIPConfigurationProperties.cs | 67 + .../Generated/Models/LogAnalyticsInputBase.cs | 20 +- .../Models/RequestRateByIntervalInput.cs | 8 +- .../Models/ResourceInstanceViewStatus.cs | 88 + .../src/Generated/Models/RoleInstance.cs | 94 + .../Models/RoleInstanceInstanceView.cs | 83 + .../Models/RoleInstanceNetworkProfile.cs | 56 + .../Models/RoleInstanceProperties.cs | 52 + ...rviceCustomProfile.cs => RoleInstances.cs} | 34 +- .../src/Generated/Models/StatusCodeCount.cs | 57 + .../Models/ThrottledRequestsInput.cs | 8 +- .../src/Generated/Models/UpdateDomain.cs | 59 + .../src/Generated/Models/VirtualMachine.cs | 39 +- ...tualMachineScaleSetNetworkConfiguration.cs | 12 +- ...chineScaleSetUpdateNetworkConfiguration.cs | 12 +- .../Models/VirtualMachineScaleSetVM.cs | 39 +- .../VirtualMachineScaleSetVMExtension.cs | 170 + ...VirtualMachineScaleSetVMExtensionUpdate.cs | 152 + ...alMachineScaleSetVMExtensionsListResult.cs | 55 + .../Models/VirtualMachineScaleSetVMProfile.cs | 39 +- .../Generated/Models/VirtualMachineUpdate.cs | 39 +- .../SdkInfo_ComputeManagementClient.cs | 16 +- ...alMachineScaleSetVMExtensionsOperations.cs | 38 +- ...caleSetVMExtensionsOperationsExtensions.cs | 24 +- .../Generated/VirtualMachinesOperations.cs | 17 +- .../VirtualMachinesOperationsExtensions.cs | 28 +- 81 files changed, 11354 insertions(+), 2438 deletions(-) rename sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/{ContainerServicesOperations.cs => CloudServiceRoleInstancesOperations.cs} (62%) create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperationsExtensions.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperations.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperationsExtensions.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperations.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperationsExtensions.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperations.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperationsExtensions.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperationsExtensions.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRoleInstancesOperations.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRolesOperations.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesOperations.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesUpdateDomainOperations.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IContainerServicesOperations.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudService.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProfile.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProperties.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceInstanceView.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceNetworkProfile.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceOsProfile.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceProperties.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRole.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfile.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfileProperties.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProperties.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleSku.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpdate.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpgradeMode.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultAndSecretReference.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultCertificate.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultSecretGroup.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerService.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceAgentPoolProfile.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceDiagnosticsProfile.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceLinuxProfile.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceMasterProfile.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorProfile.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorTypes.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceServicePrincipalProfile.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshConfiguration.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshPublicKey.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMDiagnostics.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMSizeTypes.cs delete mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceWindowsProfile.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/Extension.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceSku.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceViewStatusesSummary.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfiguration.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfigurationProperties.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfiguration.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfigurationProperties.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ResourceInstanceViewStatus.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstance.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceInstanceView.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceNetworkProfile.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceProperties.cs rename sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/{ContainerServiceCustomProfile.cs => RoleInstances.cs} (56%) create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/StatusCodeCount.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/UpdateDomain.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMExtension.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMExtensionUpdate.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMExtensionsListResult.cs diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperations.cs similarity index 62% rename from sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperations.cs rename to sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperations.cs index 2a997351885a..f5b2de88542b 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperations.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Management.Compute using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; + using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -23,12 +24,12 @@ namespace Microsoft.Azure.Management.Compute using System.Threading.Tasks; /// - /// ContainerServicesOperations operations. + /// CloudServiceRoleInstancesOperations operations. /// - internal partial class ContainerServicesOperations : IServiceOperations, IContainerServicesOperations + internal partial class CloudServiceRoleInstancesOperations : IServiceOperations, ICloudServiceRoleInstancesOperations { /// - /// Initializes a new instance of the ContainerServicesOperations class. + /// Initializes a new instance of the CloudServiceRoleInstancesOperations class. /// /// /// Reference to the service client. @@ -36,7 +37,7 @@ internal partial class ContainerServicesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ContainerServicesOperations(ComputeManagementClient client) + internal CloudServiceRoleInstancesOperations(ComputeManagementClient client) { if (client == null) { @@ -51,14 +52,42 @@ internal ContainerServicesOperations(ComputeManagementClient client) public ComputeManagementClient Client { get; private set; } /// - /// Gets a list of container services in the specified subscription. + /// Deletes a role instance from a cloud service. /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a role instance from a cloud service. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The expand expression to apply to the operation. Possible values include: + /// 'instanceView' + /// /// /// Headers that will be added to request. /// @@ -80,13 +109,25 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (roleInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-01-31"; + string apiVersion = "2020-10-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -94,19 +135,30 @@ internal ContainerServicesOperations(ComputeManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("roleInstanceName", roleInstanceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}").ToString(); + _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expand, Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -200,7 +252,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -213,7 +265,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -233,50 +285,15 @@ internal ContainerServicesOperations(ComputeManagementClient client) } /// - /// Creates or updates a container service. + /// Retrieves information about the run-time state of a role instance in a + /// cloud service. /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// + /// Name of the role instance. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, ContainerService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, containerServiceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the properties of the specified container service. - /// - /// - /// Gets the properties of the specified container service in the specified - /// subscription and resource group. The operation returns the properties - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// /// - /// The name of the resource group. /// - /// - /// The name of the container service in the specified subscription and - /// resource group. + /// /// /// /// Headers that will be added to request. @@ -299,21 +316,25 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetInstanceViewWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (roleInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (containerServiceName == null) + if (cloudServiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "containerServiceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-01-31"; + string apiVersion = "2020-10-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,17 +342,19 @@ internal ContainerServicesOperations(ComputeManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("roleInstanceName", roleInstanceName); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("containerServiceName", containerServiceName); + tracingParameters.Add("cloudServiceName", cloudServiceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceView", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/instanceView").ToString(); + _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{containerServiceName}", System.Uri.EscapeDataString(containerServiceName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -431,7 +454,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -444,7 +467,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -464,47 +487,17 @@ internal ContainerServicesOperations(ComputeManagementClient client) } /// - /// Deletes the specified container service. + /// Gets the list of all role instances in a cloud service. Use nextLink + /// property in the response to get the next page of role instances. Do this + /// till nextLink is null to fetch all the role instances. /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The headers that will be added to request. /// - /// - /// The cancellation token. + /// /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, containerServiceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The name of the resource group. + /// + /// The expand expression to apply to the operation. Possible values include: + /// 'instanceView' /// /// /// Headers that will be added to request. @@ -527,17 +520,21 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-01-31"; + string apiVersion = "2020-10-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,20 +543,27 @@ internal ContainerServicesOperations(ComputeManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(expand, Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -653,7 +657,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -666,7 +670,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -686,21 +690,88 @@ internal ContainerServicesOperations(ComputeManagementClient client) } /// - /// Creates or updates a container service. + /// The Reboot Role Instance asynchronous operation requests a reboot of a role + /// instance in the cloud service. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestartWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// The Reimage Role Instance asynchronous operation reinstalls the operating + /// system on instances of web roles or worker roles. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ReimageWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginReimageWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// The Rebuild Role Instance asynchronous operation reinstalls the operating + /// system on instances of web roles or worker roles and initializes the + /// storage resources that are used by them. If you do not want to initialize + /// storage resources, you can use Reimage Role Instance. /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// + /// + /// Name of the role instance. + /// /// - /// The name of the resource group. /// - /// - /// The name of the container service in the specified subscription and - /// resource group. + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RebuildWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRebuildWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a remote desktop file for a role instance in a cloud service. + /// + /// + /// Name of the role instance. + /// + /// /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. + /// /// /// /// Headers that will be added to request. @@ -723,29 +794,25 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, ContainerService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetRemoteDesktopFileWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (containerServiceName == null) + if (roleInstanceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "containerServiceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); } - if (parameters == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (parameters != null) + if (cloudServiceName == null) { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-01-31"; + string apiVersion = "2020-10-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -753,18 +820,19 @@ internal ContainerServicesOperations(ComputeManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("roleInstanceName", roleInstanceName); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("containerServiceName", containerServiceName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cloudServiceName", cloudServiceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetRemoteDesktopFile", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile").ToString(); + _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{containerServiceName}", System.Uri.EscapeDataString(containerServiceName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -778,7 +846,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -809,12 +877,6 @@ internal ContainerServicesOperations(ComputeManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -827,7 +889,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -835,7 +897,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -870,7 +932,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -880,56 +942,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) // Deserialize Response if ((int)_statusCode == 200) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } if (_shouldTrace) { @@ -939,22 +952,14 @@ internal ContainerServicesOperations(ComputeManagementClient client) } /// - /// Deletes the specified container service. + /// Deletes a role instance from a cloud service. /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// + /// + /// Name of the role instance. + /// /// - /// The name of the resource group. /// - /// - /// The name of the container service in the specified subscription and - /// resource group. + /// /// /// /// Headers that will be added to request. @@ -974,21 +979,25 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (roleInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (containerServiceName == null) + if (cloudServiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "containerServiceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-01-31"; + string apiVersion = "2020-10-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -996,17 +1005,19 @@ internal ContainerServicesOperations(ComputeManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("roleInstanceName", roleInstanceName); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("containerServiceName", containerServiceName); + tracingParameters.Add("cloudServiceName", cloudServiceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}").ToString(); + _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{containerServiceName}", System.Uri.EscapeDataString(containerServiceName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -1071,7 +1082,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1121,16 +1132,15 @@ internal ContainerServicesOperations(ComputeManagementClient client) } /// - /// Gets a list of container services in the specified subscription. + /// The Reboot Role Instance asynchronous operation requests a reboot of a role + /// instance in the cloud service. /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the role instance. + /// + /// + /// + /// /// /// /// Headers that will be added to request. @@ -1141,9 +1151,6 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1153,12 +1160,25 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRestartWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (roleInstanceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2020-10-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1166,14 +1186,25 @@ internal ContainerServicesOperations(ComputeManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("roleInstanceName", roleInstanceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/restart").ToString(); + _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1181,7 +1212,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1232,7 +1263,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1267,31 +1298,13 @@ internal ContainerServicesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1300,16 +1313,15 @@ internal ContainerServicesOperations(ComputeManagementClient client) } /// - /// Gets a list of container services in the specified resource group. + /// The Reimage Role Instance asynchronous operation reinstalls the operating + /// system on instances of web roles or worker roles. /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Name of the role instance. + /// + /// + /// + /// /// /// /// Headers that will be added to request. @@ -1320,9 +1332,6 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1332,11 +1341,375 @@ internal ContainerServicesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginReimageWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (roleInstanceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("roleInstanceName", roleInstanceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginReimage", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/reimage").ToString(); + _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// The Rebuild Role Instance asynchronous operation reinstalls the operating + /// system on instances of web roles or worker roles and initializes the + /// storage resources that are used by them. If you do not want to initialize + /// storage resources, you can use Reimage Role Instance. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginRebuildWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (roleInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "roleInstanceName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("roleInstanceName", roleInstanceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRebuild", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/rebuild").ToString(); + _url = _url.Replace("{roleInstanceName}", System.Uri.EscapeDataString(roleInstanceName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the list of all role instances in a cloud service. Use nextLink + /// property in the response to get the next page of role instances. Do this + /// till nextLink is null to fetch all the role instances. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1347,7 +1720,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1446,7 +1819,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1459,7 +1832,7 @@ internal ContainerServicesOperations(ComputeManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperationsExtensions.cs new file mode 100644 index 000000000000..b629a041cd9b --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRoleInstancesOperationsExtensions.cs @@ -0,0 +1,579 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.IO; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for CloudServiceRoleInstancesOperations. + /// + public static partial class CloudServiceRoleInstancesOperationsExtensions + { + /// + /// Deletes a role instance from a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + public static void Delete(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) + { + operations.DeleteAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a role instance from a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a role instance from a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The expand expression to apply to the operation. Possible values include: + /// 'instanceView' + /// + public static RoleInstance Get(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?)) + { + return operations.GetAsync(roleInstanceName, resourceGroupName, cloudServiceName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets a role instance from a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The expand expression to apply to the operation. Possible values include: + /// 'instanceView' + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves information about the run-time state of a role instance in a + /// cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + public static RoleInstanceInstanceView GetInstanceView(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) + { + return operations.GetInstanceViewAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves information about the run-time state of a role instance in a + /// cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetInstanceViewAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetInstanceViewWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the list of all role instances in a cloud service. Use nextLink + /// property in the response to get the next page of role instances. Do this + /// till nextLink is null to fetch all the role instances. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// + /// The expand expression to apply to the operation. Possible values include: + /// 'instanceView' + /// + public static IPage List(this ICloudServiceRoleInstancesOperations operations, string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?)) + { + return operations.ListAsync(resourceGroupName, cloudServiceName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of all role instances in a cloud service. Use nextLink + /// property in the response to get the next page of role instances. Do this + /// till nextLink is null to fetch all the role instances. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// + /// The expand expression to apply to the operation. Possible values include: + /// 'instanceView' + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ICloudServiceRoleInstancesOperations operations, string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, cloudServiceName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The Reboot Role Instance asynchronous operation requests a reboot of a role + /// instance in the cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + public static void Restart(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) + { + operations.RestartAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// The Reboot Role Instance asynchronous operation requests a reboot of a role + /// instance in the cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task RestartAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RestartWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// The Reimage Role Instance asynchronous operation reinstalls the operating + /// system on instances of web roles or worker roles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + public static void Reimage(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) + { + operations.ReimageAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// The Reimage Role Instance asynchronous operation reinstalls the operating + /// system on instances of web roles or worker roles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ReimageAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ReimageWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// The Rebuild Role Instance asynchronous operation reinstalls the operating + /// system on instances of web roles or worker roles and initializes the + /// storage resources that are used by them. If you do not want to initialize + /// storage resources, you can use Reimage Role Instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + public static void Rebuild(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) + { + operations.RebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// The Rebuild Role Instance asynchronous operation reinstalls the operating + /// system on instances of web roles or worker roles and initializes the + /// storage resources that are used by them. If you do not want to initialize + /// storage resources, you can use Reimage Role Instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task RebuildAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RebuildWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a remote desktop file for a role instance in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + public static Stream GetRemoteDesktopFile(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) + { + return operations.GetRemoteDesktopFileAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a remote desktop file for a role instance in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetRemoteDesktopFileAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + var _result = await operations.GetRemoteDesktopFileWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false); + _result.Request.Dispose(); + return _result.Body; + } + + /// + /// Deletes a role instance from a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + public static void BeginDelete(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) + { + operations.BeginDeleteAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a role instance from a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// The Reboot Role Instance asynchronous operation requests a reboot of a role + /// instance in the cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + public static void BeginRestart(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) + { + operations.BeginRestartAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// The Reboot Role Instance asynchronous operation requests a reboot of a role + /// instance in the cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginRestartAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRestartWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// The Reimage Role Instance asynchronous operation reinstalls the operating + /// system on instances of web roles or worker roles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + public static void BeginReimage(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) + { + operations.BeginReimageAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// The Reimage Role Instance asynchronous operation reinstalls the operating + /// system on instances of web roles or worker roles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginReimageAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginReimageWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// The Rebuild Role Instance asynchronous operation reinstalls the operating + /// system on instances of web roles or worker roles and initializes the + /// storage resources that are used by them. If you do not want to initialize + /// storage resources, you can use Reimage Role Instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + public static void BeginRebuild(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName) + { + operations.BeginRebuildAsync(roleInstanceName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// The Rebuild Role Instance asynchronous operation reinstalls the operating + /// system on instances of web roles or worker roles and initializes the + /// storage resources that are used by them. If you do not want to initialize + /// storage resources, you can use Reimage Role Instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task BeginRebuildAsync(this ICloudServiceRoleInstancesOperations operations, string roleInstanceName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRebuildWithHttpMessagesAsync(roleInstanceName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the list of all role instances in a cloud service. Use nextLink + /// property in the response to get the next page of role instances. Do this + /// till nextLink is null to fetch all the role instances. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ICloudServiceRoleInstancesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of all role instances in a cloud service. Use nextLink + /// property in the response to get the next page of role instances. Do this + /// till nextLink is null to fetch all the role instances. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ICloudServiceRoleInstancesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperations.cs new file mode 100644 index 000000000000..4f89d31c6875 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperations.cs @@ -0,0 +1,624 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CloudServiceRolesOperations operations. + /// + internal partial class CloudServiceRolesOperations : IServiceOperations, ICloudServiceRolesOperations + { + /// + /// Initializes a new instance of the CloudServiceRolesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal CloudServiceRolesOperations(ComputeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ComputeManagementClient + /// + public ComputeManagementClient Client { get; private set; } + + /// + /// Gets a role from a cloud service. + /// + /// + /// Name of the role. + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string roleName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (roleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "roleName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("roleName", roleName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}").ToString(); + _url = _url.Replace("{roleName}", System.Uri.EscapeDataString(roleName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of all roles in a cloud service. Use nextLink property in the + /// response to get the next page of roles. Do this till nextLink is null to + /// fetch all the roles. + /// + /// + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of all roles in a cloud service. Use nextLink property in the + /// response to get the next page of roles. Do this till nextLink is null to + /// fetch all the roles. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperationsExtensions.cs new file mode 100644 index 000000000000..5e85be38ce4a --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServiceRolesOperationsExtensions.cs @@ -0,0 +1,145 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for CloudServiceRolesOperations. + /// + public static partial class CloudServiceRolesOperationsExtensions + { + /// + /// Gets a role from a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role. + /// + /// + /// + /// + /// + public static CloudServiceRole Get(this ICloudServiceRolesOperations operations, string roleName, string resourceGroupName, string cloudServiceName) + { + return operations.GetAsync(roleName, resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a role from a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the role. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ICloudServiceRolesOperations operations, string roleName, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(roleName, resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of all roles in a cloud service. Use nextLink property in the + /// response to get the next page of roles. Do this till nextLink is null to + /// fetch all the roles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + public static IPage List(this ICloudServiceRolesOperations operations, string resourceGroupName, string cloudServiceName) + { + return operations.ListAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all roles in a cloud service. Use nextLink property in the + /// response to get the next page of roles. Do this till nextLink is null to + /// fetch all the roles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ICloudServiceRolesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of all roles in a cloud service. Use nextLink property in the + /// response to get the next page of roles. Do this till nextLink is null to + /// fetch all the roles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ICloudServiceRolesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all roles in a cloud service. Use nextLink property in the + /// response to get the next page of roles. Do this till nextLink is null to + /// fetch all the roles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ICloudServiceRolesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperations.cs new file mode 100644 index 000000000000..cfad17514e22 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperations.cs @@ -0,0 +1,3122 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CloudServicesOperations operations. + /// + internal partial class CloudServicesOperations : IServiceOperations, ICloudServicesOperations + { + /// + /// Initializes a new instance of the CloudServicesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal CloudServicesOperations(ComputeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ComputeManagementClient + /// + public ComputeManagementClient Client { get; private set; } + + /// + /// Create or update a cloud service. Please note some properties can be set + /// only during cloud service creation. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cloud service object. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, cloudServiceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Resource tags + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, cloudServiceName, tags, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Display information about a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the status of a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetInstanceViewWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetInstanceView", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/instanceView").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of all cloud services in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of Cloud Services. Do this till nextLink is null to fetch all the + /// Cloud Services. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of all cloud services under a resource group. Use nextLink + /// property in the response to get the next page of Cloud Services. Do this + /// till nextLink is null to fetch all the Cloud Services. + /// + /// + /// Name of the resource group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Starts the cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Power off the cloud service. Note that resources are still attached and you + /// are getting charged for the resources. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginPowerOffWithHttpMessagesAsync(resourceGroupName, cloudServiceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restarts one or more role instances in a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Reimage asynchronous operation reinstalls the operating system on instances + /// of web roles or worker roles. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ReimageWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginReimageWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Rebuild Role Instances reinstalls the operating system on instances of web + /// roles or worker roles and initializes the storage resources that are used + /// by them. If you do not want to initialize storage resources, you can use + /// Reimage Role Instances. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RebuildWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRebuildWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes role instances in a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteInstancesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a cloud service. Please note some properties can be set + /// only during cloud service creation. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cloud service object. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Resource tags + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + CloudServiceUpdate parameters = default(CloudServiceUpdate); + if (tags != null) + { + parameters = new CloudServiceUpdate(); + parameters.Tags = tags; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Starts the cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/start").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Power off the cloud service. Note that resources are still attached and you + /// are getting charged for the resources. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginPowerOff", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/poweroff").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Restarts one or more role instances in a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (roleInstancesProperty == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "roleInstancesProperty"); + } + string apiVersion = "2020-10-01-preview"; + RoleInstances parameters = default(RoleInstances); + if (roleInstancesProperty != null) + { + parameters = new RoleInstances(); + parameters.RoleInstancesProperty = roleInstancesProperty; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/restart").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Reimage asynchronous operation reinstalls the operating system on instances + /// of web roles or worker roles. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (roleInstancesProperty == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "roleInstancesProperty"); + } + string apiVersion = "2020-10-01-preview"; + RoleInstances parameters = default(RoleInstances); + if (roleInstancesProperty != null) + { + parameters = new RoleInstances(); + parameters.RoleInstancesProperty = roleInstancesProperty; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginReimage", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/reimage").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Rebuild Role Instances reinstalls the operating system on instances of web + /// roles or worker roles and initializes the storage resources that are used + /// by them. If you do not want to initialize storage resources, you can use + /// Reimage Role Instances. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginRebuildWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (roleInstancesProperty == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "roleInstancesProperty"); + } + string apiVersion = "2020-10-01-preview"; + RoleInstances parameters = default(RoleInstances); + if (roleInstancesProperty != null) + { + parameters = new RoleInstances(); + parameters.RoleInstancesProperty = roleInstancesProperty; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRebuild", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/rebuild").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes role instances in a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (roleInstancesProperty == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "roleInstancesProperty"); + } + string apiVersion = "2020-10-01-preview"; + RoleInstances parameters = default(RoleInstances); + if (roleInstancesProperty != null) + { + parameters = new RoleInstances(); + parameters.RoleInstancesProperty = roleInstancesProperty; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteInstances", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/delete").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of all cloud services in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of Cloud Services. Do this till nextLink is null to fetch all the + /// Cloud Services. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of all cloud services under a resource group. Use nextLink + /// property in the response to get the next page of Cloud Services. Do this + /// till nextLink is null to fetch all the Cloud Services. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperationsExtensions.cs new file mode 100644 index 000000000000..84568a13d4c1 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesOperationsExtensions.cs @@ -0,0 +1,1047 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for CloudServicesOperations. + /// + public static partial class CloudServicesOperationsExtensions + { + /// + /// Create or update a cloud service. Please note some properties can be set + /// only during cloud service creation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cloud service object. + /// + public static CloudService CreateOrUpdate(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService)) + { + return operations.CreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a cloud service. Please note some properties can be set + /// only during cloud service creation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cloud service object. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, cloudServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Resource tags + /// + public static CloudService Update(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary)) + { + return operations.UpdateAsync(resourceGroupName, cloudServiceName, tags).GetAwaiter().GetResult(); + } + + /// + /// Update a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Resource tags + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, cloudServiceName, tags, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + public static void Delete(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) + { + operations.DeleteAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Display information about a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + public static CloudService Get(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) + { + return operations.GetAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Display information about a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the status of a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + public static CloudServiceInstanceView GetInstanceView(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) + { + return operations.GetInstanceViewAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the status of a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task GetInstanceViewAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetInstanceViewWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of all cloud services in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of Cloud Services. Do this till nextLink is null to fetch all the + /// Cloud Services. + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListAll(this ICloudServicesOperations operations) + { + return operations.ListAllAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all cloud services in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of Cloud Services. Do this till nextLink is null to fetch all the + /// Cloud Services. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAllAsync(this ICloudServicesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of all cloud services under a resource group. Use nextLink + /// property in the response to get the next page of Cloud Services. Do this + /// till nextLink is null to fetch all the Cloud Services. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + public static IPage List(this ICloudServicesOperations operations, string resourceGroupName) + { + return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all cloud services under a resource group. Use nextLink + /// property in the response to get the next page of Cloud Services. Do this + /// till nextLink is null to fetch all the Cloud Services. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ICloudServicesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Starts the cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + public static void Start(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) + { + operations.StartAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Starts the cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task StartAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.StartWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Power off the cloud service. Note that resources are still attached and you + /// are getting charged for the resources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + public static void PowerOff(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) + { + operations.PowerOffAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Power off the cloud service. Note that resources are still attached and you + /// are getting charged for the resources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task PowerOffAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.PowerOffWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Restarts one or more role instances in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + public static void Restart(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) + { + operations.RestartAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); + } + + /// + /// Restarts one or more role instances in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task RestartAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RestartWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Reimage asynchronous operation reinstalls the operating system on instances + /// of web roles or worker roles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + public static void Reimage(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) + { + operations.ReimageAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); + } + + /// + /// Reimage asynchronous operation reinstalls the operating system on instances + /// of web roles or worker roles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task ReimageAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ReimageWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Rebuild Role Instances reinstalls the operating system on instances of web + /// roles or worker roles and initializes the storage resources that are used + /// by them. If you do not want to initialize storage resources, you can use + /// Reimage Role Instances. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + public static void Rebuild(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) + { + operations.RebuildAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); + } + + /// + /// Rebuild Role Instances reinstalls the operating system on instances of web + /// roles or worker roles and initializes the storage resources that are used + /// by them. If you do not want to initialize storage resources, you can use + /// Reimage Role Instances. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task RebuildAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RebuildWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deletes role instances in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + public static void DeleteInstances(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) + { + operations.DeleteInstancesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); + } + + /// + /// Deletes role instances in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteInstancesAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteInstancesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Create or update a cloud service. Please note some properties can be set + /// only during cloud service creation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cloud service object. + /// + public static CloudService BeginCreateOrUpdate(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService)) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, cloudServiceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a cloud service. Please note some properties can be set + /// only during cloud service creation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cloud service object. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, cloudServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Resource tags + /// + public static CloudService BeginUpdate(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary)) + { + return operations.BeginUpdateAsync(resourceGroupName, cloudServiceName, tags).GetAwaiter().GetResult(); + } + + /// + /// Update a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Resource tags + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, cloudServiceName, tags, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + public static void BeginDelete(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) + { + operations.BeginDeleteAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Starts the cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + public static void BeginStart(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) + { + operations.BeginStartAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Starts the cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task BeginStartAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Power off the cloud service. Note that resources are still attached and you + /// are getting charged for the resources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + public static void BeginPowerOff(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName) + { + operations.BeginPowerOffAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Power off the cloud service. Note that resources are still attached and you + /// are getting charged for the resources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task BeginPowerOffAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Restarts one or more role instances in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + public static void BeginRestart(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) + { + operations.BeginRestartAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); + } + + /// + /// Restarts one or more role instances in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRestartAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Reimage asynchronous operation reinstalls the operating system on instances + /// of web roles or worker roles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + public static void BeginReimage(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) + { + operations.BeginReimageAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); + } + + /// + /// Reimage asynchronous operation reinstalls the operating system on instances + /// of web roles or worker roles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task BeginReimageAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginReimageWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Rebuild Role Instances reinstalls the operating system on instances of web + /// roles or worker roles and initializes the storage resources that are used + /// by them. If you do not want to initialize storage resources, you can use + /// Reimage Role Instances. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + public static void BeginRebuild(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) + { + operations.BeginRebuildAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); + } + + /// + /// Rebuild Role Instances reinstalls the operating system on instances of web + /// roles or worker roles and initializes the storage resources that are used + /// by them. If you do not want to initialize storage resources, you can use + /// Reimage Role Instances. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRebuildAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRebuildWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deletes role instances in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + public static void BeginDeleteInstances(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty) + { + operations.BeginDeleteInstancesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty).GetAwaiter().GetResult(); + } + + /// + /// Deletes role instances in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will signify all + /// role instances of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteInstancesAsync(this ICloudServicesOperations operations, string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteInstancesWithHttpMessagesAsync(resourceGroupName, cloudServiceName, roleInstancesProperty, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a list of all cloud services in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of Cloud Services. Do this till nextLink is null to fetch all the + /// Cloud Services. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListAllNext(this ICloudServicesOperations operations, string nextPageLink) + { + return operations.ListAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all cloud services in the subscription, regardless of the + /// associated resource group. Use nextLink property in the response to get the + /// next page of Cloud Services. Do this till nextLink is null to fetch all the + /// Cloud Services. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAllNextAsync(this ICloudServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of all cloud services under a resource group. Use nextLink + /// property in the response to get the next page of Cloud Services. Do this + /// till nextLink is null to fetch all the Cloud Services. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ICloudServicesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all cloud services under a resource group. Use nextLink + /// property in the response to get the next page of Cloud Services. Do this + /// till nextLink is null to fetch all the Cloud Services. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ICloudServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperations.cs new file mode 100644 index 000000000000..be13c0980ab6 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperations.cs @@ -0,0 +1,839 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CloudServicesUpdateDomainOperations operations. + /// + internal partial class CloudServicesUpdateDomainOperations : IServiceOperations, ICloudServicesUpdateDomainOperations + { + /// + /// Initializes a new instance of the CloudServicesUpdateDomainOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal CloudServicesUpdateDomainOperations(ComputeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ComputeManagementClient + /// + public ComputeManagementClient Client { get; private set; } + + /// + /// Updates the role instances in the specified update domain. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Specifies an integer value that identifies the update domain. Update + /// domains are identified with a zero-based index: the first update domain has + /// an ID of 0, the second has an ID of 1, and so on. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task WalkUpdateDomainWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, int updateDomain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginWalkUpdateDomainWithHttpMessagesAsync(resourceGroupName, cloudServiceName, updateDomain, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified update domain of a cloud service. Use nextLink property + /// in the response to get the next page of update domains. Do this till + /// nextLink is null to fetch all the update domains. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Specifies an integer value that identifies the update domain. Update + /// domains are identified with a zero-based index: the first update domain has + /// an ID of 0, the second has an ID of 1, and so on. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetUpdateDomainWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, int updateDomain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("updateDomain", updateDomain); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetUpdateDomain", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{updateDomain}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(updateDomain, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of all update domains in a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListUpdateDomainsWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListUpdateDomains", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates the role instances in the specified update domain. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Specifies an integer value that identifies the update domain. Update + /// domains are identified with a zero-based index: the first update domain has + /// an ID of 0, the second has an ID of 1, and so on. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginWalkUpdateDomainWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, int updateDomain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (cloudServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-10-01-preview"; + UpdateDomain parameters = default(UpdateDomain); + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cloudServiceName", cloudServiceName); + tracingParameters.Add("updateDomain", updateDomain); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginWalkUpdateDomain", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{cloudServiceName}", System.Uri.EscapeDataString(cloudServiceName)); + _url = _url.Replace("{updateDomain}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(updateDomain, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of all update domains in a cloud service. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListUpdateDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListUpdateDomainsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperationsExtensions.cs new file mode 100644 index 000000000000..9e3226415fe1 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/CloudServicesUpdateDomainOperationsExtensions.cs @@ -0,0 +1,247 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for CloudServicesUpdateDomainOperations. + /// + public static partial class CloudServicesUpdateDomainOperationsExtensions + { + /// + /// Updates the role instances in the specified update domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Specifies an integer value that identifies the update domain. Update + /// domains are identified with a zero-based index: the first update domain has + /// an ID of 0, the second has an ID of 1, and so on. + /// + public static void WalkUpdateDomain(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, int updateDomain) + { + operations.WalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain).GetAwaiter().GetResult(); + } + + /// + /// Updates the role instances in the specified update domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Specifies an integer value that identifies the update domain. Update + /// domains are identified with a zero-based index: the first update domain has + /// an ID of 0, the second has an ID of 1, and so on. + /// + /// + /// The cancellation token. + /// + public static async Task WalkUpdateDomainAsync(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, int updateDomain, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.WalkUpdateDomainWithHttpMessagesAsync(resourceGroupName, cloudServiceName, updateDomain, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the specified update domain of a cloud service. Use nextLink property + /// in the response to get the next page of update domains. Do this till + /// nextLink is null to fetch all the update domains. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Specifies an integer value that identifies the update domain. Update + /// domains are identified with a zero-based index: the first update domain has + /// an ID of 0, the second has an ID of 1, and so on. + /// + public static UpdateDomain GetUpdateDomain(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, int updateDomain) + { + return operations.GetUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified update domain of a cloud service. Use nextLink property + /// in the response to get the next page of update domains. Do this till + /// nextLink is null to fetch all the update domains. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Specifies an integer value that identifies the update domain. Update + /// domains are identified with a zero-based index: the first update domain has + /// an ID of 0, the second has an ID of 1, and so on. + /// + /// + /// The cancellation token. + /// + public static async Task GetUpdateDomainAsync(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, int updateDomain, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUpdateDomainWithHttpMessagesAsync(resourceGroupName, cloudServiceName, updateDomain, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of all update domains in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + public static IPage ListUpdateDomains(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName) + { + return operations.ListUpdateDomainsAsync(resourceGroupName, cloudServiceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all update domains in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cancellation token. + /// + public static async Task> ListUpdateDomainsAsync(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListUpdateDomainsWithHttpMessagesAsync(resourceGroupName, cloudServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates the role instances in the specified update domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Specifies an integer value that identifies the update domain. Update + /// domains are identified with a zero-based index: the first update domain has + /// an ID of 0, the second has an ID of 1, and so on. + /// + public static void BeginWalkUpdateDomain(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, int updateDomain) + { + operations.BeginWalkUpdateDomainAsync(resourceGroupName, cloudServiceName, updateDomain).GetAwaiter().GetResult(); + } + + /// + /// Updates the role instances in the specified update domain. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Specifies an integer value that identifies the update domain. Update + /// domains are identified with a zero-based index: the first update domain has + /// an ID of 0, the second has an ID of 1, and so on. + /// + /// + /// The cancellation token. + /// + public static async Task BeginWalkUpdateDomainAsync(this ICloudServicesUpdateDomainOperations operations, string resourceGroupName, string cloudServiceName, int updateDomain, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginWalkUpdateDomainWithHttpMessagesAsync(resourceGroupName, cloudServiceName, updateDomain, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a list of all update domains in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListUpdateDomainsNext(this ICloudServicesUpdateDomainOperations operations, string nextPageLink) + { + return operations.ListUpdateDomainsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all update domains in a cloud service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListUpdateDomainsNextAsync(this ICloudServicesUpdateDomainOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListUpdateDomainsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ComputeManagementClient.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ComputeManagementClient.cs index 7bab34599755..059fa71a7747 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ComputeManagementClient.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ComputeManagementClient.cs @@ -227,9 +227,24 @@ public partial class ComputeManagementClient : ServiceClient - /// Gets the IContainerServicesOperations. + /// Gets the ICloudServiceRoleInstancesOperations. /// - public virtual IContainerServicesOperations ContainerServices { get; private set; } + public virtual ICloudServiceRoleInstancesOperations CloudServiceRoleInstances { get; private set; } + + /// + /// Gets the ICloudServiceRolesOperations. + /// + public virtual ICloudServiceRolesOperations CloudServiceRoles { get; private set; } + + /// + /// Gets the ICloudServicesOperations. + /// + public virtual ICloudServicesOperations CloudServices { get; private set; } + + /// + /// Gets the ICloudServicesUpdateDomainOperations. + /// + public virtual ICloudServicesUpdateDomainOperations CloudServicesUpdateDomain { get; private set; } /// /// Initializes a new instance of the ComputeManagementClient class. @@ -503,7 +518,10 @@ private void Initialize() GalleryImageVersions = new GalleryImageVersionsOperations(this); GalleryApplications = new GalleryApplicationsOperations(this); GalleryApplicationVersions = new GalleryApplicationVersionsOperations(this); - ContainerServices = new ContainerServicesOperations(this); + CloudServiceRoleInstances = new CloudServiceRoleInstancesOperations(this); + CloudServiceRoles = new CloudServiceRolesOperations(this); + CloudServices = new CloudServicesOperations(this); + CloudServicesUpdateDomain = new CloudServicesUpdateDomainOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperationsExtensions.cs deleted file mode 100644 index e245c862dd38..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ContainerServicesOperationsExtensions.cs +++ /dev/null @@ -1,479 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ContainerServicesOperations. - /// - public static partial class ContainerServicesOperationsExtensions - { - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IContainerServicesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IContainerServicesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - public static ContainerService CreateOrUpdate(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, ContainerService parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, ContainerService parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, containerServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the properties of the specified container service. - /// - /// - /// Gets the properties of the specified container service in the specified - /// subscription and resource group. The operation returns the properties - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - public static ContainerService Get(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName) - { - return operations.GetAsync(resourceGroupName, containerServiceName).GetAwaiter().GetResult(); - } - - /// - /// Gets the properties of the specified container service. - /// - /// - /// Gets the properties of the specified container service in the specified - /// subscription and resource group. The operation returns the properties - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, containerServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - public static void Delete(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName) - { - operations.DeleteAsync(resourceGroupName, containerServiceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, containerServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - public static IPage ListByResourceGroup(this IContainerServicesOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IContainerServicesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - public static ContainerService BeginCreateOrUpdate(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, ContainerService parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified configuration of - /// orchestrator, masters, and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service operation. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, ContainerService parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, containerServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - public static void BeginDelete(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName) - { - operations.BeginDeleteAsync(resourceGroupName, containerServiceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified subscription and - /// resource group. The operation does not delete other resources created as - /// part of creating a container service, including storage accounts, VMs, and - /// availability sets. All the other resources created with the container - /// service are part of the same resource group and can be deleted - /// individually. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IContainerServicesOperations operations, string resourceGroupName, string containerServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, containerServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IContainerServicesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. The - /// operation returns properties of each container service including state, - /// orchestrator, number of masters and agents, and FQDNs of masters and - /// agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IContainerServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IContainerServicesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and FQDNs of - /// masters and agents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IContainerServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRoleInstancesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRoleInstancesOperations.cs new file mode 100644 index 000000000000..5d97a04e5b07 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRoleInstancesOperations.cs @@ -0,0 +1,362 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.IO; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CloudServiceRoleInstancesOperations operations. + /// + public partial interface ICloudServiceRoleInstancesOperations + { + /// + /// Deletes a role instance from a cloud service. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a role instance from a cloud service. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The expand expression to apply to the operation. Possible values + /// include: 'instanceView' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves information about the run-time state of a role instance + /// in a cloud service. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetInstanceViewWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of all role instances in a cloud service. Use + /// nextLink property in the response to get the next page of role + /// instances. Do this till nextLink is null to fetch all the role + /// instances. + /// + /// + /// + /// + /// + /// + /// The expand expression to apply to the operation. Possible values + /// include: 'instanceView' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The Reboot Role Instance asynchronous operation requests a reboot + /// of a role instance in the cloud service. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RestartWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The Reimage Role Instance asynchronous operation reinstalls the + /// operating system on instances of web roles or worker roles. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ReimageWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The Rebuild Role Instance asynchronous operation reinstalls the + /// operating system on instances of web roles or worker roles and + /// initializes the storage resources that are used by them. If you do + /// not want to initialize storage resources, you can use Reimage Role + /// Instance. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RebuildWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a remote desktop file for a role instance in a cloud service. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetRemoteDesktopFileWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a role instance from a cloud service. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The Reboot Role Instance asynchronous operation requests a reboot + /// of a role instance in the cloud service. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginRestartWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The Reimage Role Instance asynchronous operation reinstalls the + /// operating system on instances of web roles or worker roles. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginReimageWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The Rebuild Role Instance asynchronous operation reinstalls the + /// operating system on instances of web roles or worker roles and + /// initializes the storage resources that are used by them. If you do + /// not want to initialize storage resources, you can use Reimage Role + /// Instance. + /// + /// + /// Name of the role instance. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginRebuildWithHttpMessagesAsync(string roleInstanceName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of all role instances in a cloud service. Use + /// nextLink property in the response to get the next page of role + /// instances. Do this till nextLink is null to fetch all the role + /// instances. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRolesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRolesOperations.cs new file mode 100644 index 000000000000..16e8d96e5c5f --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServiceRolesOperations.cs @@ -0,0 +1,102 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CloudServiceRolesOperations operations. + /// + public partial interface ICloudServiceRolesOperations + { + /// + /// Gets a role from a cloud service. + /// + /// + /// Name of the role. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string roleName, string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all roles in a cloud service. Use nextLink property + /// in the response to get the next page of roles. Do this till + /// nextLink is null to fetch all the roles. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all roles in a cloud service. Use nextLink property + /// in the response to get the next page of roles. Do this till + /// nextLink is null to fetch all the roles. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesOperations.cs new file mode 100644 index 000000000000..837bdd793337 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesOperations.cs @@ -0,0 +1,638 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CloudServicesOperations operations. + /// + public partial interface ICloudServicesOperations + { + /// + /// Create or update a cloud service. Please note some properties can + /// be set only during cloud service creation. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cloud service object. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Resource tags + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Display information about a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the status of a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetInstanceViewWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all cloud services in the subscription, regardless + /// of the associated resource group. Use nextLink property in the + /// response to get the next page of Cloud Services. Do this till + /// nextLink is null to fetch all the Cloud Services. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all cloud services under a resource group. Use + /// nextLink property in the response to get the next page of Cloud + /// Services. Do this till nextLink is null to fetch all the Cloud + /// Services. + /// + /// + /// Name of the resource group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Starts the cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task StartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Power off the cloud service. Note that resources are still attached + /// and you are getting charged for the resources. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task PowerOffWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Restarts one or more role instances in a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will + /// signify all role instances of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RestartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Reimage asynchronous operation reinstalls the operating system on + /// instances of web roles or worker roles. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will + /// signify all role instances of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ReimageWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Rebuild Role Instances reinstalls the operating system on instances + /// of web roles or worker roles and initializes the storage resources + /// that are used by them. If you do not want to initialize storage + /// resources, you can use Reimage Role Instances. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will + /// signify all role instances of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RebuildWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes role instances in a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will + /// signify all role instances of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a cloud service. Please note some properties can + /// be set only during cloud service creation. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The cloud service object. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, CloudService parameters = default(CloudService), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Resource tags + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Starts the cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Power off the cloud service. Note that resources are still attached + /// and you are getting charged for the resources. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Restarts one or more role instances in a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will + /// signify all role instances of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Reimage asynchronous operation reinstalls the operating system on + /// instances of web roles or worker roles. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will + /// signify all role instances of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginReimageWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Rebuild Role Instances reinstalls the operating system on instances + /// of web roles or worker roles and initializes the storage resources + /// that are used by them. If you do not want to initialize storage + /// resources, you can use Reimage Role Instances. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will + /// signify all role instances of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginRebuildWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes role instances in a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// List of cloud service role instance names. Value of '*' will + /// signify all role instances of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteInstancesWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, IList roleInstancesProperty, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all cloud services in the subscription, regardless + /// of the associated resource group. Use nextLink property in the + /// response to get the next page of Cloud Services. Do this till + /// nextLink is null to fetch all the Cloud Services. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all cloud services under a resource group. Use + /// nextLink property in the response to get the next page of Cloud + /// Services. Do this till nextLink is null to fetch all the Cloud + /// Services. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesUpdateDomainOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesUpdateDomainOperations.cs new file mode 100644 index 000000000000..cdac93b47a19 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/ICloudServicesUpdateDomainOperations.cs @@ -0,0 +1,160 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// CloudServicesUpdateDomainOperations operations. + /// + public partial interface ICloudServicesUpdateDomainOperations + { + /// + /// Updates the role instances in the specified update domain. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Specifies an integer value that identifies the update domain. + /// Update domains are identified with a zero-based index: the first + /// update domain has an ID of 0, the second has an ID of 1, and so on. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task WalkUpdateDomainWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, int updateDomain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the specified update domain of a cloud service. Use nextLink + /// property in the response to get the next page of update domains. Do + /// this till nextLink is null to fetch all the update domains. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Specifies an integer value that identifies the update domain. + /// Update domains are identified with a zero-based index: the first + /// update domain has an ID of 0, the second has an ID of 1, and so on. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetUpdateDomainWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, int updateDomain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all update domains in a cloud service. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListUpdateDomainsWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates the role instances in the specified update domain. + /// + /// + /// Name of the resource group. + /// + /// + /// Name of the cloud service. + /// + /// + /// Specifies an integer value that identifies the update domain. + /// Update domains are identified with a zero-based index: the first + /// update domain has an ID of 0, the second has an ID of 1, and so on. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginWalkUpdateDomainWithHttpMessagesAsync(string resourceGroupName, string cloudServiceName, int updateDomain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all update domains in a cloud service. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListUpdateDomainsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IComputeManagementClient.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IComputeManagementClient.cs index b96ecca11522..ae2b860100c7 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IComputeManagementClient.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IComputeManagementClient.cs @@ -222,9 +222,24 @@ public partial interface IComputeManagementClient : System.IDisposable IGalleryApplicationVersionsOperations GalleryApplicationVersions { get; } /// - /// Gets the IContainerServicesOperations. + /// Gets the ICloudServiceRoleInstancesOperations. /// - IContainerServicesOperations ContainerServices { get; } + ICloudServiceRoleInstancesOperations CloudServiceRoleInstances { get; } + + /// + /// Gets the ICloudServiceRolesOperations. + /// + ICloudServiceRolesOperations CloudServiceRoles { get; } + + /// + /// Gets the ICloudServicesOperations. + /// + ICloudServicesOperations CloudServices { get; } + + /// + /// Gets the ICloudServicesUpdateDomainOperations. + /// + ICloudServicesUpdateDomainOperations CloudServicesUpdateDomain { get; } } } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IContainerServicesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IContainerServicesOperations.cs deleted file mode 100644 index d8293bc2d92d..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IContainerServicesOperations.cs +++ /dev/null @@ -1,298 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// ContainerServicesOperations operations. - /// - public partial interface IContainerServicesOperations - { - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. - /// The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and - /// FQDNs of masters and agents. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified - /// configuration of orchestrator, masters, and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service - /// operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, ContainerService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the properties of the specified container service. - /// - /// - /// Gets the properties of the specified container service in the - /// specified subscription and resource group. The operation returns - /// the properties including state, orchestrator, number of masters and - /// agents, and FQDNs of masters and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified - /// subscription and resource group. The operation does not delete - /// other resources created as part of creating a container service, - /// including storage accounts, VMs, and availability sets. All the - /// other resources created with the container service are part of the - /// same resource group and can be deleted individually. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container - /// service including state, orchestrator, number of masters and - /// agents, and FQDNs of masters and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a container service. - /// - /// - /// Creates or updates a container service with the specified - /// configuration of orchestrator, masters, and agents. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// Parameters supplied to the Create or Update a Container Service - /// operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, ContainerService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the specified container service. - /// - /// - /// Deletes the specified container service in the specified - /// subscription and resource group. The operation does not delete - /// other resources created as part of creating a container service, - /// including storage accounts, VMs, and availability sets. All the - /// other resources created with the container service are part of the - /// same resource group and can be deleted individually. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the container service in the specified subscription and - /// resource group. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string containerServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of container services in the specified subscription. - /// - /// - /// Gets a list of container services in the specified subscription. - /// The operation returns properties of each container service - /// including state, orchestrator, number of masters and agents, and - /// FQDNs of masters and agents. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of container services in the specified resource group. - /// - /// - /// Gets a list of container services in the specified subscription and - /// resource group. The operation returns properties of each container - /// service including state, orchestrator, number of masters and - /// agents, and FQDNs of masters and agents. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineScaleSetVMExtensionsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineScaleSetVMExtensionsOperations.cs index 6aaf30ab5438..1ccfa9151680 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineScaleSetVMExtensionsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachineScaleSetVMExtensionsOperations.cs @@ -57,7 +57,7 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to update the VMSS VM extension. /// @@ -92,7 +92,7 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to delete the VMSS VM extension. /// @@ -154,7 +154,7 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to get all extensions of an instance in Virtual /// Machine Scaleset. @@ -186,7 +186,7 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when a required parameter is null /// - Task> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to create or update the VMSS VM extension. /// @@ -221,7 +221,7 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to update the VMSS VM extension. /// @@ -256,7 +256,7 @@ public partial interface IVirtualMachineScaleSetVMExtensionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to delete the VMSS VM extension. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachinesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachinesOperations.cs index cd0a8bbcdd18..bf1285315cf8 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachinesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/IVirtualMachinesOperations.cs @@ -142,6 +142,10 @@ public partial interface IVirtualMachinesOperations /// /// The name of the virtual machine. /// + /// + /// Optional parameter to force delete virtual machines.(Feature in + /// Preview) + /// /// /// The headers that will be added to request. /// @@ -154,7 +158,7 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieves information about the model view or the instance view of /// a virtual machine. @@ -733,6 +737,10 @@ public partial interface IVirtualMachinesOperations /// /// The name of the virtual machine. /// + /// + /// Optional parameter to force delete virtual machines.(Feature in + /// Preview) + /// /// /// The headers that will be added to request. /// @@ -745,7 +753,7 @@ public partial interface IVirtualMachinesOperations /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Converts virtual machine disks from blob-based to managed disks. /// Virtual machine must be stop-deallocated before invoking this diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudService.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudService.cs new file mode 100644 index 000000000000..2332c9c2f9f2 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudService.cs @@ -0,0 +1,106 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes the cloud service. + /// + public partial class CloudService : IResource + { + /// + /// Initializes a new instance of the CloudService class. + /// + public CloudService() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudService class. + /// + /// Resource location. + /// Resource Id. + /// Resource name. + /// Resource type. + /// Resource tags. + public CloudService(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), CloudServiceProperties properties = default(CloudServiceProperties)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets resource location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties")] + public CloudServiceProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProfile.cs new file mode 100644 index 000000000000..4458559f7cbc --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProfile.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes a cloud service extension profile. + /// + public partial class CloudServiceExtensionProfile + { + /// + /// Initializes a new instance of the CloudServiceExtensionProfile + /// class. + /// + public CloudServiceExtensionProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceExtensionProfile + /// class. + /// + /// List of extensions for the cloud + /// service. + public CloudServiceExtensionProfile(IList extensions = default(IList)) + { + Extensions = extensions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of extensions for the cloud service. + /// + [JsonProperty(PropertyName = "extensions")] + public IList Extensions { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProperties.cs new file mode 100644 index 000000000000..5fbf4d36b05d --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceExtensionProperties.cs @@ -0,0 +1,179 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Extension Properties. + /// + public partial class CloudServiceExtensionProperties + { + /// + /// Initializes a new instance of the CloudServiceExtensionProperties + /// class. + /// + public CloudServiceExtensionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceExtensionProperties + /// class. + /// + /// The name of the extension handler + /// publisher. + /// Specifies the type of the extension. + /// Specifies the version of the + /// extension. Specifies the version of the extension. If this element + /// is not specified or an asterisk (*) is used as the value, the + /// latest version of the extension is used. If the value is specified + /// with a major version number and an asterisk as the minor version + /// number (X.), the latest minor version of the specified major + /// version is selected. If a major version number and a minor version + /// number are specified (X.Y), the specific extension version is + /// selected. If a version is specified, an auto-upgrade is performed + /// on the role instance. + /// Explicitly specify whether + /// platform can automatically upgrade typeHandlerVersion to higher + /// minor versions when they become available. + /// Public settings for the extension. For JSON + /// extensions, this is the JSON settings for the extension. For XML + /// Extension (like RDP), this is the XML setting for the + /// extension. + /// Protected settings for the + /// extension which are encrypted before sent to the role + /// instance. + /// Tag to force apply the provided public + /// and protected settings. + /// Changing the tag value allows for re-running the extension without + /// changing any of the public or protected settings. + /// If forceUpdateTag is not changed, updates to public or protected + /// settings would still be applied by the handler. + /// If neither forceUpdateTag nor any of public or protected settings + /// change, extension would flow to the role instance with the same + /// sequence-number, and + /// it is up to handler implementation whether to re-run it or + /// not + /// The provisioning state, which only + /// appears in the response. + /// Optional list of roles to apply this + /// extension. If property is not specified or '*' is specified, + /// extension is applied to all roles in the cloud service. + public CloudServiceExtensionProperties(string publisher = default(string), string type = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), string settings = default(string), string protectedSettings = default(string), CloudServiceVaultAndSecretReference protectedSettingsFromKeyVault = default(CloudServiceVaultAndSecretReference), string forceUpdateTag = default(string), string provisioningState = default(string), IList rolesAppliedTo = default(IList)) + { + Publisher = publisher; + Type = type; + TypeHandlerVersion = typeHandlerVersion; + AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + Settings = settings; + ProtectedSettings = protectedSettings; + ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + ForceUpdateTag = forceUpdateTag; + ProvisioningState = provisioningState; + RolesAppliedTo = rolesAppliedTo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the extension handler publisher. + /// + [JsonProperty(PropertyName = "publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets specifies the type of the extension. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets specifies the version of the extension. Specifies the + /// version of the extension. If this element is not specified or an + /// asterisk (*) is used as the value, the latest version of the + /// extension is used. If the value is specified with a major version + /// number and an asterisk as the minor version number (X.), the latest + /// minor version of the specified major version is selected. If a + /// major version number and a minor version number are specified + /// (X.Y), the specific extension version is selected. If a version is + /// specified, an auto-upgrade is performed on the role instance. + /// + [JsonProperty(PropertyName = "typeHandlerVersion")] + public string TypeHandlerVersion { get; set; } + + /// + /// Gets or sets explicitly specify whether platform can automatically + /// upgrade typeHandlerVersion to higher minor versions when they + /// become available. + /// + [JsonProperty(PropertyName = "autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion { get; set; } + + /// + /// Gets or sets public settings for the extension. For JSON + /// extensions, this is the JSON settings for the extension. For XML + /// Extension (like RDP), this is the XML setting for the extension. + /// + [JsonProperty(PropertyName = "settings")] + public string Settings { get; set; } + + /// + /// Gets or sets protected settings for the extension which are + /// encrypted before sent to the role instance. + /// + [JsonProperty(PropertyName = "protectedSettings")] + public string ProtectedSettings { get; set; } + + /// + /// + [JsonProperty(PropertyName = "protectedSettingsFromKeyVault")] + public CloudServiceVaultAndSecretReference ProtectedSettingsFromKeyVault { get; set; } + + /// + /// Gets or sets tag to force apply the provided public and protected + /// settings. + /// Changing the tag value allows for re-running the extension without + /// changing any of the public or protected settings. + /// If forceUpdateTag is not changed, updates to public or protected + /// settings would still be applied by the handler. + /// If neither forceUpdateTag nor any of public or protected settings + /// change, extension would flow to the role instance with the same + /// sequence-number, and + /// it is up to handler implementation whether to re-run it or not + /// + [JsonProperty(PropertyName = "forceUpdateTag")] + public string ForceUpdateTag { get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets optional list of roles to apply this extension. If + /// property is not specified or '*' is specified, extension is applied + /// to all roles in the cloud service. + /// + [JsonProperty(PropertyName = "rolesAppliedTo")] + public IList RolesAppliedTo { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceInstanceView.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceInstanceView.cs new file mode 100644 index 000000000000..030b6de7ce0b --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceInstanceView.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// InstanceView of CloudService as a whole + /// + public partial class CloudServiceInstanceView + { + /// + /// Initializes a new instance of the CloudServiceInstanceView class. + /// + public CloudServiceInstanceView() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceInstanceView class. + /// + /// The version of the SDK that was used to + /// generate the package for the cloud service. + public CloudServiceInstanceView(InstanceViewStatusesSummary roleInstance = default(InstanceViewStatusesSummary), string sdkVersion = default(string), IList statuses = default(IList)) + { + RoleInstance = roleInstance; + SdkVersion = sdkVersion; + Statuses = statuses; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "roleInstance")] + public InstanceViewStatusesSummary RoleInstance { get; set; } + + /// + /// Gets the version of the SDK that was used to generate the package + /// for the cloud service. + /// + [JsonProperty(PropertyName = "sdkVersion")] + public string SdkVersion { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "statuses")] + public IList Statuses { get; private set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceNetworkProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceNetworkProfile.cs new file mode 100644 index 000000000000..e3de856fe0bf --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceNetworkProfile.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network Profile for the cloud service. + /// + public partial class CloudServiceNetworkProfile + { + /// + /// Initializes a new instance of the CloudServiceNetworkProfile class. + /// + public CloudServiceNetworkProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceNetworkProfile class. + /// + /// The list of load balancer + /// configurations for the cloud service. + public CloudServiceNetworkProfile(IList loadBalancerConfigurations = default(IList), SubResource swappableCloudService = default(SubResource)) + { + LoadBalancerConfigurations = loadBalancerConfigurations; + SwappableCloudService = swappableCloudService; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of load balancer configurations for the cloud + /// service. + /// + [JsonProperty(PropertyName = "loadBalancerConfigurations")] + public IList LoadBalancerConfigurations { get; set; } + + /// + /// + [JsonProperty(PropertyName = "swappableCloudService")] + public SubResource SwappableCloudService { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceOsProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceOsProfile.cs new file mode 100644 index 000000000000..012e60e27a47 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceOsProfile.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes the OS profile for the cloud service. + /// + public partial class CloudServiceOsProfile + { + /// + /// Initializes a new instance of the CloudServiceOsProfile class. + /// + public CloudServiceOsProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceOsProfile class. + /// + /// Specifies set of certificates that should be + /// installed onto the role instances. + public CloudServiceOsProfile(IList secrets = default(IList)) + { + Secrets = secrets; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies set of certificates that should be installed + /// onto the role instances. + /// + [JsonProperty(PropertyName = "secrets")] + public IList Secrets { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceProperties.cs new file mode 100644 index 000000000000..b44b5b9753a0 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceProperties.cs @@ -0,0 +1,157 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Cloud service properties + /// + public partial class CloudServiceProperties + { + /// + /// Initializes a new instance of the CloudServiceProperties class. + /// + public CloudServiceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceProperties class. + /// + /// Specifies a URL that refers to the + /// location of the service package in the Blob service. The service + /// package URL can be Shared Access Signature (SAS) URI from any + /// storage account. + /// This is a write-only property and is not returned in GET + /// calls. + /// Specifies the XML service configuration + /// (.cscfg) for the cloud service. + /// Specifies a URL that refers to the + /// location of the service configuration in the Blob service. The + /// service package URL can be Shared Access Signature (SAS) URI from + /// any storage account. + /// This is a write-only property and is not returned in GET + /// calls. + /// (Optional) Indicates whether to + /// start the cloud service immediately after it is created. The + /// default value is `true`. + /// If false, the service model is still deployed, but the code is not + /// run immediately. Instead, the service is PoweredOff until you call + /// Start, at which time the service will be started. A deployed + /// service still incurs charges, even if it is poweredoff. + /// Possible values include: 'Auto', + /// 'Manual', 'Simultaneous' + /// The provisioning state, which only + /// appears in the response. + /// The unique identifier for the cloud + /// service. + public CloudServiceProperties(string packageUrl = default(string), string configuration = default(string), string configurationUrl = default(string), bool? startCloudService = default(bool?), string upgradeMode = default(string), CloudServiceRoleProfile roleProfile = default(CloudServiceRoleProfile), CloudServiceOsProfile osProfile = default(CloudServiceOsProfile), CloudServiceNetworkProfile networkProfile = default(CloudServiceNetworkProfile), CloudServiceExtensionProfile extensionProfile = default(CloudServiceExtensionProfile), string provisioningState = default(string), string uniqueId = default(string)) + { + PackageUrl = packageUrl; + Configuration = configuration; + ConfigurationUrl = configurationUrl; + StartCloudService = startCloudService; + UpgradeMode = upgradeMode; + RoleProfile = roleProfile; + OsProfile = osProfile; + NetworkProfile = networkProfile; + ExtensionProfile = extensionProfile; + ProvisioningState = provisioningState; + UniqueId = uniqueId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies a URL that refers to the location of the + /// service package in the Blob service. The service package URL can be + /// Shared Access Signature (SAS) URI from any storage account. + /// This is a write-only property and is not returned in GET calls. + /// + [JsonProperty(PropertyName = "packageUrl")] + public string PackageUrl { get; set; } + + /// + /// Gets or sets specifies the XML service configuration (.cscfg) for + /// the cloud service. + /// + [JsonProperty(PropertyName = "configuration")] + public string Configuration { get; set; } + + /// + /// Gets or sets specifies a URL that refers to the location of the + /// service configuration in the Blob service. The service package URL + /// can be Shared Access Signature (SAS) URI from any storage account. + /// This is a write-only property and is not returned in GET calls. + /// + [JsonProperty(PropertyName = "configurationUrl")] + public string ConfigurationUrl { get; set; } + + /// + /// Gets or sets (Optional) Indicates whether to start the cloud + /// service immediately after it is created. The default value is + /// `true`. + /// If false, the service model is still deployed, but the code is not + /// run immediately. Instead, the service is PoweredOff until you call + /// Start, at which time the service will be started. A deployed + /// service still incurs charges, even if it is poweredoff. + /// + [JsonProperty(PropertyName = "startCloudService")] + public bool? StartCloudService { get; set; } + + /// + /// Gets or sets possible values include: 'Auto', 'Manual', + /// 'Simultaneous' + /// + [JsonProperty(PropertyName = "upgradeMode")] + public string UpgradeMode { get; set; } + + /// + /// + [JsonProperty(PropertyName = "roleProfile")] + public CloudServiceRoleProfile RoleProfile { get; set; } + + /// + /// + [JsonProperty(PropertyName = "osProfile")] + public CloudServiceOsProfile OsProfile { get; set; } + + /// + /// + [JsonProperty(PropertyName = "networkProfile")] + public CloudServiceNetworkProfile NetworkProfile { get; set; } + + /// + /// + [JsonProperty(PropertyName = "extensionProfile")] + public CloudServiceExtensionProfile ExtensionProfile { get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the unique identifier for the cloud service. + /// + [JsonProperty(PropertyName = "uniqueId")] + public string UniqueId { get; private set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRole.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRole.cs new file mode 100644 index 000000000000..ed30d6cb8090 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRole.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a role of the cloud service. + /// + public partial class CloudServiceRole + { + /// + /// Initializes a new instance of the CloudServiceRole class. + /// + public CloudServiceRole() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceRole class. + /// + /// Resource id + /// Resource name + /// Resource type + /// Resource location + public CloudServiceRole(string id = default(string), string name = default(string), string type = default(string), string location = default(string), CloudServiceRoleSku sku = default(CloudServiceRoleSku), CloudServiceRoleProperties properties = default(CloudServiceRoleProperties)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Sku = sku; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets resource location + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public CloudServiceRoleSku Sku { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties")] + public CloudServiceRoleProperties Properties { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfile.cs new file mode 100644 index 000000000000..6ec87974a474 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfile.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes the role profile for the cloud service. + /// + public partial class CloudServiceRoleProfile + { + /// + /// Initializes a new instance of the CloudServiceRoleProfile class. + /// + public CloudServiceRoleProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceRoleProfile class. + /// + /// List of roles for the cloud service. + public CloudServiceRoleProfile(IList roles = default(IList)) + { + Roles = roles; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of roles for the cloud service. + /// + [JsonProperty(PropertyName = "roles")] + public IList Roles { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfileProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfileProperties.cs new file mode 100644 index 000000000000..47db1e0408aa --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProfileProperties.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the role properties. + /// + public partial class CloudServiceRoleProfileProperties + { + /// + /// Initializes a new instance of the CloudServiceRoleProfileProperties + /// class. + /// + public CloudServiceRoleProfileProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceRoleProfileProperties + /// class. + /// + /// Resource name. + public CloudServiceRoleProfileProperties(string name = default(string), CloudServiceRoleSku sku = default(CloudServiceRoleSku)) + { + Name = name; + Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public CloudServiceRoleSku Sku { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProperties.cs new file mode 100644 index 000000000000..48d0c85661ff --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleProperties.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class CloudServiceRoleProperties + { + /// + /// Initializes a new instance of the CloudServiceRoleProperties class. + /// + public CloudServiceRoleProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceRoleProperties class. + /// + /// Specifies the ID which uniquely identifies a + /// cloud service role. + public CloudServiceRoleProperties(string uniqueId = default(string)) + { + UniqueId = uniqueId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the ID which uniquely identifies a cloud service + /// role. + /// + [JsonProperty(PropertyName = "uniqueId")] + public string UniqueId { get; private set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleSku.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleSku.cs new file mode 100644 index 000000000000..b0bbae8e08a5 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceRoleSku.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the cloud service role sku. + /// + public partial class CloudServiceRoleSku + { + /// + /// Initializes a new instance of the CloudServiceRoleSku class. + /// + public CloudServiceRoleSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceRoleSku class. + /// + /// The sku name. NOTE: If the new SKU is not + /// supported on the hardware the cloud service is currently on, you + /// need to delete and recreate the cloud service or move back to the + /// old sku. + /// Specifies the tier of the cloud service. + /// Possible Values are <br /><br /> **Standard** <br + /// /><br /> **Basic** + /// Specifies the number of role instances in + /// the cloud service. + public CloudServiceRoleSku(string name = default(string), string tier = default(string), long? capacity = default(long?)) + { + Name = name; + Tier = tier; + Capacity = capacity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the sku name. NOTE: If the new SKU is not supported on + /// the hardware the cloud service is currently on, you need to delete + /// and recreate the cloud service or move back to the old sku. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets specifies the tier of the cloud service. Possible + /// Values are &lt;br /&gt;&lt;br /&gt; **Standard** + /// &lt;br /&gt;&lt;br /&gt; **Basic** + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; set; } + + /// + /// Gets or sets specifies the number of role instances in the cloud + /// service. + /// + [JsonProperty(PropertyName = "capacity")] + public long? Capacity { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpdate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpdate.cs new file mode 100644 index 000000000000..6d1c6f76be04 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpdate.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class CloudServiceUpdate + { + /// + /// Initializes a new instance of the CloudServiceUpdate class. + /// + public CloudServiceUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceUpdate class. + /// + /// Resource tags + public CloudServiceUpdate(IDictionary tags = default(IDictionary)) + { + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpgradeMode.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpgradeMode.cs new file mode 100644 index 000000000000..6d25f3f7cd7d --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceUpgradeMode.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + + /// + /// Defines values for CloudServiceUpgradeMode. + /// + public static class CloudServiceUpgradeMode + { + public const string Auto = "Auto"; + public const string Manual = "Manual"; + public const string Simultaneous = "Simultaneous"; + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultAndSecretReference.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultAndSecretReference.cs new file mode 100644 index 000000000000..13461382f05c --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultAndSecretReference.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class CloudServiceVaultAndSecretReference + { + /// + /// Initializes a new instance of the + /// CloudServiceVaultAndSecretReference class. + /// + public CloudServiceVaultAndSecretReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CloudServiceVaultAndSecretReference class. + /// + public CloudServiceVaultAndSecretReference(SubResource sourceVault = default(SubResource), string secretUrl = default(string)) + { + SourceVault = sourceVault; + SecretUrl = secretUrl; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "sourceVault")] + public SubResource SourceVault { get; set; } + + /// + /// + [JsonProperty(PropertyName = "secretUrl")] + public string SecretUrl { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultCertificate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultCertificate.cs new file mode 100644 index 000000000000..d5643600aa3c --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultCertificate.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a single certificate reference in a Key Vault, and where the + /// certificate should reside on the role instance. + /// + public partial class CloudServiceVaultCertificate + { + /// + /// Initializes a new instance of the CloudServiceVaultCertificate + /// class. + /// + public CloudServiceVaultCertificate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceVaultCertificate + /// class. + /// + /// This is the URL of a certificate that + /// has been uploaded to Key Vault as a secret. + public CloudServiceVaultCertificate(string certificateUrl = default(string)) + { + CertificateUrl = certificateUrl; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets this is the URL of a certificate that has been + /// uploaded to Key Vault as a secret. + /// + [JsonProperty(PropertyName = "certificateUrl")] + public string CertificateUrl { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultSecretGroup.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultSecretGroup.cs new file mode 100644 index 000000000000..38b9d2224c25 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CloudServiceVaultSecretGroup.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes a set of certificates which are all in the same Key Vault. + /// + public partial class CloudServiceVaultSecretGroup + { + /// + /// Initializes a new instance of the CloudServiceVaultSecretGroup + /// class. + /// + public CloudServiceVaultSecretGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudServiceVaultSecretGroup + /// class. + /// + /// The relative URL of the Key Vault + /// containing all of the certificates in VaultCertificates. + /// The list of key vault references in + /// SourceVault which contain certificates. + public CloudServiceVaultSecretGroup(SubResource sourceVault = default(SubResource), IList vaultCertificates = default(IList)) + { + SourceVault = sourceVault; + VaultCertificates = vaultCertificates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the relative URL of the Key Vault containing all of + /// the certificates in VaultCertificates. + /// + [JsonProperty(PropertyName = "sourceVault")] + public SubResource SourceVault { get; set; } + + /// + /// Gets or sets the list of key vault references in SourceVault which + /// contain certificates. + /// + [JsonProperty(PropertyName = "vaultCertificates")] + public IList VaultCertificates { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerService.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerService.cs deleted file mode 100644 index e762dad4d1f7..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerService.cs +++ /dev/null @@ -1,192 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Container service. - /// - [Rest.Serialization.JsonTransformation] - public partial class ContainerService : Resource - { - /// - /// Initializes a new instance of the ContainerService class. - /// - public ContainerService() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerService class. - /// - /// Resource location - /// Properties of master agents. - /// Properties of the agent - /// pool. - /// Properties of Linux VMs. - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - /// the current deployment or - /// provisioning state, which only appears in the response. - /// Properties of the - /// orchestrator. - /// Properties for custom clusters. - /// Properties for cluster - /// service principals. - /// Properties of Windows VMs. - /// Properties of the diagnostic - /// agent. - public ContainerService(string location, ContainerServiceMasterProfile masterProfile, IList agentPoolProfiles, ContainerServiceLinuxProfile linuxProfile, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), ContainerServiceOrchestratorProfile orchestratorProfile = default(ContainerServiceOrchestratorProfile), ContainerServiceCustomProfile customProfile = default(ContainerServiceCustomProfile), ContainerServiceServicePrincipalProfile servicePrincipalProfile = default(ContainerServiceServicePrincipalProfile), ContainerServiceWindowsProfile windowsProfile = default(ContainerServiceWindowsProfile), ContainerServiceDiagnosticsProfile diagnosticsProfile = default(ContainerServiceDiagnosticsProfile)) - : base(location, id, name, type, tags) - { - ProvisioningState = provisioningState; - OrchestratorProfile = orchestratorProfile; - CustomProfile = customProfile; - ServicePrincipalProfile = servicePrincipalProfile; - MasterProfile = masterProfile; - AgentPoolProfiles = agentPoolProfiles; - WindowsProfile = windowsProfile; - LinuxProfile = linuxProfile; - DiagnosticsProfile = diagnosticsProfile; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the current deployment or provisioning state, which only - /// appears in the response. - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets properties of the orchestrator. - /// - [JsonProperty(PropertyName = "properties.orchestratorProfile")] - public ContainerServiceOrchestratorProfile OrchestratorProfile { get; set; } - - /// - /// Gets or sets properties for custom clusters. - /// - [JsonProperty(PropertyName = "properties.customProfile")] - public ContainerServiceCustomProfile CustomProfile { get; set; } - - /// - /// Gets or sets properties for cluster service principals. - /// - [JsonProperty(PropertyName = "properties.servicePrincipalProfile")] - public ContainerServiceServicePrincipalProfile ServicePrincipalProfile { get; set; } - - /// - /// Gets or sets properties of master agents. - /// - [JsonProperty(PropertyName = "properties.masterProfile")] - public ContainerServiceMasterProfile MasterProfile { get; set; } - - /// - /// Gets or sets properties of the agent pool. - /// - [JsonProperty(PropertyName = "properties.agentPoolProfiles")] - public IList AgentPoolProfiles { get; set; } - - /// - /// Gets or sets properties of Windows VMs. - /// - [JsonProperty(PropertyName = "properties.windowsProfile")] - public ContainerServiceWindowsProfile WindowsProfile { get; set; } - - /// - /// Gets or sets properties of Linux VMs. - /// - [JsonProperty(PropertyName = "properties.linuxProfile")] - public ContainerServiceLinuxProfile LinuxProfile { get; set; } - - /// - /// Gets or sets properties of the diagnostic agent. - /// - [JsonProperty(PropertyName = "properties.diagnosticsProfile")] - public ContainerServiceDiagnosticsProfile DiagnosticsProfile { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (MasterProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "MasterProfile"); - } - if (AgentPoolProfiles == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AgentPoolProfiles"); - } - if (LinuxProfile == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "LinuxProfile"); - } - if (OrchestratorProfile != null) - { - OrchestratorProfile.Validate(); - } - if (CustomProfile != null) - { - CustomProfile.Validate(); - } - if (ServicePrincipalProfile != null) - { - ServicePrincipalProfile.Validate(); - } - if (MasterProfile != null) - { - MasterProfile.Validate(); - } - if (AgentPoolProfiles != null) - { - foreach (var element in AgentPoolProfiles) - { - if (element != null) - { - element.Validate(); - } - } - } - if (WindowsProfile != null) - { - WindowsProfile.Validate(); - } - if (LinuxProfile != null) - { - LinuxProfile.Validate(); - } - if (DiagnosticsProfile != null) - { - DiagnosticsProfile.Validate(); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceAgentPoolProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceAgentPoolProfile.cs deleted file mode 100644 index df3842392e84..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceAgentPoolProfile.cs +++ /dev/null @@ -1,149 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for the container service agent pool. - /// - public partial class ContainerServiceAgentPoolProfile - { - /// - /// Initializes a new instance of the ContainerServiceAgentPoolProfile - /// class. - /// - public ContainerServiceAgentPoolProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceAgentPoolProfile - /// class. - /// - /// Unique name of the agent pool profile in the - /// context of the subscription and resource group. - /// Number of agents (VMs) to host docker - /// containers. Allowed values must be in the range of 1 to 100 - /// (inclusive). The default value is 1. - /// Size of agent VMs. Possible values include: - /// 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', - /// 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', - /// 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', - /// 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', - /// 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', - /// 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', - /// 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', - /// 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', - /// 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', - /// 'Standard_G5', 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', - /// 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', - /// 'Standard_DS14', 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', - /// 'Standard_GS4', 'Standard_GS5' - /// DNS prefix to be used to create the FQDN - /// for the agent pool. - /// FQDN for the agent pool. - public ContainerServiceAgentPoolProfile(string name, int count, string vmSize, string dnsPrefix, string fqdn = default(string)) - { - Name = name; - Count = count; - VmSize = vmSize; - DnsPrefix = dnsPrefix; - Fqdn = fqdn; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets unique name of the agent pool profile in the context - /// of the subscription and resource group. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets number of agents (VMs) to host docker containers. - /// Allowed values must be in the range of 1 to 100 (inclusive). The - /// default value is 1. - /// - [JsonProperty(PropertyName = "count")] - public int Count { get; set; } - - /// - /// Gets or sets size of agent VMs. Possible values include: - /// 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', - /// 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', - /// 'Standard_A8', 'Standard_A9', 'Standard_A10', 'Standard_A11', - /// 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', - /// 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', - /// 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', - /// 'Standard_D4_v2', 'Standard_D5_v2', 'Standard_D11_v2', - /// 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', - /// 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', - /// 'Standard_G5', 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', - /// 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', - /// 'Standard_DS14', 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', - /// 'Standard_GS4', 'Standard_GS5' - /// - [JsonProperty(PropertyName = "vmSize")] - public string VmSize { get; set; } - - /// - /// Gets or sets DNS prefix to be used to create the FQDN for the agent - /// pool. - /// - [JsonProperty(PropertyName = "dnsPrefix")] - public string DnsPrefix { get; set; } - - /// - /// Gets FQDN for the agent pool. - /// - [JsonProperty(PropertyName = "fqdn")] - public string Fqdn { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (VmSize == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VmSize"); - } - if (DnsPrefix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DnsPrefix"); - } - if (Count > 100) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Count", 100); - } - if (Count < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Count", 1); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceDiagnosticsProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceDiagnosticsProfile.cs deleted file mode 100644 index 9df627f026d7..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceDiagnosticsProfile.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - public partial class ContainerServiceDiagnosticsProfile - { - /// - /// Initializes a new instance of the - /// ContainerServiceDiagnosticsProfile class. - /// - public ContainerServiceDiagnosticsProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ContainerServiceDiagnosticsProfile class. - /// - /// Profile for the container service VM - /// diagnostic agent. - public ContainerServiceDiagnosticsProfile(ContainerServiceVMDiagnostics vmDiagnostics) - { - VmDiagnostics = vmDiagnostics; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets profile for the container service VM diagnostic agent. - /// - [JsonProperty(PropertyName = "vmDiagnostics")] - public ContainerServiceVMDiagnostics VmDiagnostics { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (VmDiagnostics == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VmDiagnostics"); - } - if (VmDiagnostics != null) - { - VmDiagnostics.Validate(); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceLinuxProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceLinuxProfile.cs deleted file mode 100644 index 0ad1e8815b92..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceLinuxProfile.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for Linux VMs in the container service cluster. - /// - public partial class ContainerServiceLinuxProfile - { - /// - /// Initializes a new instance of the ContainerServiceLinuxProfile - /// class. - /// - public ContainerServiceLinuxProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceLinuxProfile - /// class. - /// - /// The administrator username to use for - /// Linux VMs. - /// The ssh key configuration for Linux VMs. - public ContainerServiceLinuxProfile(string adminUsername, ContainerServiceSshConfiguration ssh) - { - AdminUsername = adminUsername; - Ssh = ssh; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the administrator username to use for Linux VMs. - /// - [JsonProperty(PropertyName = "adminUsername")] - public string AdminUsername { get; set; } - - /// - /// Gets or sets the ssh key configuration for Linux VMs. - /// - [JsonProperty(PropertyName = "ssh")] - public ContainerServiceSshConfiguration Ssh { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AdminUsername == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AdminUsername"); - } - if (Ssh == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Ssh"); - } - if (AdminUsername != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(AdminUsername, "^[a-z][a-z0-9_-]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "AdminUsername", "^[a-z][a-z0-9_-]*$"); - } - } - if (Ssh != null) - { - Ssh.Validate(); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceMasterProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceMasterProfile.cs deleted file mode 100644 index 0c9539edf034..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceMasterProfile.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for the container service master. - /// - public partial class ContainerServiceMasterProfile - { - /// - /// Initializes a new instance of the ContainerServiceMasterProfile - /// class. - /// - public ContainerServiceMasterProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceMasterProfile - /// class. - /// - /// DNS prefix to be used to create the FQDN - /// for master. - /// Number of masters (VMs) in the container - /// service cluster. Allowed values are 1, 3, and 5. The default value - /// is 1. - /// FQDN for the master. - public ContainerServiceMasterProfile(string dnsPrefix, int? count = default(int?), string fqdn = default(string)) - { - Count = count; - DnsPrefix = dnsPrefix; - Fqdn = fqdn; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets number of masters (VMs) in the container service - /// cluster. Allowed values are 1, 3, and 5. The default value is 1. - /// - [JsonProperty(PropertyName = "count")] - public int? Count { get; set; } - - /// - /// Gets or sets DNS prefix to be used to create the FQDN for master. - /// - [JsonProperty(PropertyName = "dnsPrefix")] - public string DnsPrefix { get; set; } - - /// - /// Gets FQDN for the master. - /// - [JsonProperty(PropertyName = "fqdn")] - public string Fqdn { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DnsPrefix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DnsPrefix"); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorProfile.cs deleted file mode 100644 index 169410d83efb..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorProfile.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for the container service orchestrator. - /// - public partial class ContainerServiceOrchestratorProfile - { - /// - /// Initializes a new instance of the - /// ContainerServiceOrchestratorProfile class. - /// - public ContainerServiceOrchestratorProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ContainerServiceOrchestratorProfile class. - /// - /// The orchestrator to use to manage - /// container service cluster resources. Valid values are Swarm, DCOS, - /// and Custom. Possible values include: 'Swarm', 'DCOS', 'Custom', - /// 'Kubernetes' - public ContainerServiceOrchestratorProfile(ContainerServiceOrchestratorTypes orchestratorType) - { - OrchestratorType = orchestratorType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the orchestrator to use to manage container service - /// cluster resources. Valid values are Swarm, DCOS, and Custom. - /// Possible values include: 'Swarm', 'DCOS', 'Custom', 'Kubernetes' - /// - [JsonProperty(PropertyName = "orchestratorType")] - public ContainerServiceOrchestratorTypes OrchestratorType { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorTypes.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorTypes.cs deleted file mode 100644 index 390ea4b569c1..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceOrchestratorTypes.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ContainerServiceOrchestratorTypes. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum ContainerServiceOrchestratorTypes - { - [EnumMember(Value = "Swarm")] - Swarm, - [EnumMember(Value = "DCOS")] - DCOS, - [EnumMember(Value = "Custom")] - Custom, - [EnumMember(Value = "Kubernetes")] - Kubernetes - } - internal static class ContainerServiceOrchestratorTypesEnumExtension - { - internal static string ToSerializedValue(this ContainerServiceOrchestratorTypes? value) - { - return value == null ? null : ((ContainerServiceOrchestratorTypes)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ContainerServiceOrchestratorTypes value) - { - switch( value ) - { - case ContainerServiceOrchestratorTypes.Swarm: - return "Swarm"; - case ContainerServiceOrchestratorTypes.DCOS: - return "DCOS"; - case ContainerServiceOrchestratorTypes.Custom: - return "Custom"; - case ContainerServiceOrchestratorTypes.Kubernetes: - return "Kubernetes"; - } - return null; - } - - internal static ContainerServiceOrchestratorTypes? ParseContainerServiceOrchestratorTypes(this string value) - { - switch( value ) - { - case "Swarm": - return ContainerServiceOrchestratorTypes.Swarm; - case "DCOS": - return ContainerServiceOrchestratorTypes.DCOS; - case "Custom": - return ContainerServiceOrchestratorTypes.Custom; - case "Kubernetes": - return ContainerServiceOrchestratorTypes.Kubernetes; - } - return null; - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceServicePrincipalProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceServicePrincipalProfile.cs deleted file mode 100644 index f3388c2d3865..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceServicePrincipalProfile.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information about a service principal identity for the cluster to use - /// for manipulating Azure APIs. - /// - public partial class ContainerServiceServicePrincipalProfile - { - /// - /// Initializes a new instance of the - /// ContainerServiceServicePrincipalProfile class. - /// - public ContainerServiceServicePrincipalProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ContainerServiceServicePrincipalProfile class. - /// - /// The ID for the service principal. - /// The secret password associated with the - /// service principal. - public ContainerServiceServicePrincipalProfile(string clientId, string secret) - { - ClientId = clientId; - Secret = secret; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the ID for the service principal. - /// - [JsonProperty(PropertyName = "clientId")] - public string ClientId { get; set; } - - /// - /// Gets or sets the secret password associated with the service - /// principal. - /// - [JsonProperty(PropertyName = "secret")] - public string Secret { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ClientId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ClientId"); - } - if (Secret == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Secret"); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshConfiguration.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshConfiguration.cs deleted file mode 100644 index 5d3cf56fa1ee..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshConfiguration.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// SSH configuration for Linux-based VMs running on Azure. - /// - public partial class ContainerServiceSshConfiguration - { - /// - /// Initializes a new instance of the ContainerServiceSshConfiguration - /// class. - /// - public ContainerServiceSshConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceSshConfiguration - /// class. - /// - /// the list of SSH public keys used to - /// authenticate with Linux-based VMs. - public ContainerServiceSshConfiguration(IList publicKeys) - { - PublicKeys = publicKeys; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the list of SSH public keys used to authenticate with - /// Linux-based VMs. - /// - [JsonProperty(PropertyName = "publicKeys")] - public IList PublicKeys { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PublicKeys == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PublicKeys"); - } - if (PublicKeys != null) - { - foreach (var element in PublicKeys) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshPublicKey.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshPublicKey.cs deleted file mode 100644 index 36d950106abd..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceSshPublicKey.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Contains information about SSH certificate public key data. - /// - public partial class ContainerServiceSshPublicKey - { - /// - /// Initializes a new instance of the ContainerServiceSshPublicKey - /// class. - /// - public ContainerServiceSshPublicKey() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceSshPublicKey - /// class. - /// - /// Certificate public key used to authenticate - /// with VMs through SSH. The certificate must be in PEM format with or - /// without headers. - public ContainerServiceSshPublicKey(string keyData) - { - KeyData = keyData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets certificate public key used to authenticate with VMs - /// through SSH. The certificate must be in PEM format with or without - /// headers. - /// - [JsonProperty(PropertyName = "keyData")] - public string KeyData { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (KeyData == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "KeyData"); - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMDiagnostics.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMDiagnostics.cs deleted file mode 100644 index 31cb6845c8c0..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMDiagnostics.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for diagnostics on the container service VMs. - /// - public partial class ContainerServiceVMDiagnostics - { - /// - /// Initializes a new instance of the ContainerServiceVMDiagnostics - /// class. - /// - public ContainerServiceVMDiagnostics() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceVMDiagnostics - /// class. - /// - /// Whether the VM diagnostic agent is - /// provisioned on the VM. - /// The URI of the storage account where - /// diagnostics are stored. - public ContainerServiceVMDiagnostics(bool enabled, string storageUri = default(string)) - { - Enabled = enabled; - StorageUri = storageUri; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets whether the VM diagnostic agent is provisioned on the - /// VM. - /// - [JsonProperty(PropertyName = "enabled")] - public bool Enabled { get; set; } - - /// - /// Gets the URI of the storage account where diagnostics are stored. - /// - [JsonProperty(PropertyName = "storageUri")] - public string StorageUri { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - //Nothing to validate - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMSizeTypes.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMSizeTypes.cs deleted file mode 100644 index d31363e9854b..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceVMSizeTypes.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - - /// - /// Defines values for ContainerServiceVMSizeTypes. - /// - public static class ContainerServiceVMSizeTypes - { - public const string StandardA0 = "Standard_A0"; - public const string StandardA1 = "Standard_A1"; - public const string StandardA2 = "Standard_A2"; - public const string StandardA3 = "Standard_A3"; - public const string StandardA4 = "Standard_A4"; - public const string StandardA5 = "Standard_A5"; - public const string StandardA6 = "Standard_A6"; - public const string StandardA7 = "Standard_A7"; - public const string StandardA8 = "Standard_A8"; - public const string StandardA9 = "Standard_A9"; - public const string StandardA10 = "Standard_A10"; - public const string StandardA11 = "Standard_A11"; - public const string StandardD1 = "Standard_D1"; - public const string StandardD2 = "Standard_D2"; - public const string StandardD3 = "Standard_D3"; - public const string StandardD4 = "Standard_D4"; - public const string StandardD11 = "Standard_D11"; - public const string StandardD12 = "Standard_D12"; - public const string StandardD13 = "Standard_D13"; - public const string StandardD14 = "Standard_D14"; - public const string StandardD1V2 = "Standard_D1_v2"; - public const string StandardD2V2 = "Standard_D2_v2"; - public const string StandardD3V2 = "Standard_D3_v2"; - public const string StandardD4V2 = "Standard_D4_v2"; - public const string StandardD5V2 = "Standard_D5_v2"; - public const string StandardD11V2 = "Standard_D11_v2"; - public const string StandardD12V2 = "Standard_D12_v2"; - public const string StandardD13V2 = "Standard_D13_v2"; - public const string StandardD14V2 = "Standard_D14_v2"; - public const string StandardG1 = "Standard_G1"; - public const string StandardG2 = "Standard_G2"; - public const string StandardG3 = "Standard_G3"; - public const string StandardG4 = "Standard_G4"; - public const string StandardG5 = "Standard_G5"; - public const string StandardDS1 = "Standard_DS1"; - public const string StandardDS2 = "Standard_DS2"; - public const string StandardDS3 = "Standard_DS3"; - public const string StandardDS4 = "Standard_DS4"; - public const string StandardDS11 = "Standard_DS11"; - public const string StandardDS12 = "Standard_DS12"; - public const string StandardDS13 = "Standard_DS13"; - public const string StandardDS14 = "Standard_DS14"; - public const string StandardGS1 = "Standard_GS1"; - public const string StandardGS2 = "Standard_GS2"; - public const string StandardGS3 = "Standard_GS3"; - public const string StandardGS4 = "Standard_GS4"; - public const string StandardGS5 = "Standard_GS5"; - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceWindowsProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceWindowsProfile.cs deleted file mode 100644 index 671adcedd214..000000000000 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceWindowsProfile.cs +++ /dev/null @@ -1,95 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Compute.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Profile for Windows VMs in the container service cluster. - /// - public partial class ContainerServiceWindowsProfile - { - /// - /// Initializes a new instance of the ContainerServiceWindowsProfile - /// class. - /// - public ContainerServiceWindowsProfile() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContainerServiceWindowsProfile - /// class. - /// - /// The administrator username to use for - /// Windows VMs. - /// The administrator password to use for - /// Windows VMs. - public ContainerServiceWindowsProfile(string adminUsername, string adminPassword) - { - AdminUsername = adminUsername; - AdminPassword = adminPassword; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the administrator username to use for Windows VMs. - /// - [JsonProperty(PropertyName = "adminUsername")] - public string AdminUsername { get; set; } - - /// - /// Gets or sets the administrator password to use for Windows VMs. - /// - [JsonProperty(PropertyName = "adminPassword")] - public string AdminPassword { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AdminUsername == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AdminUsername"); - } - if (AdminPassword == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AdminPassword"); - } - if (AdminUsername != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(AdminUsername, "^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$")) - { - throw new ValidationException(ValidationRules.Pattern, "AdminUsername", "^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$"); - } - } - if (AdminPassword != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(AdminPassword, "^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$")) - { - throw new ValidationException(ValidationRules.Pattern, "AdminPassword", "^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$"); - } - } - } - } -} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/Extension.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/Extension.cs new file mode 100644 index 000000000000..66db804aec3f --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/Extension.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a cloud service Extension. + /// + public partial class Extension + { + /// + /// Initializes a new instance of the Extension class. + /// + public Extension() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Extension class. + /// + /// The name of the extension. + public Extension(string name = default(string), CloudServiceExtensionProperties properties = default(CloudServiceExtensionProperties)) + { + Name = name; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the extension. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties")] + public CloudServiceExtensionProperties Properties { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/HardwareProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/HardwareProfile.cs index 93319ecbc5b0..ec8e8c5cf92e 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/HardwareProfile.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/HardwareProfile.cs @@ -32,27 +32,33 @@ public HardwareProfile() /// Specifies the size of the virtual machine. For /// more information about virtual machine sizes, see [Sizes for /// virtual - /// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + /// machines](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes). /// <br><br> The available VM sizes depend on region and /// availability set. For a list of available sizes use these APIs: /// <br><br> [List all available virtual machine sizes in /// an availability /// set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) /// <br><br> [List all available virtual machine sizes in a - /// region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + /// region]( + /// https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) /// <br><br> [List all available virtual machine sizes for /// resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - /// Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', - /// 'Basic_A3', 'Basic_A4', 'Standard_A0', 'Standard_A1', - /// 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', - /// 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', - /// 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', - /// 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', - /// 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', - /// 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', - /// 'Standard_B8ms', 'Standard_D1', 'Standard_D2', 'Standard_D3', - /// 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', - /// 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', + /// <br><br> This list of sizes is no longer updated and + /// the **VirtualMachineSizeTypes** string constants will be removed + /// from the subsequent REST API specification. Use [List all available + /// virtual machine sizes in a region]( + /// https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) + /// to get the latest sizes. Possible values include: 'Basic_A0', + /// 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', + /// 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', + /// 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', + /// 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + /// 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', + /// 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', + /// 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', + /// 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D2', + /// 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', + /// 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', /// 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', /// 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', /// 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', @@ -106,29 +112,34 @@ public HardwareProfile() /// /// Gets or sets specifies the size of the virtual machine. For more /// information about virtual machine sizes, see [Sizes for virtual - /// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + /// machines](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes). /// &lt;br&gt;&lt;br&gt; The available VM sizes depend /// on region and availability set. For a list of available sizes use /// these APIs: &lt;br&gt;&lt;br&gt; [List all /// available virtual machine sizes in an availability /// set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) /// &lt;br&gt;&lt;br&gt; [List all available virtual - /// machine sizes in a - /// region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) + /// machine sizes in a region]( + /// https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) /// &lt;br&gt;&lt;br&gt; [List all available virtual /// machine sizes for /// resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). - /// Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', - /// 'Basic_A3', 'Basic_A4', 'Standard_A0', 'Standard_A1', - /// 'Standard_A2', 'Standard_A3', 'Standard_A4', 'Standard_A5', - /// 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', - /// 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', - /// 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', - /// 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', - /// 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', - /// 'Standard_B8ms', 'Standard_D1', 'Standard_D2', 'Standard_D3', - /// 'Standard_D4', 'Standard_D11', 'Standard_D12', 'Standard_D13', - /// 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', + /// &lt;br&gt;&lt;br&gt; This list of sizes is no + /// longer updated and the **VirtualMachineSizeTypes** string constants + /// will be removed from the subsequent REST API specification. Use + /// [List all available virtual machine sizes in a region]( + /// https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) + /// to get the latest sizes. Possible values include: 'Basic_A0', + /// 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', 'Standard_A0', + /// 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', + /// 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', + /// 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + /// 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', + /// 'Standard_A2m_v2', 'Standard_A4m_v2', 'Standard_A8m_v2', + /// 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', 'Standard_B2ms', + /// 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D2', + /// 'Standard_D3', 'Standard_D4', 'Standard_D11', 'Standard_D12', + /// 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', 'Standard_D2_v2', /// 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', /// 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', /// 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceSku.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceSku.cs new file mode 100644 index 000000000000..cc6d5e72fe8c --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceSku.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class InstanceSku + { + /// + /// Initializes a new instance of the InstanceSku class. + /// + public InstanceSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InstanceSku class. + /// + /// The sku name. + /// The tier of the cloud service role + /// instance. + public InstanceSku(string name = default(string), string tier = default(string)) + { + Name = name; + Tier = tier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the sku name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the tier of the cloud service role instance. + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; private set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceViewStatusesSummary.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceViewStatusesSummary.cs new file mode 100644 index 000000000000..37cee73429f9 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/InstanceViewStatusesSummary.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Instance view statuses. + /// + public partial class InstanceViewStatusesSummary + { + /// + /// Initializes a new instance of the InstanceViewStatusesSummary + /// class. + /// + public InstanceViewStatusesSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InstanceViewStatusesSummary + /// class. + /// + public InstanceViewStatusesSummary(IList statusesSummary = default(IList)) + { + StatusesSummary = statusesSummary; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "statusesSummary")] + public IList StatusesSummary { get; private set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfiguration.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfiguration.cs new file mode 100644 index 000000000000..1965c9fc649f --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfiguration.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the load balancer configuration. + /// + public partial class LoadBalancerConfiguration + { + /// + /// Initializes a new instance of the LoadBalancerConfiguration class. + /// + public LoadBalancerConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LoadBalancerConfiguration class. + /// + /// Resource Name + public LoadBalancerConfiguration(string name = default(string), LoadBalancerConfigurationProperties properties = default(LoadBalancerConfigurationProperties)) + { + Name = name; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource Name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties")] + public LoadBalancerConfigurationProperties Properties { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfigurationProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfigurationProperties.cs new file mode 100644 index 000000000000..4c91346aecc3 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerConfigurationProperties.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class LoadBalancerConfigurationProperties + { + /// + /// Initializes a new instance of the + /// LoadBalancerConfigurationProperties class. + /// + public LoadBalancerConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// LoadBalancerConfigurationProperties class. + /// + /// List of IP + public LoadBalancerConfigurationProperties(IList frontendIPConfigurations = default(IList)) + { + FrontendIPConfigurations = frontendIPConfigurations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of IP + /// + [JsonProperty(PropertyName = "frontendIPConfigurations")] + public IList FrontendIPConfigurations { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfiguration.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfiguration.cs new file mode 100644 index 000000000000..ff6622e4be2a --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfiguration.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class LoadBalancerFrontendIPConfiguration + { + /// + /// Initializes a new instance of the + /// LoadBalancerFrontendIPConfiguration class. + /// + public LoadBalancerFrontendIPConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// LoadBalancerFrontendIPConfiguration class. + /// + public LoadBalancerFrontendIPConfiguration(string name = default(string), LoadBalancerFrontendIPConfigurationProperties properties = default(LoadBalancerFrontendIPConfigurationProperties)) + { + Name = name; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties")] + public LoadBalancerFrontendIPConfigurationProperties Properties { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfigurationProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfigurationProperties.cs new file mode 100644 index 000000000000..7187963be8cd --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LoadBalancerFrontendIPConfigurationProperties.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a cloud service IP Configuration + /// + public partial class LoadBalancerFrontendIPConfigurationProperties + { + /// + /// Initializes a new instance of the + /// LoadBalancerFrontendIPConfigurationProperties class. + /// + public LoadBalancerFrontendIPConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// LoadBalancerFrontendIPConfigurationProperties class. + /// + /// The private IP address referenced by + /// the cloud service. + public LoadBalancerFrontendIPConfigurationProperties(SubResource publicIPAddress = default(SubResource), SubResource subnet = default(SubResource), string privateIPAddress = default(string)) + { + PublicIPAddress = publicIPAddress; + Subnet = subnet; + PrivateIPAddress = privateIPAddress; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "publicIPAddress")] + public SubResource PublicIPAddress { get; set; } + + /// + /// + [JsonProperty(PropertyName = "subnet")] + public SubResource Subnet { get; set; } + + /// + /// Gets or sets the private IP address referenced by the cloud + /// service. + /// + [JsonProperty(PropertyName = "privateIPAddress")] + public string PrivateIPAddress { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LogAnalyticsInputBase.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LogAnalyticsInputBase.cs index 293dbae4c064..925a407294df 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LogAnalyticsInputBase.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/LogAnalyticsInputBase.cs @@ -40,7 +40,11 @@ public LogAnalyticsInputBase() /// Name. /// Group query result by Resource /// Name. - public LogAnalyticsInputBase(string blobContainerSasUri, System.DateTime fromTime, System.DateTime toTime, bool? groupByThrottlePolicy = default(bool?), bool? groupByOperationName = default(bool?), bool? groupByResourceName = default(bool?)) + /// Group query result by + /// Client Application ID. + /// Group query result by User + /// Agent. + public LogAnalyticsInputBase(string blobContainerSasUri, System.DateTime fromTime, System.DateTime toTime, bool? groupByThrottlePolicy = default(bool?), bool? groupByOperationName = default(bool?), bool? groupByResourceName = default(bool?), bool? groupByClientApplicationId = default(bool?), bool? groupByUserAgent = default(bool?)) { BlobContainerSasUri = blobContainerSasUri; FromTime = fromTime; @@ -48,6 +52,8 @@ public LogAnalyticsInputBase() GroupByThrottlePolicy = groupByThrottlePolicy; GroupByOperationName = groupByOperationName; GroupByResourceName = groupByResourceName; + GroupByClientApplicationId = groupByClientApplicationId; + GroupByUserAgent = groupByUserAgent; CustomInit(); } @@ -93,6 +99,18 @@ public LogAnalyticsInputBase() [JsonProperty(PropertyName = "groupByResourceName")] public bool? GroupByResourceName { get; set; } + /// + /// Gets or sets group query result by Client Application ID. + /// + [JsonProperty(PropertyName = "groupByClientApplicationId")] + public bool? GroupByClientApplicationId { get; set; } + + /// + /// Gets or sets group query result by User Agent. + /// + [JsonProperty(PropertyName = "groupByUserAgent")] + public bool? GroupByUserAgent { get; set; } + /// /// Validate the object. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RequestRateByIntervalInput.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RequestRateByIntervalInput.cs index 994e73e9bd33..a8fe7e5d4b1c 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RequestRateByIntervalInput.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RequestRateByIntervalInput.cs @@ -42,8 +42,12 @@ public RequestRateByIntervalInput() /// Name. /// Group query result by Resource /// Name. - public RequestRateByIntervalInput(string blobContainerSasUri, System.DateTime fromTime, System.DateTime toTime, IntervalInMins intervalLength, bool? groupByThrottlePolicy = default(bool?), bool? groupByOperationName = default(bool?), bool? groupByResourceName = default(bool?)) - : base(blobContainerSasUri, fromTime, toTime, groupByThrottlePolicy, groupByOperationName, groupByResourceName) + /// Group query result by + /// Client Application ID. + /// Group query result by User + /// Agent. + public RequestRateByIntervalInput(string blobContainerSasUri, System.DateTime fromTime, System.DateTime toTime, IntervalInMins intervalLength, bool? groupByThrottlePolicy = default(bool?), bool? groupByOperationName = default(bool?), bool? groupByResourceName = default(bool?), bool? groupByClientApplicationId = default(bool?), bool? groupByUserAgent = default(bool?)) + : base(blobContainerSasUri, fromTime, toTime, groupByThrottlePolicy, groupByOperationName, groupByResourceName, groupByClientApplicationId, groupByUserAgent) { IntervalLength = intervalLength; CustomInit(); diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ResourceInstanceViewStatus.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ResourceInstanceViewStatus.cs new file mode 100644 index 000000000000..fd6a5d166a6a --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ResourceInstanceViewStatus.cs @@ -0,0 +1,88 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Instance view status. + /// + public partial class ResourceInstanceViewStatus + { + /// + /// Initializes a new instance of the ResourceInstanceViewStatus class. + /// + public ResourceInstanceViewStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceInstanceViewStatus class. + /// + /// The status code. + /// The short localizable label for the + /// status. + /// The detailed status message, including for + /// alerts and error messages. + /// The time of the status. + /// The level code. Possible values include: + /// 'Info', 'Warning', 'Error' + public ResourceInstanceViewStatus(string code = default(string), string displayStatus = default(string), string message = default(string), System.DateTime? time = default(System.DateTime?), StatusLevelTypes? level = default(StatusLevelTypes?)) + { + Code = code; + DisplayStatus = displayStatus; + Message = message; + Time = time; + Level = level; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the status code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the short localizable label for the status. + /// + [JsonProperty(PropertyName = "displayStatus")] + public string DisplayStatus { get; private set; } + + /// + /// Gets the detailed status message, including for alerts and error + /// messages. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the time of the status. + /// + [JsonProperty(PropertyName = "time")] + public System.DateTime? Time { get; private set; } + + /// + /// Gets or sets the level code. Possible values include: 'Info', + /// 'Warning', 'Error' + /// + [JsonProperty(PropertyName = "level")] + public StatusLevelTypes? Level { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstance.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstance.cs new file mode 100644 index 000000000000..1dabc78b11da --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstance.cs @@ -0,0 +1,94 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class RoleInstance + { + /// + /// Initializes a new instance of the RoleInstance class. + /// + public RoleInstance() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RoleInstance class. + /// + /// Resource Id + /// Resource Name. + /// Resource Type. + /// Resource Location. + /// Resource tags. + public RoleInstance(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), InstanceSku sku = default(InstanceSku), RoleInstanceProperties properties = default(RoleInstanceProperties)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + Sku = sku; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource Name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource Type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets resource Location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public InstanceSku Sku { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties")] + public RoleInstanceProperties Properties { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceInstanceView.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceInstanceView.cs new file mode 100644 index 000000000000..5897af48e493 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceInstanceView.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The instance view of the role instance. + /// + public partial class RoleInstanceInstanceView + { + /// + /// Initializes a new instance of the RoleInstanceInstanceView class. + /// + public RoleInstanceInstanceView() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RoleInstanceInstanceView class. + /// + /// The Update Domain. + /// The Fault Domain. + /// Specifies a unique identifier generated + /// internally for the cloud service associated with this role + /// instance. <br /><br /> NOTE: If you are using Azure + /// Diagnostics extension, this property can be used as 'DeploymentId' + /// for querying details. + public RoleInstanceInstanceView(int? platformUpdateDomain = default(int?), int? platformFaultDomain = default(int?), string privateId = default(string), IList statuses = default(IList)) + { + PlatformUpdateDomain = platformUpdateDomain; + PlatformFaultDomain = platformFaultDomain; + PrivateId = privateId; + Statuses = statuses; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the Update Domain. + /// + [JsonProperty(PropertyName = "platformUpdateDomain")] + public int? PlatformUpdateDomain { get; private set; } + + /// + /// Gets the Fault Domain. + /// + [JsonProperty(PropertyName = "platformFaultDomain")] + public int? PlatformFaultDomain { get; private set; } + + /// + /// Gets specifies a unique identifier generated internally for the + /// cloud service associated with this role instance. &lt;br + /// /&gt;&lt;br /&gt; NOTE: If you are using Azure + /// Diagnostics extension, this property can be used as 'DeploymentId' + /// for querying details. + /// + [JsonProperty(PropertyName = "privateId")] + public string PrivateId { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "statuses")] + public IList Statuses { get; private set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceNetworkProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceNetworkProfile.cs new file mode 100644 index 000000000000..4a74b02f3610 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceNetworkProfile.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes the network profile for the role instance. + /// + public partial class RoleInstanceNetworkProfile + { + /// + /// Initializes a new instance of the RoleInstanceNetworkProfile class. + /// + public RoleInstanceNetworkProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RoleInstanceNetworkProfile class. + /// + /// Specifies the list of resource Ids + /// for the network interfaces associated with the role + /// instance. + public RoleInstanceNetworkProfile(IList networkInterfaces = default(IList)) + { + NetworkInterfaces = networkInterfaces; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the list of resource Ids for the network interfaces + /// associated with the role instance. + /// + [JsonProperty(PropertyName = "networkInterfaces")] + public IList NetworkInterfaces { get; private set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceProperties.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceProperties.cs new file mode 100644 index 000000000000..fb7bd0ef4526 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstanceProperties.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class RoleInstanceProperties + { + /// + /// Initializes a new instance of the RoleInstanceProperties class. + /// + public RoleInstanceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RoleInstanceProperties class. + /// + public RoleInstanceProperties(RoleInstanceNetworkProfile networkProfile = default(RoleInstanceNetworkProfile), RoleInstanceInstanceView instanceView = default(RoleInstanceInstanceView)) + { + NetworkProfile = networkProfile; + InstanceView = instanceView; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "networkProfile")] + public RoleInstanceNetworkProfile NetworkProfile { get; set; } + + /// + /// + [JsonProperty(PropertyName = "instanceView")] + public RoleInstanceInstanceView InstanceView { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceCustomProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstances.cs similarity index 56% rename from sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceCustomProfile.cs rename to sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstances.cs index d732cb9bd5ec..ca428016fc69 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ContainerServiceCustomProfile.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/RoleInstances.cs @@ -12,31 +12,32 @@ namespace Microsoft.Azure.Management.Compute.Models { using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Properties to configure a custom container service cluster. + /// Specifies a list of role instances from the cloud service. /// - public partial class ContainerServiceCustomProfile + public partial class RoleInstances { /// - /// Initializes a new instance of the ContainerServiceCustomProfile - /// class. + /// Initializes a new instance of the RoleInstances class. /// - public ContainerServiceCustomProfile() + public RoleInstances() { CustomInit(); } /// - /// Initializes a new instance of the ContainerServiceCustomProfile - /// class. + /// Initializes a new instance of the RoleInstances class. /// - /// The name of the custom orchestrator to - /// use. - public ContainerServiceCustomProfile(string orchestrator) + /// List of cloud service role + /// instance names. Value of '*' will signify all role instances of the + /// cloud service. + public RoleInstances(IList roleInstancesProperty) { - Orchestrator = orchestrator; + RoleInstancesProperty = roleInstancesProperty; CustomInit(); } @@ -46,10 +47,11 @@ public ContainerServiceCustomProfile(string orchestrator) partial void CustomInit(); /// - /// Gets or sets the name of the custom orchestrator to use. + /// Gets or sets list of cloud service role instance names. Value of + /// '*' will signify all role instances of the cloud service. /// - [JsonProperty(PropertyName = "orchestrator")] - public string Orchestrator { get; set; } + [JsonProperty(PropertyName = "roleInstances")] + public IList RoleInstancesProperty { get; set; } /// /// Validate the object. @@ -59,9 +61,9 @@ public ContainerServiceCustomProfile(string orchestrator) /// public virtual void Validate() { - if (Orchestrator == null) + if (RoleInstancesProperty == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Orchestrator"); + throw new ValidationException(ValidationRules.CannotBeNull, "RoleInstancesProperty"); } } } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/StatusCodeCount.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/StatusCodeCount.cs new file mode 100644 index 000000000000..58d751d63e8e --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/StatusCodeCount.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class StatusCodeCount + { + /// + /// Initializes a new instance of the StatusCodeCount class. + /// + public StatusCodeCount() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StatusCodeCount class. + /// + /// The instance view status code + /// Number of instances having this status + /// code + public StatusCodeCount(string code = default(string), int? count = default(int?)) + { + Code = code; + Count = count; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the instance view status code + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets number of instances having this status code + /// + [JsonProperty(PropertyName = "count")] + public int? Count { get; private set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ThrottledRequestsInput.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ThrottledRequestsInput.cs index 6d7419492412..969e1d214be4 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ThrottledRequestsInput.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ThrottledRequestsInput.cs @@ -38,8 +38,12 @@ public ThrottledRequestsInput() /// Name. /// Group query result by Resource /// Name. - public ThrottledRequestsInput(string blobContainerSasUri, System.DateTime fromTime, System.DateTime toTime, bool? groupByThrottlePolicy = default(bool?), bool? groupByOperationName = default(bool?), bool? groupByResourceName = default(bool?)) - : base(blobContainerSasUri, fromTime, toTime, groupByThrottlePolicy, groupByOperationName, groupByResourceName) + /// Group query result by + /// Client Application ID. + /// Group query result by User + /// Agent. + public ThrottledRequestsInput(string blobContainerSasUri, System.DateTime fromTime, System.DateTime toTime, bool? groupByThrottlePolicy = default(bool?), bool? groupByOperationName = default(bool?), bool? groupByResourceName = default(bool?), bool? groupByClientApplicationId = default(bool?), bool? groupByUserAgent = default(bool?)) + : base(blobContainerSasUri, fromTime, toTime, groupByThrottlePolicy, groupByOperationName, groupByResourceName, groupByClientApplicationId, groupByUserAgent) { CustomInit(); } diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/UpdateDomain.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/UpdateDomain.cs new file mode 100644 index 000000000000..a70bab5d5e0d --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/UpdateDomain.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines an update domain for the cloud service. + /// + public partial class UpdateDomain + { + /// + /// Initializes a new instance of the UpdateDomain class. + /// + public UpdateDomain() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpdateDomain class. + /// + /// Resource Id + /// Resource Name + public UpdateDomain(string id = default(string), string name = default(string)) + { + Id = id; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource Name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachine.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachine.cs index 497be8511c7d..53cc695fea8b 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachine.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachine.cs @@ -119,15 +119,17 @@ public VirtualMachine() /// The virtual machine instance /// view. /// Specifies that the image or disk that is - /// being used was licensed on-premises. This element is only used for - /// images that contain the Windows Server operating system. - /// <br><br> Possible values are: <br><br> - /// Windows_Client <br><br> Windows_Server - /// <br><br> If this element is included in a request for - /// an update, the value must match the initial value. This value - /// cannot be updated. <br><br> For more information, see - /// [Azure Hybrid Use Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) /// <br><br> Minimum api-version: 2015-06-15 /// Specifies the VM unique ID which is a 128-bits /// identifier that is encoded and stored in all Azure IaaS VMs SMBIOS @@ -348,16 +350,19 @@ public VirtualMachine() /// /// Gets or sets specifies that the image or disk that is being used - /// was licensed on-premises. This element is only used for images that - /// contain the Windows Server operating system. - /// &lt;br&gt;&lt;br&gt; Possible values are: + /// was licensed on-premises. &lt;br&gt;&lt;br&gt; + /// Possible values for Windows Server operating system are: /// &lt;br&gt;&lt;br&gt; Windows_Client /// &lt;br&gt;&lt;br&gt; Windows_Server - /// &lt;br&gt;&lt;br&gt; If this element is included in - /// a request for an update, the value must match the initial value. - /// This value cannot be updated. &lt;br&gt;&lt;br&gt; - /// For more information, see [Azure Hybrid Use Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + /// &lt;br&gt;&lt;br&gt; Possible values for Linux + /// Server operating system are: &lt;br&gt;&lt;br&gt; + /// RHEL_BYOS (for RHEL) &lt;br&gt;&lt;br&gt; SLES_BYOS + /// (for SUSE) &lt;br&gt;&lt;br&gt; For more + /// information, see [Azure Hybrid Use Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// &lt;br&gt;&lt;br&gt; [Azure Hybrid Use Benefit for + /// Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) /// &lt;br&gt;&lt;br&gt; Minimum api-version: /// 2015-06-15 /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetNetworkConfiguration.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetNetworkConfiguration.cs index db8dfda30898..f1bb37f73f7e 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetNetworkConfiguration.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetNetworkConfiguration.cs @@ -45,18 +45,21 @@ public VirtualMachineScaleSetNetworkConfiguration() /// case the virtual machine has more than 1 network interface. /// Specifies whether the /// network interface is accelerated networking-enabled. + /// Specifies whether the network interface is + /// FPGA networking-enabled. /// The network security /// group. /// The dns settings to be applied on the /// network interfaces. /// Whether IP forwarding enabled on /// this NIC. - public VirtualMachineScaleSetNetworkConfiguration(string name, IList ipConfigurations, string id = default(string), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetNetworkConfigurationDnsSettings), bool? enableIPForwarding = default(bool?)) + public VirtualMachineScaleSetNetworkConfiguration(string name, IList ipConfigurations, string id = default(string), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? enableFpga = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetNetworkConfigurationDnsSettings), bool? enableIPForwarding = default(bool?)) : base(id) { Name = name; Primary = primary; EnableAcceleratedNetworking = enableAcceleratedNetworking; + EnableFpga = enableFpga; NetworkSecurityGroup = networkSecurityGroup; DnsSettings = dnsSettings; IpConfigurations = ipConfigurations; @@ -89,6 +92,13 @@ public VirtualMachineScaleSetNetworkConfiguration() [JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] public bool? EnableAcceleratedNetworking { get; set; } + /// + /// Gets or sets specifies whether the network interface is FPGA + /// networking-enabled. + /// + [JsonProperty(PropertyName = "properties.enableFpga")] + public bool? EnableFpga { get; set; } + /// /// Gets or sets the network security group. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateNetworkConfiguration.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateNetworkConfiguration.cs index 3e66fccf7179..adfa879b9800 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateNetworkConfiguration.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateNetworkConfiguration.cs @@ -43,6 +43,8 @@ public VirtualMachineScaleSetUpdateNetworkConfiguration() /// machine. /// Specifies whether the /// network interface is accelerated networking-enabled. + /// Specifies whether the network interface is + /// FPGA networking-enabled. /// The network security /// group. /// The dns settings to be applied on the @@ -51,12 +53,13 @@ public VirtualMachineScaleSetUpdateNetworkConfiguration() /// Configuration. /// Whether IP forwarding enabled on /// this NIC. - public VirtualMachineScaleSetUpdateNetworkConfiguration(string id = default(string), string name = default(string), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetNetworkConfigurationDnsSettings), IList ipConfigurations = default(IList), bool? enableIPForwarding = default(bool?)) + public VirtualMachineScaleSetUpdateNetworkConfiguration(string id = default(string), string name = default(string), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? enableFpga = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetNetworkConfigurationDnsSettings), IList ipConfigurations = default(IList), bool? enableIPForwarding = default(bool?)) : base(id) { Name = name; Primary = primary; EnableAcceleratedNetworking = enableAcceleratedNetworking; + EnableFpga = enableFpga; NetworkSecurityGroup = networkSecurityGroup; DnsSettings = dnsSettings; IpConfigurations = ipConfigurations; @@ -88,6 +91,13 @@ public VirtualMachineScaleSetUpdateNetworkConfiguration() [JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] public bool? EnableAcceleratedNetworking { get; set; } + /// + /// Gets or sets specifies whether the network interface is FPGA + /// networking-enabled. + /// + [JsonProperty(PropertyName = "properties.enableFpga")] + public bool? EnableFpga { get; set; } + /// /// Gets or sets the network security group. /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVM.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVM.cs index 42f9b67e1fd0..f7611f16f7f6 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVM.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVM.cs @@ -82,15 +82,17 @@ public VirtualMachineScaleSetVM() /// The provisioning state, which only /// appears in the response. /// Specifies that the image or disk that is - /// being used was licensed on-premises. This element is only used for - /// images that contain the Windows Server operating system. - /// <br><br> Possible values are: <br><br> - /// Windows_Client <br><br> Windows_Server - /// <br><br> If this element is included in a request for - /// an update, the value must match the initial value. This value - /// cannot be updated. <br><br> For more information, see - /// [Azure Hybrid Use Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) /// <br><br> Minimum api-version: 2015-06-15 /// Specifies whether the model /// applied to the virtual machine is the model of the virtual machine @@ -255,16 +257,19 @@ public VirtualMachineScaleSetVM() /// /// Gets or sets specifies that the image or disk that is being used - /// was licensed on-premises. This element is only used for images that - /// contain the Windows Server operating system. - /// &lt;br&gt;&lt;br&gt; Possible values are: + /// was licensed on-premises. &lt;br&gt;&lt;br&gt; + /// Possible values for Windows Server operating system are: /// &lt;br&gt;&lt;br&gt; Windows_Client /// &lt;br&gt;&lt;br&gt; Windows_Server - /// &lt;br&gt;&lt;br&gt; If this element is included in - /// a request for an update, the value must match the initial value. - /// This value cannot be updated. &lt;br&gt;&lt;br&gt; - /// For more information, see [Azure Hybrid Use Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + /// &lt;br&gt;&lt;br&gt; Possible values for Linux + /// Server operating system are: &lt;br&gt;&lt;br&gt; + /// RHEL_BYOS (for RHEL) &lt;br&gt;&lt;br&gt; SLES_BYOS + /// (for SUSE) &lt;br&gt;&lt;br&gt; For more + /// information, see [Azure Hybrid Use Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// &lt;br&gt;&lt;br&gt; [Azure Hybrid Use Benefit for + /// Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) /// &lt;br&gt;&lt;br&gt; Minimum api-version: /// 2015-06-15 /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMExtension.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMExtension.cs new file mode 100644 index 000000000000..06226939c7c2 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMExtension.cs @@ -0,0 +1,170 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a VMSS VM Extension. + /// + [Rest.Serialization.JsonTransformation] + public partial class VirtualMachineScaleSetVMExtension : SubResourceReadOnly + { + /// + /// Initializes a new instance of the VirtualMachineScaleSetVMExtension + /// class. + /// + public VirtualMachineScaleSetVMExtension() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualMachineScaleSetVMExtension + /// class. + /// + /// Resource Id + /// The name of the extension. + /// Resource type + /// How the extension handler should be + /// forced to update even if the extension configuration has not + /// changed. + /// The name of the extension handler + /// publisher. + /// Specifies the type of the extension; an example + /// is "CustomScriptExtension". + /// Specifies the version of the + /// script handler. + /// Indicates whether the + /// extension should use a newer minor version if one is available at + /// deployment time. Once deployed, however, the extension will not + /// upgrade minor versions unless redeployed, even with this property + /// set to true. + /// Indicates whether the + /// extension should be automatically upgraded by the platform if there + /// is a newer version of the extension available. + /// Json formatted public settings for the + /// extension. + /// The extension can contain either + /// protectedSettings or protectedSettingsFromKeyVault or no protected + /// settings at all. + /// The provisioning state, which only + /// appears in the response. + /// The virtual machine extension instance + /// view. + public VirtualMachineScaleSetVMExtension(string id = default(string), string name = default(string), string type = default(string), string forceUpdateTag = default(string), string publisher = default(string), string type1 = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), VirtualMachineExtensionInstanceView instanceView = default(VirtualMachineExtensionInstanceView)) + : base(id) + { + Name = name; + Type = type; + ForceUpdateTag = forceUpdateTag; + Publisher = publisher; + Type1 = type1; + TypeHandlerVersion = typeHandlerVersion; + AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + EnableAutomaticUpgrade = enableAutomaticUpgrade; + Settings = settings; + ProtectedSettings = protectedSettings; + ProvisioningState = provisioningState; + InstanceView = instanceView; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the extension. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets how the extension handler should be forced to update + /// even if the extension configuration has not changed. + /// + [JsonProperty(PropertyName = "properties.forceUpdateTag")] + public string ForceUpdateTag { get; set; } + + /// + /// Gets or sets the name of the extension handler publisher. + /// + [JsonProperty(PropertyName = "properties.publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets specifies the type of the extension; an example is + /// "CustomScriptExtension". + /// + [JsonProperty(PropertyName = "properties.type")] + public string Type1 { get; set; } + + /// + /// Gets or sets specifies the version of the script handler. + /// + [JsonProperty(PropertyName = "properties.typeHandlerVersion")] + public string TypeHandlerVersion { get; set; } + + /// + /// Gets or sets indicates whether the extension should use a newer + /// minor version if one is available at deployment time. Once + /// deployed, however, the extension will not upgrade minor versions + /// unless redeployed, even with this property set to true. + /// + [JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion { get; set; } + + /// + /// Gets or sets indicates whether the extension should be + /// automatically upgraded by the platform if there is a newer version + /// of the extension available. + /// + [JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] + public bool? EnableAutomaticUpgrade { get; set; } + + /// + /// Gets or sets json formatted public settings for the extension. + /// + [JsonProperty(PropertyName = "properties.settings")] + public object Settings { get; set; } + + /// + /// Gets or sets the extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + [JsonProperty(PropertyName = "properties.protectedSettings")] + public object ProtectedSettings { get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the virtual machine extension instance view. + /// + [JsonProperty(PropertyName = "properties.instanceView")] + public VirtualMachineExtensionInstanceView InstanceView { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMExtensionUpdate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMExtensionUpdate.cs new file mode 100644 index 000000000000..16cf7368378f --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMExtensionUpdate.cs @@ -0,0 +1,152 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a VMSS VM Extension. + /// + [Rest.Serialization.JsonTransformation] + public partial class VirtualMachineScaleSetVMExtensionUpdate : SubResourceReadOnly + { + /// + /// Initializes a new instance of the + /// VirtualMachineScaleSetVMExtensionUpdate class. + /// + public VirtualMachineScaleSetVMExtensionUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// VirtualMachineScaleSetVMExtensionUpdate class. + /// + /// Resource Id + /// The name of the extension. + /// Resource type + /// How the extension handler should be + /// forced to update even if the extension configuration has not + /// changed. + /// The name of the extension handler + /// publisher. + /// Specifies the type of the extension; an example + /// is "CustomScriptExtension". + /// Specifies the version of the + /// script handler. + /// Indicates whether the + /// extension should use a newer minor version if one is available at + /// deployment time. Once deployed, however, the extension will not + /// upgrade minor versions unless redeployed, even with this property + /// set to true. + /// Indicates whether the + /// extension should be automatically upgraded by the platform if there + /// is a newer version of the extension available. + /// Json formatted public settings for the + /// extension. + /// The extension can contain either + /// protectedSettings or protectedSettingsFromKeyVault or no protected + /// settings at all. + public VirtualMachineScaleSetVMExtensionUpdate(string id = default(string), string name = default(string), string type = default(string), string forceUpdateTag = default(string), string publisher = default(string), string type1 = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object)) + : base(id) + { + Name = name; + Type = type; + ForceUpdateTag = forceUpdateTag; + Publisher = publisher; + Type1 = type1; + TypeHandlerVersion = typeHandlerVersion; + AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + EnableAutomaticUpgrade = enableAutomaticUpgrade; + Settings = settings; + ProtectedSettings = protectedSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the extension. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets how the extension handler should be forced to update + /// even if the extension configuration has not changed. + /// + [JsonProperty(PropertyName = "properties.forceUpdateTag")] + public string ForceUpdateTag { get; set; } + + /// + /// Gets or sets the name of the extension handler publisher. + /// + [JsonProperty(PropertyName = "properties.publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets specifies the type of the extension; an example is + /// "CustomScriptExtension". + /// + [JsonProperty(PropertyName = "properties.type")] + public string Type1 { get; set; } + + /// + /// Gets or sets specifies the version of the script handler. + /// + [JsonProperty(PropertyName = "properties.typeHandlerVersion")] + public string TypeHandlerVersion { get; set; } + + /// + /// Gets or sets indicates whether the extension should use a newer + /// minor version if one is available at deployment time. Once + /// deployed, however, the extension will not upgrade minor versions + /// unless redeployed, even with this property set to true. + /// + [JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion { get; set; } + + /// + /// Gets or sets indicates whether the extension should be + /// automatically upgraded by the platform if there is a newer version + /// of the extension available. + /// + [JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")] + public bool? EnableAutomaticUpgrade { get; set; } + + /// + /// Gets or sets json formatted public settings for the extension. + /// + [JsonProperty(PropertyName = "properties.settings")] + public object Settings { get; set; } + + /// + /// Gets or sets the extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + [JsonProperty(PropertyName = "properties.protectedSettings")] + public object ProtectedSettings { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMExtensionsListResult.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMExtensionsListResult.cs new file mode 100644 index 000000000000..1057fee97b37 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMExtensionsListResult.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The List VMSS VM Extension operation response + /// + public partial class VirtualMachineScaleSetVMExtensionsListResult + { + /// + /// Initializes a new instance of the + /// VirtualMachineScaleSetVMExtensionsListResult class. + /// + public VirtualMachineScaleSetVMExtensionsListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// VirtualMachineScaleSetVMExtensionsListResult class. + /// + /// The list of VMSS VM extensions + public VirtualMachineScaleSetVMExtensionsListResult(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of VMSS VM extensions + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMProfile.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMProfile.cs index 0b95b2695cf3..ffa142b34ece 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMProfile.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetVMProfile.cs @@ -46,15 +46,17 @@ public VirtualMachineScaleSetVMProfile() /// for extensions installed on virtual machines in the scale /// set. /// Specifies that the image or disk that is - /// being used was licensed on-premises. This element is only used for - /// images that contain the Windows Server operating system. - /// <br><br> Possible values are: <br><br> - /// Windows_Client <br><br> Windows_Server - /// <br><br> If this element is included in a request for - /// an update, the value must match the initial value. This value - /// cannot be updated. <br><br> For more information, see - /// [Azure Hybrid Use Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) /// <br><br> Minimum api-version: 2015-06-15 /// Specifies the priority for the virtual /// machines in the scale set. <br><br>Minimum api-version: @@ -139,16 +141,19 @@ public VirtualMachineScaleSetVMProfile() /// /// Gets or sets specifies that the image or disk that is being used - /// was licensed on-premises. This element is only used for images that - /// contain the Windows Server operating system. - /// &lt;br&gt;&lt;br&gt; Possible values are: + /// was licensed on-premises. &lt;br&gt;&lt;br&gt; + /// Possible values for Windows Server operating system are: /// &lt;br&gt;&lt;br&gt; Windows_Client /// &lt;br&gt;&lt;br&gt; Windows_Server - /// &lt;br&gt;&lt;br&gt; If this element is included in - /// a request for an update, the value must match the initial value. - /// This value cannot be updated. &lt;br&gt;&lt;br&gt; - /// For more information, see [Azure Hybrid Use Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + /// &lt;br&gt;&lt;br&gt; Possible values for Linux + /// Server operating system are: &lt;br&gt;&lt;br&gt; + /// RHEL_BYOS (for RHEL) &lt;br&gt;&lt;br&gt; SLES_BYOS + /// (for SUSE) &lt;br&gt;&lt;br&gt; For more + /// information, see [Azure Hybrid Use Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// &lt;br&gt;&lt;br&gt; [Azure Hybrid Use Benefit for + /// Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) /// &lt;br&gt;&lt;br&gt; Minimum api-version: /// 2015-06-15 /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineUpdate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineUpdate.cs index 4704c63cde82..5a4f79543b84 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineUpdate.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineUpdate.cs @@ -115,15 +115,17 @@ public VirtualMachineUpdate() /// The virtual machine instance /// view. /// Specifies that the image or disk that is - /// being used was licensed on-premises. This element is only used for - /// images that contain the Windows Server operating system. - /// <br><br> Possible values are: <br><br> - /// Windows_Client <br><br> Windows_Server - /// <br><br> If this element is included in a request for - /// an update, the value must match the initial value. This value - /// cannot be updated. <br><br> For more information, see - /// [Azure Hybrid Use Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + /// being used was licensed on-premises. <br><br> Possible + /// values for Windows Server operating system are: + /// <br><br> Windows_Client <br><br> + /// Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for + /// RHEL) <br><br> SLES_BYOS (for SUSE) + /// <br><br> For more information, see [Azure Hybrid Use + /// Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) /// <br><br> Minimum api-version: 2015-06-15 /// Specifies the VM unique ID which is a 128-bits /// identifier that is encoded and stored in all Azure IaaS VMs SMBIOS @@ -341,16 +343,19 @@ public VirtualMachineUpdate() /// /// Gets or sets specifies that the image or disk that is being used - /// was licensed on-premises. This element is only used for images that - /// contain the Windows Server operating system. - /// &lt;br&gt;&lt;br&gt; Possible values are: + /// was licensed on-premises. &lt;br&gt;&lt;br&gt; + /// Possible values for Windows Server operating system are: /// &lt;br&gt;&lt;br&gt; Windows_Client /// &lt;br&gt;&lt;br&gt; Windows_Server - /// &lt;br&gt;&lt;br&gt; If this element is included in - /// a request for an update, the value must match the initial value. - /// This value cannot be updated. &lt;br&gt;&lt;br&gt; - /// For more information, see [Azure Hybrid Use Benefit for Windows - /// Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + /// &lt;br&gt;&lt;br&gt; Possible values for Linux + /// Server operating system are: &lt;br&gt;&lt;br&gt; + /// RHEL_BYOS (for RHEL) &lt;br&gt;&lt;br&gt; SLES_BYOS + /// (for SUSE) &lt;br&gt;&lt;br&gt; For more + /// information, see [Azure Hybrid Use Benefit for Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// &lt;br&gt;&lt;br&gt; [Azure Hybrid Use Benefit for + /// Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) /// &lt;br&gt;&lt;br&gt; Minimum api-version: /// 2015-06-15 /// diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs index 9094c86f8b99..17a208313f08 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs @@ -20,6 +20,10 @@ public static IEnumerable> ApiInfo_ComputeManageme return new Tuple[] { new Tuple("Compute", "AvailabilitySets", "2020-06-01"), + new Tuple("Compute", "CloudServiceRoleInstances", "2020-10-01-preview"), + new Tuple("Compute", "CloudServiceRoles", "2020-10-01-preview"), + new Tuple("Compute", "CloudServices", "2020-10-01-preview"), + new Tuple("Compute", "CloudServicesUpdateDomain", "2020-10-01-preview"), new Tuple("Compute", "DedicatedHostGroups", "2020-06-01"), new Tuple("Compute", "DedicatedHosts", "2020-06-01"), new Tuple("Compute", "DiskAccesses", "2020-06-30"), @@ -50,20 +54,8 @@ public static IEnumerable> ApiInfo_ComputeManageme new Tuple("Compute", "VirtualMachineScaleSets", "2020-06-01"), new Tuple("Compute", "VirtualMachineSizes", "2020-06-01"), new Tuple("Compute", "VirtualMachines", "2020-06-01"), - new Tuple("ContainerService", "ContainerServices", "2017-01-31"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=E:\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "1959aa63dd7a626aac36cc0e6b8c656dd2c1791d"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMExtensionsOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMExtensionsOperations.cs index 35fa17d315b3..0447703927e2 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMExtensionsOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMExtensionsOperations.cs @@ -74,10 +74,10 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -105,10 +105,10 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -179,7 +179,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -328,7 +328,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -341,7 +341,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -397,7 +397,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -540,7 +540,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -553,7 +553,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -611,7 +611,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -633,10 +633,6 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "extensionParameters"); } - if (extensionParameters != null) - { - extensionParameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -770,7 +766,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -783,7 +779,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -801,7 +797,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -859,7 +855,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1014,7 +1010,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1027,7 +1023,7 @@ internal VirtualMachineScaleSetVMExtensionsOperations(ComputeManagementClient cl _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMExtensionsOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMExtensionsOperationsExtensions.cs index be93828f8367..2bd9dea48e92 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMExtensionsOperationsExtensions.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetVMExtensionsOperationsExtensions.cs @@ -42,7 +42,7 @@ public static partial class VirtualMachineScaleSetVMExtensionsOperationsExtensio /// /// Parameters supplied to the Create Virtual Machine Extension operation. /// - public static VirtualMachineExtension CreateOrUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtension extensionParameters) + public static VirtualMachineScaleSetVMExtension CreateOrUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters) { return operations.CreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); } @@ -71,7 +71,7 @@ public static VirtualMachineExtension CreateOrUpdate(this IVirtualMachineScaleSe /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtension extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -100,7 +100,7 @@ public static VirtualMachineExtension CreateOrUpdate(this IVirtualMachineScaleSe /// /// Parameters supplied to the Update Virtual Machine Extension operation. /// - public static VirtualMachineExtension Update(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) + public static VirtualMachineScaleSetVMExtension Update(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { return operations.UpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); } @@ -129,7 +129,7 @@ public static VirtualMachineExtension Update(this IVirtualMachineScaleSetVMExten /// /// The cancellation token. /// - public static async Task UpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -207,7 +207,7 @@ public static void Delete(this IVirtualMachineScaleSetVMExtensionsOperations ope /// /// The expand expression to apply on the operation. /// - public static VirtualMachineExtension Get(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string)) + public static VirtualMachineScaleSetVMExtension Get(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string)) { return operations.GetAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand).GetAwaiter().GetResult(); } @@ -236,7 +236,7 @@ public static void Delete(this IVirtualMachineScaleSetVMExtensionsOperations ope /// /// The cancellation token. /// - public static async Task GetAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -263,7 +263,7 @@ public static void Delete(this IVirtualMachineScaleSetVMExtensionsOperations ope /// /// The expand expression to apply on the operation. /// - public static VirtualMachineExtensionsListResult List(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string)) + public static VirtualMachineScaleSetVMExtensionsListResult List(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string)) { return operations.ListAsync(resourceGroupName, vmScaleSetName, instanceId, expand).GetAwaiter().GetResult(); } @@ -290,7 +290,7 @@ public static void Delete(this IVirtualMachineScaleSetVMExtensionsOperations ope /// /// The cancellation token. /// - public static async Task ListAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, expand, null, cancellationToken).ConfigureAwait(false)) { @@ -319,7 +319,7 @@ public static void Delete(this IVirtualMachineScaleSetVMExtensionsOperations ope /// /// Parameters supplied to the Create Virtual Machine Extension operation. /// - public static VirtualMachineExtension BeginCreateOrUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtension extensionParameters) + public static VirtualMachineScaleSetVMExtension BeginCreateOrUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters) { return operations.BeginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); } @@ -348,7 +348,7 @@ public static VirtualMachineExtension BeginCreateOrUpdate(this IVirtualMachineSc /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtension extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtension extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { @@ -377,7 +377,7 @@ public static VirtualMachineExtension BeginCreateOrUpdate(this IVirtualMachineSc /// /// Parameters supplied to the Update Virtual Machine Extension operation. /// - public static VirtualMachineExtension BeginUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) + public static VirtualMachineScaleSetVMExtension BeginUpdate(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters) { return operations.BeginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters).GetAwaiter().GetResult(); } @@ -406,7 +406,7 @@ public static VirtualMachineExtension BeginUpdate(this IVirtualMachineScaleSetVM /// /// The cancellation token. /// - public static async Task BeginUpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateAsync(this IVirtualMachineScaleSetVMExtensionsOperations operations, string resourceGroupName, string vmScaleSetName, string instanceId, string vmExtensionName, VirtualMachineScaleSetVMExtensionUpdate extensionParameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperations.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperations.cs index 7c170b6402a6..6c241ff79b1e 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperations.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperations.cs @@ -329,16 +329,19 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The name of the virtual machine. /// + /// + /// Optional parameter to force delete virtual machines.(Feature in Preview) + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, forceDeletion, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -2804,6 +2807,9 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// The name of the virtual machine. /// + /// + /// Optional parameter to force delete virtual machines.(Feature in Preview) + /// /// /// Headers that will be added to request. /// @@ -2822,7 +2828,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2846,6 +2852,7 @@ internal VirtualMachinesOperations(ComputeManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmName", vmName); + tracingParameters.Add("forceDeletion", forceDeletion); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); @@ -2857,6 +2864,10 @@ internal VirtualMachinesOperations(ComputeManagementClient client) _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (forceDeletion != null) + { + _queryParameters.Add(string.Format("forceDeletion={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDeletion, Client.SerializationSettings).Trim('"')))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperationsExtensions.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperationsExtensions.cs index 495ef93f9b68..ff38e874b981 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperationsExtensions.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachinesOperationsExtensions.cs @@ -213,9 +213,12 @@ public static VirtualMachine Update(this IVirtualMachinesOperations operations, /// /// The name of the virtual machine. /// - public static void Delete(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + /// + /// Optional parameter to force delete virtual machines.(Feature in Preview) + /// + public static void Delete(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?)) { - operations.DeleteAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, vmName, forceDeletion).GetAwaiter().GetResult(); } /// @@ -230,12 +233,15 @@ public static void Delete(this IVirtualMachinesOperations operations, string res /// /// The name of the virtual machine. /// + /// + /// Optional parameter to force delete virtual machines.(Feature in Preview) + /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -1187,9 +1193,12 @@ public static VirtualMachine BeginUpdate(this IVirtualMachinesOperations operati /// /// The name of the virtual machine. /// - public static void BeginDelete(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName) + /// + /// Optional parameter to force delete virtual machines.(Feature in Preview) + /// + public static void BeginDelete(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?)) { - operations.BeginDeleteAsync(resourceGroupName, vmName).GetAwaiter().GetResult(); + operations.BeginDeleteAsync(resourceGroupName, vmName, forceDeletion).GetAwaiter().GetResult(); } /// @@ -1204,12 +1213,15 @@ public static void BeginDelete(this IVirtualMachinesOperations operations, strin /// /// The name of the virtual machine. /// + /// + /// Optional parameter to force delete virtual machines.(Feature in Preview) + /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool? forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose(); } ///