From cd96e806e6f2a5aa890c4bc2ee21c4db8e444d1d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 13 Jun 2024 04:25:37 +0000 Subject: [PATCH] CodeGen from PR 29408 in Azure/azure-rest-api-specs Merge eb8c29ae63110f8534f0c9cff91fedb8b0cf3750 into 412364b282e52b50eadc3cd88d56d283b6c8712a --- .../src/Generated/AddonsOperations.cs | 246 +- .../Generated/AddonsOperationsExtensions.cs | 86 +- .../src/Generated/AuthorizationsOperations.cs | 246 +- .../AuthorizationsOperationsExtensions.cs | 86 +- .../src/Generated/AvsClient.cs | 82 +- .../src/Generated/CloudLinksOperations.cs | 246 +- .../CloudLinksOperationsExtensions.cs | 86 +- .../src/Generated/ClustersOperations.cs | 545 +- .../Generated/ClustersOperationsExtensions.cs | 156 +- .../src/Generated/DatastoresOperations.cs | 282 +- .../DatastoresOperationsExtensions.cs | 102 +- .../GlobalReachConnectionsOperations.cs | 246 +- ...balReachConnectionsOperationsExtensions.cs | 86 +- .../Generated/HcxEnterpriseSitesOperations.cs | 182 +- .../HcxEnterpriseSitesOperationsExtensions.cs | 36 +- .../src/Generated/IAddonsOperations.cs | 54 +- .../Generated/IAuthorizationsOperations.cs | 57 +- .../src/Generated/IAvsClient.cs | 57 +- .../src/Generated/ICloudLinksOperations.cs | 54 +- .../src/Generated/IClustersOperations.cs | 102 +- .../src/Generated/IDatastoresOperations.cs | 62 +- .../IGlobalReachConnectionsOperations.cs | 54 +- .../IHcxEnterpriseSitesOperations.cs | 28 +- .../src/Generated/IIscsiPathsOperations.cs | 199 + .../src/Generated/ILocationsOperations.cs | 19 +- .../src/Generated/IOperations.cs | 8 +- .../Generated/IPlacementPoliciesOperations.cs | 93 +- .../src/Generated/IPrivateCloudsOperations.cs | 112 +- .../src/Generated/IScriptCmdletsOperations.cs | 22 +- .../Generated/IScriptExecutionsOperations.cs | 60 +- .../Generated/IScriptPackagesOperations.cs | 14 +- .../Generated/IVirtualMachinesOperations.cs | 40 +- .../Generated/IWorkloadNetworksOperations.cs | 904 +-- .../src/Generated/IscsiPathsOperations.cs | 1158 ++++ .../IscsiPathsOperationsExtensions.cs | 311 ++ .../src/Generated/LocationsOperations.cs | 108 +- .../LocationsOperationsExtensions.cs | 38 +- .../src/Generated/Models/ActionType.cs | 21 + .../src/Generated/Models/Addon.cs | 23 +- .../Generated/Models/AddonArcProperties.cs | 56 + .../Generated/Models/AddonHcxProperties.cs | 2 +- .../src/Generated/Models/AddonProperties.cs | 6 +- .../Models/AddonProvisioningState.cs | 22 + .../Generated/Models/AddonSrmProperties.cs | 2 +- .../src/Generated/Models/AddonType.cs | 24 + .../src/Generated/Models/AddonVrProperties.cs | 2 +- .../Models/AddonsCreateOrUpdateHeaders.cs | 56 + .../Generated/Models/AddonsDeleteHeaders.cs | 64 + .../src/Generated/Models/AffinityStrength.cs | 28 + .../src/Generated/Models/AffinityType.cs | 6 + .../AuthorizationsCreateOrUpdateHeaders.cs | 56 + .../Models/AuthorizationsDeleteHeaders.cs | 66 + .../Generated/Models/AvailabilityStrategy.cs | 6 + .../Generated/Models/AzureEntityResource.cs | 64 + .../Models/AzureHybridBenefitType.cs | 28 + .../src/Generated/Models/CloudLink.cs | 28 +- .../Models/CloudLinkProvisioningState.cs | 32 + .../src/Generated/Models/CloudLinkStatus.cs | 15 + .../Models/CloudLinksCreateOrUpdateHeaders.cs | 56 + .../Models/CloudLinksDeleteHeaders.cs | 64 + .../src/Generated/Models/Cluster.cs | 53 +- .../Models/ClusterProvisioningState.cs | 19 + .../src/Generated/Models/ClusterUpdate.cs | 25 +- .../src/Generated/Models/ClusterZone.cs | 62 + ...rationProperties.cs => ClusterZoneList.cs} | 25 +- .../Models/ClustersCreateOrUpdateHeaders.cs | 56 + .../Generated/Models/ClustersDeleteHeaders.cs | 64 + .../Generated/Models/ClustersUpdateHeaders.cs | 64 + .../Models/CommonClusterProperties.cs | 80 - .../src/Generated/Models/CreatedByType.cs | 24 + .../src/Generated/Models/Datastore.cs | 36 +- .../Models/DatastoreProvisioningState.cs | 25 + .../src/Generated/Models/DatastoreStatus.cs | 21 + .../Models/DatastoresCreateOrUpdateHeaders.cs | 56 + .../Models/DatastoresDeleteHeaders.cs | 64 + .../src/Generated/Models/DhcpTypeEnum.cs | 22 + .../src/Generated/Models/DiskPoolVolume.cs | 9 +- .../Models/DnsServiceLogLevelEnum.cs | 15 + .../Generated/Models/DnsServiceStatusEnum.cs | 6 + .../src/Generated/Models/DnsZoneType.cs | 28 + .../src/Generated/Models/ElasticSanVolume.cs | 66 + .../Generated/Models/EncryptionKeyStatus.cs | 6 + .../Models/EncryptionKeyVaultProperties.cs | 12 +- .../src/Generated/Models/EncryptionState.cs | 6 + .../Generated/Models/EncryptionVersionType.cs | 6 + .../src/Generated/Models/Endpoints.cs | 41 +- .../src/Generated/Models/ErrorDetail.cs | 85 + .../src/Generated/Models/ErrorResponse.cs | 50 +- .../Models/ErrorResponseException.cs | 62 + .../Models/ExpressRouteAuthorization.cs | 25 +- ...ressRouteAuthorizationProvisioningState.cs | 13 + .../Generated/Models/GlobalReachConnection.cs | 44 +- .../GlobalReachConnectionProvisioningState.cs | 13 + .../Models/GlobalReachConnectionStatus.cs | 9 + ...alReachConnectionsCreateOrUpdateHeaders.cs | 56 + .../GlobalReachConnectionsDeleteHeaders.cs | 66 + .../src/Generated/Models/HcxEnterpriseSite.cs | 28 +- .../HcxEnterpriseSiteProvisioningState.cs | 32 + .../Models/HcxEnterpriseSiteStatus.cs | 12 + .../src/Generated/Models/Identity.cs | 72 + .../src/Generated/Models/IdentitySource.cs | 13 +- .../src/Generated/Models/InternetEnum.cs | 6 + .../src/Generated/Models/IscsiPath.cs | 88 + .../Models/IscsiPathProvisioningState.cs | 48 + .../Models/IscsiPathsCreateOrUpdateHeaders.cs | 56 + .../Models/IscsiPathsDeleteHeaders.cs | 64 + .../src/Generated/Models/LogSpecification.cs | 68 - .../src/Generated/Models/ManagementCluster.cs | 47 +- .../src/Generated/Models/MetricDimension.cs | 80 - .../Generated/Models/MetricSpecification.cs | 164 - .../src/Generated/Models/MountOptionEnum.cs | 6 + .../Models/NsxPublicIpQuotaRaisedEnum.cs | 28 + .../src/Generated/Models/Operation.cs | 72 +- .../src/Generated/Models/OperationDisplay.cs | 37 +- .../src/Generated/Models/OptionalParamEnum.cs | 6 + .../src/Generated/Models/Origin.cs | 23 + .../PlacementPoliciesCreateOrUpdateHeaders.cs | 56 + .../Models/PlacementPoliciesDeleteHeaders.cs | 66 + .../Models/PlacementPoliciesUpdateHeaders.cs | 66 + .../src/Generated/Models/PlacementPolicy.cs | 22 +- .../Models/PlacementPolicyProperties.cs | 6 +- .../PlacementPolicyProvisioningState.cs | 19 + .../Generated/Models/PlacementPolicyState.cs | 6 + .../Generated/Models/PlacementPolicyType.cs | 22 + .../Generated/Models/PlacementPolicyUpdate.cs | 24 +- .../src/Generated/Models/Plan.cs | 116 + .../Models/PortMirroringDirectionEnum.cs | 9 + .../Models/PortMirroringStatusEnum.cs | 6 + .../src/Generated/Models/PrivateCloud.cs | 146 +- .../Generated/Models/PrivateCloudIdentity.cs | 79 - .../Models/PrivateCloudProvisioningState.cs | 25 + .../Generated/Models/PrivateCloudUpdate.cs | 76 +- .../PrivateCloudsCreateOrUpdateHeaders.cs | 56 + .../Models/PrivateCloudsDeleteHeaders.cs | 64 + .../PrivateCloudsRotateNsxtPasswordHeaders.cs | 66 + ...ivateCloudsRotateVcenterPasswordHeaders.cs | 66 + .../Models/PrivateCloudsUpdateHeaders.cs | 64 + .../src/Generated/Models/ProxyResource.cs | 21 +- .../src/Generated/Models/QuotaEnabled.cs | 6 + .../src/Generated/Models/Resource.cs | 36 +- .../Generated/Models/ResourceIdentityType.cs | 38 +- .../ResourceModelWithAllowedPropertySet.cs | 141 + ...urceModelWithAllowedPropertySetIdentity.cs | 48 + ...ResourceModelWithAllowedPropertySetPlan.cs | 63 + .../ResourceModelWithAllowedPropertySetSku.cs | 64 + .../src/Generated/Models/ScriptCmdlet.cs | 38 +- .../Generated/Models/ScriptCmdletAudience.cs | 28 + .../Models/ScriptCmdletProvisioningState.cs | 32 + .../src/Generated/Models/ScriptExecution.cs | 36 +- .../Models/ScriptExecutionParameterType.cs | 23 + .../ScriptExecutionProvisioningState.cs | 29 +- .../ScriptExecutionsCreateOrUpdateHeaders.cs | 56 + .../Models/ScriptExecutionsDeleteHeaders.cs | 66 + .../Models/ScriptOutputStreamType.cs | 12 + .../src/Generated/Models/ScriptPackage.cs | 43 +- .../Models/ScriptPackageProvisioningState.cs | 32 + .../src/Generated/Models/ScriptParameter.cs | 18 +- .../Generated/Models/ScriptParameterTypes.cs | 18 + .../src/Generated/Models/SegmentStatusEnum.cs | 6 + .../Generated/Models/ServiceSpecification.cs | 63 - .../src/Generated/Models/Sku.cs | 51 +- .../src/Generated/Models/SkuTier.cs | 72 + .../src/Generated/Models/SslEnum.cs | 6 + .../Models/SystemAssignedServiceIdentity.cs | 90 + .../SystemAssignedServiceIdentityType.cs | 22 + .../src/Generated/Models/SystemData.cs | 103 + .../src/Generated/Models/TrackedResource.cs | 52 +- .../src/Generated/Models/TrialStatus.cs | 9 + .../src/Generated/Models/VMGroupStatusEnum.cs | 6 + .../src/Generated/Models/VMTypeEnum.cs | 9 + .../src/Generated/Models/VirtualMachine.cs | 34 +- .../Models/VirtualMachineProvisioningState.cs | 32 + .../Models/VirtualMachineRestrictMovement.cs | 8 +- .../VirtualMachineRestrictMovementState.cs | 6 + .../VirtualMachinesRestrictMovementHeaders.cs | 66 + .../Models/VisibilityParameterEnum.cs | 6 + .../Models/VmHostPlacementPolicyProperties.cs | 28 +- .../Models/VmVmPlacementPolicyProperties.cs | 4 +- .../src/Generated/Models/WorkloadNetwork.cs | 67 + .../Generated/Models/WorkloadNetworkDhcp.cs | 20 +- .../Models/WorkloadNetworkDhcpEntity.cs | 9 +- .../Models/WorkloadNetworkDhcpEntityUpdate.cs | 63 + .../WorkloadNetworkDhcpProvisioningState.cs | 19 + .../Models/WorkloadNetworkDhcpRelay.cs | 4 +- .../Models/WorkloadNetworkDhcpRelayUpdate.cs | 80 + .../Models/WorkloadNetworkDhcpServer.cs | 4 +- .../Models/WorkloadNetworkDhcpServerUpdate.cs | 65 + .../Models/WorkloadNetworkDhcpUpdate.cs | 52 + .../Models/WorkloadNetworkDnsService.cs | 21 +- ...kloadNetworkDnsServiceProvisioningState.cs | 19 + .../Models/WorkloadNetworkDnsServiceUpdate.cs | 123 + .../Models/WorkloadNetworkDnsZone.cs | 23 +- ...WorkloadNetworkDnsZoneProvisioningState.cs | 19 + .../Models/WorkloadNetworkDnsZoneUpdate.cs | 111 + .../Models/WorkloadNetworkGateway.cs | 27 +- .../Models/WorkloadNetworkPortMirroring.cs | 21 +- ...adNetworkPortMirroringProvisioningState.cs | 19 + .../WorkloadNetworkPortMirroringUpdate.cs | 113 + .../WorkloadNetworkProvisioningState.cs | 44 + .../Models/WorkloadNetworkPublicIP.cs | 21 +- ...orkloadNetworkPublicIPProvisioningState.cs | 19 + .../Models/WorkloadNetworkSegment.cs | 21 +- ...WorkloadNetworkSegmentProvisioningState.cs | 19 + .../Models/WorkloadNetworkSegmentUpdate.cs | 112 + .../Models/WorkloadNetworkVMGroup.cs | 21 +- ...WorkloadNetworkVMGroupProvisioningState.cs | 19 + .../Models/WorkloadNetworkVMGroupUpdate.cs | 95 + .../Models/WorkloadNetworkVirtualMachine.cs | 27 +- .../WorkloadNetworksCreateDhcpHeaders.cs | 56 + ...WorkloadNetworksCreateDnsServiceHeaders.cs | 56 + .../WorkloadNetworksCreateDnsZoneHeaders.cs | 56 + ...kloadNetworksCreatePortMirroringHeaders.cs | 56 + .../WorkloadNetworksCreatePublicIPHeaders.cs | 56 + .../WorkloadNetworksCreateSegmentsHeaders.cs | 56 + .../WorkloadNetworksCreateVMGroupHeaders.cs | 56 + .../WorkloadNetworksDeleteDhcpHeaders.cs | 66 + ...WorkloadNetworksDeleteDnsServiceHeaders.cs | 66 + .../WorkloadNetworksDeleteDnsZoneHeaders.cs | 66 + ...kloadNetworksDeletePortMirroringHeaders.cs | 66 + .../WorkloadNetworksDeletePublicIPHeaders.cs | 66 + .../WorkloadNetworksDeleteSegmentHeaders.cs | 66 + .../WorkloadNetworksDeleteVMGroupHeaders.cs | 66 + .../WorkloadNetworksUpdateDhcpHeaders.cs | 66 + ...WorkloadNetworksUpdateDnsServiceHeaders.cs | 66 + .../WorkloadNetworksUpdateDnsZoneHeaders.cs | 66 + ...kloadNetworksUpdatePortMirroringHeaders.cs | 66 + .../WorkloadNetworksUpdateSegmentsHeaders.cs | 66 + .../WorkloadNetworksUpdateVMGroupHeaders.cs | 66 + .../src/Generated/Operations.cs | 26 +- .../src/Generated/OperationsExtensions.cs | 8 +- .../Generated/PlacementPoliciesOperations.cs | 381 +- .../PlacementPoliciesOperationsExtensions.cs | 148 +- .../src/Generated/PrivateCloudsOperations.cs | 602 +- .../PrivateCloudsOperationsExtensions.cs | 196 +- .../src/Generated/ScriptCmdletsOperations.cs | 114 +- .../ScriptCmdletsOperationsExtensions.cs | 32 +- .../Generated/ScriptExecutionsOperations.cs | 290 +- .../ScriptExecutionsOperationsExtensions.cs | 94 +- .../src/Generated/ScriptPackagesOperations.cs | 92 +- .../ScriptPackagesOperationsExtensions.cs | 16 +- .../SdkInfo_AzureVMwareSolutionAPI.cs | 44 +- .../Generated/VirtualMachinesOperations.cs | 202 +- .../VirtualMachinesOperationsExtensions.cs | 70 +- .../Generated/WorkloadNetworksOperations.cs | 4957 ++++++++++------- .../WorkloadNetworksOperationsExtensions.cs | 1700 +++--- 245 files changed, 16191 insertions(+), 7147 deletions(-) create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IIscsiPathsOperations.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IscsiPathsOperations.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IscsiPathsOperationsExtensions.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ActionType.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonArcProperties.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonType.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonsCreateOrUpdateHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonsDeleteHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AffinityStrength.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AuthorizationsCreateOrUpdateHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AuthorizationsDeleteHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AzureEntityResource.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AzureHybridBenefitType.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinkProvisioningState.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinksCreateOrUpdateHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinksDeleteHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterZone.cs rename sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/{OperationProperties.cs => ClusterZoneList.cs} (55%) create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClustersCreateOrUpdateHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClustersDeleteHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClustersUpdateHeaders.cs delete mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CommonClusterProperties.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CreatedByType.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoresCreateOrUpdateHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoresDeleteHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DhcpTypeEnum.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DnsZoneType.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ElasticSanVolume.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ErrorDetail.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ErrorResponseException.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionsCreateOrUpdateHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionsDeleteHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/HcxEnterpriseSiteProvisioningState.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Identity.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPath.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPathProvisioningState.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPathsCreateOrUpdateHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPathsDeleteHeaders.cs delete mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/LogSpecification.cs delete mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/MetricDimension.cs delete mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/MetricSpecification.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/NsxPublicIpQuotaRaisedEnum.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Origin.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPoliciesCreateOrUpdateHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPoliciesDeleteHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPoliciesUpdateHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyType.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Plan.cs delete mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudIdentity.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsCreateOrUpdateHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsDeleteHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsRotateNsxtPasswordHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsRotateVcenterPasswordHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsUpdateHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptCmdletAudience.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptCmdletProvisioningState.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionParameterType.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionsCreateOrUpdateHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionsDeleteHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptPackageProvisioningState.cs delete mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ServiceSpecification.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SkuTier.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SystemAssignedServiceIdentity.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SystemAssignedServiceIdentityType.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SystemData.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineProvisioningState.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachinesRestrictMovementHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetwork.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpEntityUpdate.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpRelayUpdate.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpServerUpdate.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpUpdate.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsServiceUpdate.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsZoneUpdate.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroringUpdate.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkProvisioningState.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegmentUpdate.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroupUpdate.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateDhcpHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateDnsServiceHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateDnsZoneHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreatePortMirroringHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreatePublicIPHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateSegmentsHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateVMGroupHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteDhcpHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteDnsServiceHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteDnsZoneHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeletePortMirroringHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeletePublicIPHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteSegmentHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteVMGroupHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateDhcpHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateDnsServiceHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateDnsZoneHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdatePortMirroringHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateSegmentsHeaders.cs create mode 100644 sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateVMGroupHeaders.cs diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AddonsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AddonsOperations.cs index 8fdcc3d318940..2a1dabf2fd79e 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AddonsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AddonsOperations.cs @@ -51,7 +51,7 @@ internal AddonsOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List addons in a private cloud + /// List Addon resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -65,7 +65,7 @@ internal AddonsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,15 +82,15 @@ internal AddonsOperations(AvsClient client) /// public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -112,15 +112,11 @@ internal AddonsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -138,7 +134,7 @@ internal AddonsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -206,14 +202,13 @@ internal AddonsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -223,10 +218,6 @@ internal AddonsOperations(AvsClient client) } 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); @@ -272,7 +263,7 @@ internal AddonsOperations(AvsClient client) } /// - /// Get an addon by name in a private cloud + /// Get a Addon /// /// /// The name of the resource group. The name is case insensitive. @@ -281,7 +272,7 @@ internal AddonsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// /// Headers that will be added to request. @@ -289,7 +280,7 @@ internal AddonsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -306,15 +297,15 @@ internal AddonsOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -336,19 +327,22 @@ internal AddonsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (addonName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "addonName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (addonName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "addonName"); } - if (Client.ApiVersion != null) + if (addonName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(addonName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "addonName", "^[-\\w\\._]+$"); } } // Tracing @@ -367,7 +361,7 @@ internal AddonsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{addonName}", System.Uri.EscapeDataString(addonName)); @@ -436,14 +430,13 @@ internal AddonsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -453,10 +446,6 @@ internal AddonsOperations(AvsClient client) } 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); @@ -502,19 +491,19 @@ internal AddonsOperations(AvsClient client) } /// - /// Create or update a addon in a private cloud + /// Create a Addon /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// - /// A addon in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -522,15 +511,15 @@ internal AddonsOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Addon addon, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Addon addon, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, addonName, addon, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, addonName, addon, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a addon in a private cloud + /// Delete a Addon /// /// /// The name of the resource group. The name is case insensitive. @@ -539,7 +528,7 @@ internal AddonsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// /// The headers that will be added to request. @@ -547,27 +536,27 @@ internal AddonsOperations(AvsClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, addonName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, addonName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update a addon in a private cloud + /// Create a Addon /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// - /// A addon in the private cloud + /// Resource create parameters. /// /// /// Headers that will be added to request. @@ -575,7 +564,7 @@ internal AddonsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -590,17 +579,17 @@ internal AddonsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Addon addon, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Addon addon, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -622,25 +611,28 @@ internal AddonsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (addonName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "addonName"); - } - if (addon == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "addon"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (addonName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "addonName"); } - if (Client.ApiVersion != null) + if (addonName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(addonName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "addonName", "^[-\\w\\._]+$"); } } + if (addon == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "addon"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -658,7 +650,7 @@ internal AddonsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{addonName}", System.Uri.EscapeDataString(addonName)); @@ -733,14 +725,13 @@ internal AddonsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -750,10 +741,6 @@ internal AddonsOperations(AvsClient client) } 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); @@ -766,7 +753,7 @@ internal AddonsOperations(AvsClient 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")) @@ -809,6 +796,19 @@ internal AddonsOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -817,7 +817,7 @@ internal AddonsOperations(AvsClient client) } /// - /// Delete a addon in a private cloud + /// Delete a Addon /// /// /// The name of the resource group. The name is case insensitive. @@ -826,7 +826,7 @@ internal AddonsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// /// Headers that will be added to request. @@ -834,7 +834,7 @@ internal AddonsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -846,17 +846,17 @@ internal AddonsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -878,19 +878,22 @@ internal AddonsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (addonName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "addonName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (addonName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "addonName"); } - if (Client.ApiVersion != null) + if (addonName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(addonName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "addonName", "^[-\\w\\._]+$"); } } // Tracing @@ -909,7 +912,7 @@ internal AddonsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{addonName}", System.Uri.EscapeDataString(addonName)); @@ -978,14 +981,13 @@ internal AddonsOperations(AvsClient client) 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)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -995,10 +997,6 @@ internal AddonsOperations(AvsClient client) } 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); @@ -1011,13 +1009,26 @@ internal AddonsOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1026,7 +1037,7 @@ internal AddonsOperations(AvsClient client) } /// - /// List addons in a private cloud + /// List Addon resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -1037,7 +1048,7 @@ internal AddonsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1133,14 +1144,13 @@ internal AddonsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1150,10 +1160,6 @@ internal AddonsOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AddonsOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AddonsOperationsExtensions.cs index 52be9d23a4c45..cb9a28563d897 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AddonsOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AddonsOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class AddonsOperationsExtensions { /// - /// List addons in a private cloud + /// List Addon resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -39,7 +39,7 @@ public static IPage List(this IAddonsOperations operations, string resour } /// - /// List addons in a private cloud + /// List Addon resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -62,7 +62,7 @@ public static IPage List(this IAddonsOperations operations, string resour } /// - /// Get an addon by name in a private cloud + /// Get a Addon /// /// /// The operations group for this extension method. @@ -74,7 +74,7 @@ public static IPage List(this IAddonsOperations operations, string resour /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// public static Addon Get(this IAddonsOperations operations, string resourceGroupName, string privateCloudName, string addonName) { @@ -82,7 +82,7 @@ public static Addon Get(this IAddonsOperations operations, string resourceGroupN } /// - /// Get an addon by name in a private cloud + /// Get a Addon /// /// /// The operations group for this extension method. @@ -94,7 +94,7 @@ public static Addon Get(this IAddonsOperations operations, string resourceGroupN /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// /// The cancellation token. @@ -108,7 +108,7 @@ public static Addon Get(this IAddonsOperations operations, string resourceGroupN } /// - /// Create or update a addon in a private cloud + /// Create a Addon /// /// /// The operations group for this extension method. @@ -117,13 +117,13 @@ public static Addon Get(this IAddonsOperations operations, string resourceGroupN /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// - /// A addon in the private cloud + /// Resource create parameters. /// public static Addon CreateOrUpdate(this IAddonsOperations operations, string resourceGroupName, string privateCloudName, string addonName, Addon addon) { @@ -131,7 +131,7 @@ public static Addon CreateOrUpdate(this IAddonsOperations operations, string res } /// - /// Create or update a addon in a private cloud + /// Create a Addon /// /// /// The operations group for this extension method. @@ -140,13 +140,13 @@ public static Addon CreateOrUpdate(this IAddonsOperations operations, string res /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// - /// A addon in the private cloud + /// Resource create parameters. /// /// /// The cancellation token. @@ -160,7 +160,7 @@ public static Addon CreateOrUpdate(this IAddonsOperations operations, string res } /// - /// Delete a addon in a private cloud + /// Delete a Addon /// /// /// The operations group for this extension method. @@ -172,15 +172,15 @@ public static Addon CreateOrUpdate(this IAddonsOperations operations, string res /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// - public static void Delete(this IAddonsOperations operations, string resourceGroupName, string privateCloudName, string addonName) + public static AddonsDeleteHeaders Delete(this IAddonsOperations operations, string resourceGroupName, string privateCloudName, string addonName) { - operations.DeleteAsync(resourceGroupName, privateCloudName, addonName).GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, privateCloudName, addonName).GetAwaiter().GetResult(); } /// - /// Delete a addon in a private cloud + /// Delete a Addon /// /// /// The operations group for this extension method. @@ -192,18 +192,21 @@ public static void Delete(this IAddonsOperations operations, string resourceGrou /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IAddonsOperations operations, string resourceGroupName, string privateCloudName, string addonName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IAddonsOperations operations, string resourceGroupName, string privateCloudName, string addonName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, addonName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, addonName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create or update a addon in a private cloud + /// Create a Addon /// /// /// The operations group for this extension method. @@ -212,13 +215,13 @@ public static void Delete(this IAddonsOperations operations, string resourceGrou /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// - /// A addon in the private cloud + /// Resource create parameters. /// public static Addon BeginCreateOrUpdate(this IAddonsOperations operations, string resourceGroupName, string privateCloudName, string addonName, Addon addon) { @@ -226,7 +229,7 @@ public static Addon BeginCreateOrUpdate(this IAddonsOperations operations, strin } /// - /// Create or update a addon in a private cloud + /// Create a Addon /// /// /// The operations group for this extension method. @@ -235,13 +238,13 @@ public static Addon BeginCreateOrUpdate(this IAddonsOperations operations, strin /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// - /// A addon in the private cloud + /// Resource create parameters. /// /// /// The cancellation token. @@ -255,7 +258,7 @@ public static Addon BeginCreateOrUpdate(this IAddonsOperations operations, strin } /// - /// Delete a addon in a private cloud + /// Delete a Addon /// /// /// The operations group for this extension method. @@ -267,15 +270,15 @@ public static Addon BeginCreateOrUpdate(this IAddonsOperations operations, strin /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// - public static void BeginDelete(this IAddonsOperations operations, string resourceGroupName, string privateCloudName, string addonName) + public static AddonsDeleteHeaders BeginDelete(this IAddonsOperations operations, string resourceGroupName, string privateCloudName, string addonName) { - operations.BeginDeleteAsync(resourceGroupName, privateCloudName, addonName).GetAwaiter().GetResult(); + return operations.BeginDeleteAsync(resourceGroupName, privateCloudName, addonName).GetAwaiter().GetResult(); } /// - /// Delete a addon in a private cloud + /// Delete a Addon /// /// /// The operations group for this extension method. @@ -287,18 +290,21 @@ public static void BeginDelete(this IAddonsOperations operations, string resourc /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IAddonsOperations operations, string resourceGroupName, string privateCloudName, string addonName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IAddonsOperations operations, string resourceGroupName, string privateCloudName, string addonName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, addonName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, addonName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List addons in a private cloud + /// List Addon resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -312,7 +318,7 @@ public static IPage ListNext(this IAddonsOperations operations, string ne } /// - /// List addons in a private cloud + /// List Addon resources by PrivateCloud /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperations.cs index 54c167fb0ee5c..b3afcba16ba5b 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperations.cs @@ -51,7 +51,7 @@ internal AuthorizationsOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List ExpressRoute Circuit Authorizations in a private cloud + /// List ExpressRouteAuthorization resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -65,7 +65,7 @@ internal AuthorizationsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,15 +82,15 @@ internal AuthorizationsOperations(AvsClient client) /// public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -112,15 +112,11 @@ internal AuthorizationsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -138,7 +134,7 @@ internal AuthorizationsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -206,14 +202,13 @@ internal AuthorizationsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -223,10 +218,6 @@ internal AuthorizationsOperations(AvsClient client) } 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); @@ -272,7 +263,7 @@ internal AuthorizationsOperations(AvsClient client) } /// - /// Get an ExpressRoute Circuit Authorization by name in a private cloud + /// Get a ExpressRouteAuthorization /// /// /// The name of the resource group. The name is case insensitive. @@ -281,7 +272,7 @@ internal AuthorizationsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// /// Headers that will be added to request. @@ -289,7 +280,7 @@ internal AuthorizationsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -306,15 +297,15 @@ internal AuthorizationsOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -336,19 +327,22 @@ internal AuthorizationsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (authorizationName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (authorizationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); } - if (Client.ApiVersion != null) + if (authorizationName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(authorizationName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "authorizationName", "^[-\\w\\._]+$"); } } // Tracing @@ -367,7 +361,7 @@ internal AuthorizationsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); @@ -436,14 +430,13 @@ internal AuthorizationsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -453,10 +446,6 @@ internal AuthorizationsOperations(AvsClient client) } 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); @@ -502,19 +491,19 @@ internal AuthorizationsOperations(AvsClient client) } /// - /// Create or update an ExpressRoute Circuit Authorization in a private cloud + /// Create a ExpressRouteAuthorization /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// - /// An ExpressRoute Circuit Authorization + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -522,15 +511,15 @@ internal AuthorizationsOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, authorization, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, authorization, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete an ExpressRoute Circuit Authorization in a private cloud + /// Delete a ExpressRouteAuthorization /// /// /// The name of the resource group. The name is case insensitive. @@ -539,7 +528,7 @@ internal AuthorizationsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// /// The headers that will be added to request. @@ -547,27 +536,27 @@ internal AuthorizationsOperations(AvsClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update an ExpressRoute Circuit Authorization in a private cloud + /// Create a ExpressRouteAuthorization /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// - /// An ExpressRoute Circuit Authorization + /// Resource create parameters. /// /// /// Headers that will be added to request. @@ -575,7 +564,7 @@ internal AuthorizationsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -590,17 +579,17 @@ internal AuthorizationsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -622,25 +611,28 @@ internal AuthorizationsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (authorizationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); - } - if (authorization == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorization"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (authorizationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); } - if (Client.ApiVersion != null) + if (authorizationName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(authorizationName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "authorizationName", "^[-\\w\\._]+$"); } } + if (authorization == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorization"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -658,7 +650,7 @@ internal AuthorizationsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); @@ -733,14 +725,13 @@ internal AuthorizationsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -750,10 +741,6 @@ internal AuthorizationsOperations(AvsClient client) } 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); @@ -766,7 +753,7 @@ internal AuthorizationsOperations(AvsClient 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")) @@ -809,6 +796,19 @@ internal AuthorizationsOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -817,7 +817,7 @@ internal AuthorizationsOperations(AvsClient client) } /// - /// Delete an ExpressRoute Circuit Authorization in a private cloud + /// Delete a ExpressRouteAuthorization /// /// /// The name of the resource group. The name is case insensitive. @@ -826,7 +826,7 @@ internal AuthorizationsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// /// Headers that will be added to request. @@ -834,7 +834,7 @@ internal AuthorizationsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -846,17 +846,17 @@ internal AuthorizationsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -878,19 +878,22 @@ internal AuthorizationsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (authorizationName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (authorizationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); } - if (Client.ApiVersion != null) + if (authorizationName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(authorizationName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "authorizationName", "^[-\\w\\._]+$"); } } // Tracing @@ -909,7 +912,7 @@ internal AuthorizationsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); @@ -978,14 +981,13 @@ internal AuthorizationsOperations(AvsClient client) 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)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -995,10 +997,6 @@ internal AuthorizationsOperations(AvsClient client) } 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); @@ -1011,13 +1009,26 @@ internal AuthorizationsOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1026,7 +1037,7 @@ internal AuthorizationsOperations(AvsClient client) } /// - /// List ExpressRoute Circuit Authorizations in a private cloud + /// List ExpressRouteAuthorization resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -1037,7 +1048,7 @@ internal AuthorizationsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1133,14 +1144,13 @@ internal AuthorizationsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1150,10 +1160,6 @@ internal AuthorizationsOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperationsExtensions.cs index 72d69e7c3ce84..bc78a76c33db7 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AuthorizationsOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class AuthorizationsOperationsExtensions { /// - /// List ExpressRoute Circuit Authorizations in a private cloud + /// List ExpressRouteAuthorization resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -39,7 +39,7 @@ public static IPage List(this IAuthorizationsOperatio } /// - /// List ExpressRoute Circuit Authorizations in a private cloud + /// List ExpressRouteAuthorization resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -62,7 +62,7 @@ public static IPage List(this IAuthorizationsOperatio } /// - /// Get an ExpressRoute Circuit Authorization by name in a private cloud + /// Get a ExpressRouteAuthorization /// /// /// The operations group for this extension method. @@ -74,7 +74,7 @@ public static IPage List(this IAuthorizationsOperatio /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// public static ExpressRouteAuthorization Get(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName) { @@ -82,7 +82,7 @@ public static ExpressRouteAuthorization Get(this IAuthorizationsOperations opera } /// - /// Get an ExpressRoute Circuit Authorization by name in a private cloud + /// Get a ExpressRouteAuthorization /// /// /// The operations group for this extension method. @@ -94,7 +94,7 @@ public static ExpressRouteAuthorization Get(this IAuthorizationsOperations opera /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// /// The cancellation token. @@ -108,7 +108,7 @@ public static ExpressRouteAuthorization Get(this IAuthorizationsOperations opera } /// - /// Create or update an ExpressRoute Circuit Authorization in a private cloud + /// Create a ExpressRouteAuthorization /// /// /// The operations group for this extension method. @@ -117,13 +117,13 @@ public static ExpressRouteAuthorization Get(this IAuthorizationsOperations opera /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// - /// An ExpressRoute Circuit Authorization + /// Resource create parameters. /// public static ExpressRouteAuthorization CreateOrUpdate(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization) { @@ -131,7 +131,7 @@ public static ExpressRouteAuthorization CreateOrUpdate(this IAuthorizationsOpera } /// - /// Create or update an ExpressRoute Circuit Authorization in a private cloud + /// Create a ExpressRouteAuthorization /// /// /// The operations group for this extension method. @@ -140,13 +140,13 @@ public static ExpressRouteAuthorization CreateOrUpdate(this IAuthorizationsOpera /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// - /// An ExpressRoute Circuit Authorization + /// Resource create parameters. /// /// /// The cancellation token. @@ -160,7 +160,7 @@ public static ExpressRouteAuthorization CreateOrUpdate(this IAuthorizationsOpera } /// - /// Delete an ExpressRoute Circuit Authorization in a private cloud + /// Delete a ExpressRouteAuthorization /// /// /// The operations group for this extension method. @@ -172,15 +172,15 @@ public static ExpressRouteAuthorization CreateOrUpdate(this IAuthorizationsOpera /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// - public static void Delete(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName) + public static AuthorizationsDeleteHeaders Delete(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName) { - operations.DeleteAsync(resourceGroupName, privateCloudName, authorizationName).GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, privateCloudName, authorizationName).GetAwaiter().GetResult(); } /// - /// Delete an ExpressRoute Circuit Authorization in a private cloud + /// Delete a ExpressRouteAuthorization /// /// /// The operations group for this extension method. @@ -192,18 +192,21 @@ public static void Delete(this IAuthorizationsOperations operations, string reso /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create or update an ExpressRoute Circuit Authorization in a private cloud + /// Create a ExpressRouteAuthorization /// /// /// The operations group for this extension method. @@ -212,13 +215,13 @@ public static void Delete(this IAuthorizationsOperations operations, string reso /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// - /// An ExpressRoute Circuit Authorization + /// Resource create parameters. /// public static ExpressRouteAuthorization BeginCreateOrUpdate(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization) { @@ -226,7 +229,7 @@ public static ExpressRouteAuthorization BeginCreateOrUpdate(this IAuthorizations } /// - /// Create or update an ExpressRoute Circuit Authorization in a private cloud + /// Create a ExpressRouteAuthorization /// /// /// The operations group for this extension method. @@ -235,13 +238,13 @@ public static ExpressRouteAuthorization BeginCreateOrUpdate(this IAuthorizations /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// - /// An ExpressRoute Circuit Authorization + /// Resource create parameters. /// /// /// The cancellation token. @@ -255,7 +258,7 @@ public static ExpressRouteAuthorization BeginCreateOrUpdate(this IAuthorizations } /// - /// Delete an ExpressRoute Circuit Authorization in a private cloud + /// Delete a ExpressRouteAuthorization /// /// /// The operations group for this extension method. @@ -267,15 +270,15 @@ public static ExpressRouteAuthorization BeginCreateOrUpdate(this IAuthorizations /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// - public static void BeginDelete(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName) + public static AuthorizationsDeleteHeaders BeginDelete(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName) { - operations.BeginDeleteAsync(resourceGroupName, privateCloudName, authorizationName).GetAwaiter().GetResult(); + return operations.BeginDeleteAsync(resourceGroupName, privateCloudName, authorizationName).GetAwaiter().GetResult(); } /// - /// Delete an ExpressRoute Circuit Authorization in a private cloud + /// Delete a ExpressRouteAuthorization /// /// /// The operations group for this extension method. @@ -287,18 +290,21 @@ public static void BeginDelete(this IAuthorizationsOperations operations, string /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IAuthorizationsOperations operations, string resourceGroupName, string privateCloudName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, authorizationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List ExpressRoute Circuit Authorizations in a private cloud + /// List ExpressRouteAuthorization resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -312,7 +318,7 @@ public static IPage ListNext(this IAuthorizationsOper } /// - /// List ExpressRoute Circuit Authorizations in a private cloud + /// List ExpressRouteAuthorization resources by PrivateCloud /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AvsClient.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AvsClient.cs index 7a769ff600af6..61d97014c4b01 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AvsClient.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/AvsClient.cs @@ -47,14 +47,14 @@ public partial class AvsClient : ServiceClient, IAvsClient, IAzureCli public ServiceClientCredentials Credentials { get; private set; } /// - /// The API version to use for this operation. + /// The ID of the target subscription. The value must be an UUID. /// - public string ApiVersion { get; private set; } + public System.Guid SubscriptionId { get; set; } /// - /// The ID of the target subscription. + /// The API version to use for this operation. /// - public string SubscriptionId { get; set; } + public string ApiVersion { get; private set; } /// /// The preferred language for the response. @@ -90,54 +90,59 @@ public partial class AvsClient : ServiceClient, IAvsClient, IAzureCli public virtual IPrivateCloudsOperations PrivateClouds { get; private set; } /// - /// Gets the IClustersOperations. + /// Gets the IAddonsOperations. /// - public virtual IClustersOperations Clusters { get; private set; } + public virtual IAddonsOperations Addons { get; private set; } /// - /// Gets the IDatastoresOperations. + /// Gets the IAuthorizationsOperations. /// - public virtual IDatastoresOperations Datastores { get; private set; } + public virtual IAuthorizationsOperations Authorizations { get; private set; } /// - /// Gets the IHcxEnterpriseSitesOperations. + /// Gets the ICloudLinksOperations. /// - public virtual IHcxEnterpriseSitesOperations HcxEnterpriseSites { get; private set; } + public virtual ICloudLinksOperations CloudLinks { get; private set; } /// - /// Gets the IAuthorizationsOperations. + /// Gets the IClustersOperations. /// - public virtual IAuthorizationsOperations Authorizations { get; private set; } + public virtual IClustersOperations Clusters { get; private set; } /// - /// Gets the IGlobalReachConnectionsOperations. + /// Gets the IDatastoresOperations. /// - public virtual IGlobalReachConnectionsOperations GlobalReachConnections { get; private set; } + public virtual IDatastoresOperations Datastores { get; private set; } /// - /// Gets the IWorkloadNetworksOperations. + /// Gets the IPlacementPoliciesOperations. /// - public virtual IWorkloadNetworksOperations WorkloadNetworks { get; private set; } + public virtual IPlacementPoliciesOperations PlacementPolicies { get; private set; } /// - /// Gets the ICloudLinksOperations. + /// Gets the IVirtualMachinesOperations. /// - public virtual ICloudLinksOperations CloudLinks { get; private set; } + public virtual IVirtualMachinesOperations VirtualMachines { get; private set; } /// - /// Gets the IAddonsOperations. + /// Gets the IGlobalReachConnectionsOperations. /// - public virtual IAddonsOperations Addons { get; private set; } + public virtual IGlobalReachConnectionsOperations GlobalReachConnections { get; private set; } /// - /// Gets the IVirtualMachinesOperations. + /// Gets the IHcxEnterpriseSitesOperations. /// - public virtual IVirtualMachinesOperations VirtualMachines { get; private set; } + public virtual IHcxEnterpriseSitesOperations HcxEnterpriseSites { get; private set; } /// - /// Gets the IPlacementPoliciesOperations. + /// Gets the IIscsiPathsOperations. /// - public virtual IPlacementPoliciesOperations PlacementPolicies { get; private set; } + public virtual IIscsiPathsOperations IscsiPaths { get; private set; } + + /// + /// Gets the IScriptExecutionsOperations. + /// + public virtual IScriptExecutionsOperations ScriptExecutions { get; private set; } /// /// Gets the IScriptPackagesOperations. @@ -150,9 +155,9 @@ public partial class AvsClient : ServiceClient, IAvsClient, IAzureCli public virtual IScriptCmdletsOperations ScriptCmdlets { get; private set; } /// - /// Gets the IScriptExecutionsOperations. + /// Gets the IWorkloadNetworksOperations. /// - public virtual IScriptExecutionsOperations ScriptExecutions { get; private set; } + public virtual IWorkloadNetworksOperations WorkloadNetworks { get; private set; } /// /// Initializes a new instance of the AvsClient class. @@ -398,21 +403,22 @@ private void Initialize() Operations = new Operations(this); Locations = new LocationsOperations(this); PrivateClouds = new PrivateCloudsOperations(this); - Clusters = new ClustersOperations(this); - Datastores = new DatastoresOperations(this); - HcxEnterpriseSites = new HcxEnterpriseSitesOperations(this); + Addons = new AddonsOperations(this); Authorizations = new AuthorizationsOperations(this); - GlobalReachConnections = new GlobalReachConnectionsOperations(this); - WorkloadNetworks = new WorkloadNetworksOperations(this); CloudLinks = new CloudLinksOperations(this); - Addons = new AddonsOperations(this); - VirtualMachines = new VirtualMachinesOperations(this); + Clusters = new ClustersOperations(this); + Datastores = new DatastoresOperations(this); PlacementPolicies = new PlacementPoliciesOperations(this); + VirtualMachines = new VirtualMachinesOperations(this); + GlobalReachConnections = new GlobalReachConnectionsOperations(this); + HcxEnterpriseSites = new HcxEnterpriseSitesOperations(this); + IscsiPaths = new IscsiPathsOperations(this); + ScriptExecutions = new ScriptExecutionsOperations(this); ScriptPackages = new ScriptPackagesOperations(this); ScriptCmdlets = new ScriptCmdletsOperations(this); - ScriptExecutions = new ScriptExecutionsOperations(this); + WorkloadNetworks = new WorkloadNetworksOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-12-01"; + ApiVersion = "2023-09-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -444,12 +450,14 @@ private void Initialize() }; SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("addonType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("addonType")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("dhcpType")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("dhcpType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("dhcpType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("dhcpType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("dhcpType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("dhcpType")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/CloudLinksOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/CloudLinksOperations.cs index 441d866101839..d4aa6fa827494 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/CloudLinksOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/CloudLinksOperations.cs @@ -51,7 +51,7 @@ internal CloudLinksOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List cloud link in a private cloud + /// List CloudLink resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -65,7 +65,7 @@ internal CloudLinksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,15 +82,15 @@ internal CloudLinksOperations(AvsClient client) /// public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -112,15 +112,11 @@ internal CloudLinksOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -138,7 +134,7 @@ internal CloudLinksOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -206,14 +202,13 @@ internal CloudLinksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -223,10 +218,6 @@ internal CloudLinksOperations(AvsClient client) } 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); @@ -272,7 +263,7 @@ internal CloudLinksOperations(AvsClient client) } /// - /// Get an cloud link by name in a private cloud + /// Get a CloudLink /// /// /// The name of the resource group. The name is case insensitive. @@ -281,7 +272,7 @@ internal CloudLinksOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// /// Headers that will be added to request. @@ -289,7 +280,7 @@ internal CloudLinksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -306,15 +297,15 @@ internal CloudLinksOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -336,19 +327,22 @@ internal CloudLinksOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (cloudLinkName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudLinkName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (cloudLinkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "cloudLinkName"); } - if (Client.ApiVersion != null) + if (cloudLinkName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(cloudLinkName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "cloudLinkName", "^[-\\w\\._]+$"); } } // Tracing @@ -367,7 +361,7 @@ internal CloudLinksOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{cloudLinkName}", System.Uri.EscapeDataString(cloudLinkName)); @@ -436,14 +430,13 @@ internal CloudLinksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -453,10 +446,6 @@ internal CloudLinksOperations(AvsClient client) } 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); @@ -502,19 +491,19 @@ internal CloudLinksOperations(AvsClient client) } /// - /// Create or update a cloud link in a private cloud + /// Create a CloudLink /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// - /// A cloud link in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -522,15 +511,15 @@ internal CloudLinksOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, CloudLink cloudLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, CloudLink cloudLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a cloud link in a private cloud + /// Delete a CloudLink /// /// /// The name of the resource group. The name is case insensitive. @@ -539,7 +528,7 @@ internal CloudLinksOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// /// The headers that will be added to request. @@ -547,27 +536,27 @@ internal CloudLinksOperations(AvsClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, cloudLinkName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, cloudLinkName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update a cloud link in a private cloud + /// Create a CloudLink /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// - /// A cloud link in the private cloud + /// Resource create parameters. /// /// /// Headers that will be added to request. @@ -575,7 +564,7 @@ internal CloudLinksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -590,17 +579,17 @@ internal CloudLinksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, CloudLink cloudLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, CloudLink cloudLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -622,25 +611,28 @@ internal CloudLinksOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (cloudLinkName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudLinkName"); - } - if (cloudLink == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudLink"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (cloudLinkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "cloudLinkName"); } - if (Client.ApiVersion != null) + if (cloudLinkName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(cloudLinkName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "cloudLinkName", "^[-\\w\\._]+$"); } } + if (cloudLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cloudLink"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -658,7 +650,7 @@ internal CloudLinksOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{cloudLinkName}", System.Uri.EscapeDataString(cloudLinkName)); @@ -733,14 +725,13 @@ internal CloudLinksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -750,10 +741,6 @@ internal CloudLinksOperations(AvsClient client) } 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); @@ -766,7 +753,7 @@ internal CloudLinksOperations(AvsClient 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")) @@ -809,6 +796,19 @@ internal CloudLinksOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -817,7 +817,7 @@ internal CloudLinksOperations(AvsClient client) } /// - /// Delete a cloud link in a private cloud + /// Delete a CloudLink /// /// /// The name of the resource group. The name is case insensitive. @@ -826,7 +826,7 @@ internal CloudLinksOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// /// Headers that will be added to request. @@ -834,7 +834,7 @@ internal CloudLinksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -846,17 +846,17 @@ internal CloudLinksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -878,19 +878,22 @@ internal CloudLinksOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (cloudLinkName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "cloudLinkName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (cloudLinkName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "cloudLinkName"); } - if (Client.ApiVersion != null) + if (cloudLinkName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(cloudLinkName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "cloudLinkName", "^[-\\w\\._]+$"); } } // Tracing @@ -909,7 +912,7 @@ internal CloudLinksOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{cloudLinkName}", System.Uri.EscapeDataString(cloudLinkName)); @@ -978,14 +981,13 @@ internal CloudLinksOperations(AvsClient client) 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)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -995,10 +997,6 @@ internal CloudLinksOperations(AvsClient client) } 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); @@ -1011,13 +1009,26 @@ internal CloudLinksOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1026,7 +1037,7 @@ internal CloudLinksOperations(AvsClient client) } /// - /// List cloud link in a private cloud + /// List CloudLink resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -1037,7 +1048,7 @@ internal CloudLinksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1133,14 +1144,13 @@ internal CloudLinksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1150,10 +1160,6 @@ internal CloudLinksOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/CloudLinksOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/CloudLinksOperationsExtensions.cs index 6289d908c12a3..f37e1e8a87f92 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/CloudLinksOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/CloudLinksOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class CloudLinksOperationsExtensions { /// - /// List cloud link in a private cloud + /// List CloudLink resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -39,7 +39,7 @@ public static IPage List(this ICloudLinksOperations operations, strin } /// - /// List cloud link in a private cloud + /// List CloudLink resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -62,7 +62,7 @@ public static IPage List(this ICloudLinksOperations operations, strin } /// - /// Get an cloud link by name in a private cloud + /// Get a CloudLink /// /// /// The operations group for this extension method. @@ -74,7 +74,7 @@ public static IPage List(this ICloudLinksOperations operations, strin /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// public static CloudLink Get(this ICloudLinksOperations operations, string resourceGroupName, string privateCloudName, string cloudLinkName) { @@ -82,7 +82,7 @@ public static CloudLink Get(this ICloudLinksOperations operations, string resour } /// - /// Get an cloud link by name in a private cloud + /// Get a CloudLink /// /// /// The operations group for this extension method. @@ -94,7 +94,7 @@ public static CloudLink Get(this ICloudLinksOperations operations, string resour /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// /// The cancellation token. @@ -108,7 +108,7 @@ public static CloudLink Get(this ICloudLinksOperations operations, string resour } /// - /// Create or update a cloud link in a private cloud + /// Create a CloudLink /// /// /// The operations group for this extension method. @@ -117,13 +117,13 @@ public static CloudLink Get(this ICloudLinksOperations operations, string resour /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// - /// A cloud link in the private cloud + /// Resource create parameters. /// public static CloudLink CreateOrUpdate(this ICloudLinksOperations operations, string resourceGroupName, string privateCloudName, string cloudLinkName, CloudLink cloudLink) { @@ -131,7 +131,7 @@ public static CloudLink CreateOrUpdate(this ICloudLinksOperations operations, st } /// - /// Create or update a cloud link in a private cloud + /// Create a CloudLink /// /// /// The operations group for this extension method. @@ -140,13 +140,13 @@ public static CloudLink CreateOrUpdate(this ICloudLinksOperations operations, st /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// - /// A cloud link in the private cloud + /// Resource create parameters. /// /// /// The cancellation token. @@ -160,7 +160,7 @@ public static CloudLink CreateOrUpdate(this ICloudLinksOperations operations, st } /// - /// Delete a cloud link in a private cloud + /// Delete a CloudLink /// /// /// The operations group for this extension method. @@ -172,15 +172,15 @@ public static CloudLink CreateOrUpdate(this ICloudLinksOperations operations, st /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// - public static void Delete(this ICloudLinksOperations operations, string resourceGroupName, string privateCloudName, string cloudLinkName) + public static CloudLinksDeleteHeaders Delete(this ICloudLinksOperations operations, string resourceGroupName, string privateCloudName, string cloudLinkName) { - operations.DeleteAsync(resourceGroupName, privateCloudName, cloudLinkName).GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, privateCloudName, cloudLinkName).GetAwaiter().GetResult(); } /// - /// Delete a cloud link in a private cloud + /// Delete a CloudLink /// /// /// The operations group for this extension method. @@ -192,18 +192,21 @@ public static void Delete(this ICloudLinksOperations operations, string resource /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this ICloudLinksOperations operations, string resourceGroupName, string privateCloudName, string cloudLinkName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this ICloudLinksOperations operations, string resourceGroupName, string privateCloudName, string cloudLinkName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, cloudLinkName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, cloudLinkName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create or update a cloud link in a private cloud + /// Create a CloudLink /// /// /// The operations group for this extension method. @@ -212,13 +215,13 @@ public static void Delete(this ICloudLinksOperations operations, string resource /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// - /// A cloud link in the private cloud + /// Resource create parameters. /// public static CloudLink BeginCreateOrUpdate(this ICloudLinksOperations operations, string resourceGroupName, string privateCloudName, string cloudLinkName, CloudLink cloudLink) { @@ -226,7 +229,7 @@ public static CloudLink BeginCreateOrUpdate(this ICloudLinksOperations operation } /// - /// Create or update a cloud link in a private cloud + /// Create a CloudLink /// /// /// The operations group for this extension method. @@ -235,13 +238,13 @@ public static CloudLink BeginCreateOrUpdate(this ICloudLinksOperations operation /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// - /// A cloud link in the private cloud + /// Resource create parameters. /// /// /// The cancellation token. @@ -255,7 +258,7 @@ public static CloudLink BeginCreateOrUpdate(this ICloudLinksOperations operation } /// - /// Delete a cloud link in a private cloud + /// Delete a CloudLink /// /// /// The operations group for this extension method. @@ -267,15 +270,15 @@ public static CloudLink BeginCreateOrUpdate(this ICloudLinksOperations operation /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// - public static void BeginDelete(this ICloudLinksOperations operations, string resourceGroupName, string privateCloudName, string cloudLinkName) + public static CloudLinksDeleteHeaders BeginDelete(this ICloudLinksOperations operations, string resourceGroupName, string privateCloudName, string cloudLinkName) { - operations.BeginDeleteAsync(resourceGroupName, privateCloudName, cloudLinkName).GetAwaiter().GetResult(); + return operations.BeginDeleteAsync(resourceGroupName, privateCloudName, cloudLinkName).GetAwaiter().GetResult(); } /// - /// Delete a cloud link in a private cloud + /// Delete a CloudLink /// /// /// The operations group for this extension method. @@ -287,18 +290,21 @@ public static void BeginDelete(this ICloudLinksOperations operations, string res /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this ICloudLinksOperations operations, string resourceGroupName, string privateCloudName, string cloudLinkName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this ICloudLinksOperations operations, string resourceGroupName, string privateCloudName, string cloudLinkName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, cloudLinkName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, cloudLinkName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List cloud link in a private cloud + /// List CloudLink resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -312,7 +318,7 @@ public static IPage ListNext(this ICloudLinksOperations operations, s } /// - /// List cloud link in a private cloud + /// List CloudLink resources by PrivateCloud /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ClustersOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ClustersOperations.cs index 7914c7f66e4c9..182146130d166 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ClustersOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ClustersOperations.cs @@ -51,7 +51,7 @@ internal ClustersOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List clusters in a private cloud + /// List Cluster resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -65,7 +65,7 @@ internal ClustersOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,15 +82,15 @@ internal ClustersOperations(AvsClient client) /// public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -112,15 +112,11 @@ internal ClustersOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -138,7 +134,7 @@ internal ClustersOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -206,14 +202,13 @@ internal ClustersOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -223,10 +218,6 @@ internal ClustersOperations(AvsClient client) } 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); @@ -272,7 +263,7 @@ internal ClustersOperations(AvsClient client) } /// - /// Get a cluster by name in a private cloud + /// Get a Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -281,7 +272,7 @@ internal ClustersOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// Headers that will be added to request. @@ -289,7 +280,7 @@ internal ClustersOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -306,15 +297,15 @@ internal ClustersOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -336,19 +327,22 @@ internal ClustersOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (clusterName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (clusterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - if (Client.ApiVersion != null) + if (clusterName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); } } // Tracing @@ -367,7 +361,7 @@ internal ClustersOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -436,14 +430,13 @@ internal ClustersOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -453,10 +446,6 @@ internal ClustersOperations(AvsClient client) } 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); @@ -502,19 +491,19 @@ internal ClustersOperations(AvsClient client) } /// - /// Create or update a cluster in a private cloud + /// Create a Cluster /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// A cluster in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -522,15 +511,15 @@ internal ClustersOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Cluster cluster, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Cluster cluster, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, cluster, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, cluster, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Update a cluster in a private cloud + /// Update a Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -539,10 +528,10 @@ internal ClustersOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// The cluster properties to be updated + /// The cluster properties to be updated. /// /// /// The headers that will be added to request. @@ -550,15 +539,15 @@ internal ClustersOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, ClusterUpdate clusterUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, ClusterUpdate clusterUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a cluster in a private cloud + /// Delete a Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -567,7 +556,7 @@ internal ClustersOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The headers that will be added to request. @@ -575,27 +564,24 @@ internal ClustersOperations(AvsClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update a cluster in a private cloud + /// List hosts by zone in a cluster /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud - /// - /// - /// A cluster in the private cloud + /// Name of the cluster /// /// /// Headers that will be added to request. @@ -603,7 +589,7 @@ internal ClustersOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -618,17 +604,17 @@ internal ClustersOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Cluster cluster, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListZonesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -650,18 +636,207 @@ internal ClustersOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } if (clusterName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - if (cluster == null) + if (clusterName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "cluster"); + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); + } } - if (cluster != null) + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) { - cluster.Validate(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListZones", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/listZones").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Create a Cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster + /// + /// + /// Resource create parameters. + /// + /// + /// 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 privateCloudName, string clusterName, Cluster cluster, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -673,6 +848,51 @@ internal ClustersOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (clusterName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); + } + } + if (cluster == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cluster"); + } + if (cluster != null) + { + cluster.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -690,7 +910,7 @@ internal ClustersOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -765,14 +985,13 @@ internal ClustersOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -782,10 +1001,6 @@ internal ClustersOperations(AvsClient client) } 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); @@ -798,7 +1013,7 @@ internal ClustersOperations(AvsClient 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")) @@ -841,6 +1056,19 @@ internal ClustersOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -849,7 +1077,7 @@ internal ClustersOperations(AvsClient client) } /// - /// Update a cluster in a private cloud + /// Update a Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -858,10 +1086,10 @@ internal ClustersOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// The cluster properties to be updated + /// The cluster properties to be updated. /// /// /// Headers that will be added to request. @@ -869,7 +1097,7 @@ internal ClustersOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -884,17 +1112,17 @@ internal ClustersOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, ClusterUpdate clusterUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, ClusterUpdate clusterUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -916,25 +1144,28 @@ internal ClustersOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (clusterName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - if (clusterUpdate == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterUpdate"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (clusterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - if (Client.ApiVersion != null) + if (clusterName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); } } + if (clusterUpdate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterUpdate"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -952,7 +1183,7 @@ internal ClustersOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -1027,14 +1258,13 @@ internal ClustersOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1044,10 +1274,6 @@ internal ClustersOperations(AvsClient client) } 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); @@ -1060,7 +1286,7 @@ internal ClustersOperations(AvsClient 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")) @@ -1103,6 +1329,19 @@ internal ClustersOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1111,7 +1350,7 @@ internal ClustersOperations(AvsClient client) } /// - /// Delete a cluster in a private cloud + /// Delete a Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -1120,7 +1359,7 @@ internal ClustersOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// Headers that will be added to request. @@ -1128,7 +1367,7 @@ internal ClustersOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1140,17 +1379,17 @@ internal ClustersOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -1172,19 +1411,22 @@ internal ClustersOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (clusterName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (clusterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - if (Client.ApiVersion != null) + if (clusterName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); } } // Tracing @@ -1203,7 +1445,7 @@ internal ClustersOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -1272,14 +1514,13 @@ internal ClustersOperations(AvsClient client) 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)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1289,10 +1530,6 @@ internal ClustersOperations(AvsClient client) } 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); @@ -1305,13 +1542,26 @@ internal ClustersOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1320,7 +1570,7 @@ internal ClustersOperations(AvsClient client) } /// - /// List clusters in a private cloud + /// List Cluster resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -1331,7 +1581,7 @@ internal ClustersOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1427,14 +1677,13 @@ internal ClustersOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1444,10 +1693,6 @@ internal ClustersOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ClustersOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ClustersOperationsExtensions.cs index 33ede2495a656..b9a5f84352d8d 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ClustersOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ClustersOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class ClustersOperationsExtensions { /// - /// List clusters in a private cloud + /// List Cluster resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -39,7 +39,7 @@ public static IPage List(this IClustersOperations operations, string re } /// - /// List clusters in a private cloud + /// List Cluster resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -62,7 +62,7 @@ public static IPage List(this IClustersOperations operations, string re } /// - /// Get a cluster by name in a private cloud + /// Get a Cluster /// /// /// The operations group for this extension method. @@ -74,7 +74,7 @@ public static IPage List(this IClustersOperations operations, string re /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// public static Cluster Get(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName) { @@ -82,7 +82,7 @@ public static Cluster Get(this IClustersOperations operations, string resourceGr } /// - /// Get a cluster by name in a private cloud + /// Get a Cluster /// /// /// The operations group for this extension method. @@ -94,7 +94,7 @@ public static Cluster Get(this IClustersOperations operations, string resourceGr /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The cancellation token. @@ -108,7 +108,7 @@ public static Cluster Get(this IClustersOperations operations, string resourceGr } /// - /// Create or update a cluster in a private cloud + /// Create a Cluster /// /// /// The operations group for this extension method. @@ -117,13 +117,13 @@ public static Cluster Get(this IClustersOperations operations, string resourceGr /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// A cluster in the private cloud + /// Resource create parameters. /// public static Cluster CreateOrUpdate(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName, Cluster cluster) { @@ -131,7 +131,7 @@ public static Cluster CreateOrUpdate(this IClustersOperations operations, string } /// - /// Create or update a cluster in a private cloud + /// Create a Cluster /// /// /// The operations group for this extension method. @@ -140,13 +140,13 @@ public static Cluster CreateOrUpdate(this IClustersOperations operations, string /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// A cluster in the private cloud + /// Resource create parameters. /// /// /// The cancellation token. @@ -160,7 +160,7 @@ public static Cluster CreateOrUpdate(this IClustersOperations operations, string } /// - /// Update a cluster in a private cloud + /// Update a Cluster /// /// /// The operations group for this extension method. @@ -172,10 +172,10 @@ public static Cluster CreateOrUpdate(this IClustersOperations operations, string /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// The cluster properties to be updated + /// The cluster properties to be updated. /// public static Cluster Update(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName, ClusterUpdate clusterUpdate) { @@ -183,7 +183,7 @@ public static Cluster Update(this IClustersOperations operations, string resourc } /// - /// Update a cluster in a private cloud + /// Update a Cluster /// /// /// The operations group for this extension method. @@ -195,10 +195,10 @@ public static Cluster Update(this IClustersOperations operations, string resourc /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// The cluster properties to be updated + /// The cluster properties to be updated. /// /// /// The cancellation token. @@ -212,7 +212,53 @@ public static Cluster Update(this IClustersOperations operations, string resourc } /// - /// Delete a cluster in a private cloud + /// Delete a Cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster + /// + public static ClustersDeleteHeaders Delete(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName) + { + return operations.DeleteAsync(resourceGroupName, privateCloudName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Cluster + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// List hosts by zone in a cluster /// /// /// The operations group for this extension method. @@ -224,15 +270,15 @@ public static Cluster Update(this IClustersOperations operations, string resourc /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// - public static void Delete(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName) + public static ClusterZoneList ListZones(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName) { - operations.DeleteAsync(resourceGroupName, privateCloudName, clusterName).GetAwaiter().GetResult(); + return operations.ListZonesAsync(resourceGroupName, privateCloudName, clusterName).GetAwaiter().GetResult(); } /// - /// Delete a cluster in a private cloud + /// List hosts by zone in a cluster /// /// /// The operations group for this extension method. @@ -244,18 +290,21 @@ public static void Delete(this IClustersOperations operations, string resourceGr /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListZonesAsync(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListZonesWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Create or update a cluster in a private cloud + /// Create a Cluster /// /// /// The operations group for this extension method. @@ -264,13 +313,13 @@ public static void Delete(this IClustersOperations operations, string resourceGr /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// A cluster in the private cloud + /// Resource create parameters. /// public static Cluster BeginCreateOrUpdate(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName, Cluster cluster) { @@ -278,7 +327,7 @@ public static Cluster BeginCreateOrUpdate(this IClustersOperations operations, s } /// - /// Create or update a cluster in a private cloud + /// Create a Cluster /// /// /// The operations group for this extension method. @@ -287,13 +336,13 @@ public static Cluster BeginCreateOrUpdate(this IClustersOperations operations, s /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// A cluster in the private cloud + /// Resource create parameters. /// /// /// The cancellation token. @@ -307,7 +356,7 @@ public static Cluster BeginCreateOrUpdate(this IClustersOperations operations, s } /// - /// Update a cluster in a private cloud + /// Update a Cluster /// /// /// The operations group for this extension method. @@ -319,10 +368,10 @@ public static Cluster BeginCreateOrUpdate(this IClustersOperations operations, s /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// The cluster properties to be updated + /// The cluster properties to be updated. /// public static Cluster BeginUpdate(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName, ClusterUpdate clusterUpdate) { @@ -330,7 +379,7 @@ public static Cluster BeginUpdate(this IClustersOperations operations, string re } /// - /// Update a cluster in a private cloud + /// Update a Cluster /// /// /// The operations group for this extension method. @@ -342,10 +391,10 @@ public static Cluster BeginUpdate(this IClustersOperations operations, string re /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// The cluster properties to be updated + /// The cluster properties to be updated. /// /// /// The cancellation token. @@ -359,7 +408,7 @@ public static Cluster BeginUpdate(this IClustersOperations operations, string re } /// - /// Delete a cluster in a private cloud + /// Delete a Cluster /// /// /// The operations group for this extension method. @@ -371,15 +420,15 @@ public static Cluster BeginUpdate(this IClustersOperations operations, string re /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// - public static void BeginDelete(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName) + public static ClustersDeleteHeaders BeginDelete(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName) { - operations.BeginDeleteAsync(resourceGroupName, privateCloudName, clusterName).GetAwaiter().GetResult(); + return operations.BeginDeleteAsync(resourceGroupName, privateCloudName, clusterName).GetAwaiter().GetResult(); } /// - /// Delete a cluster in a private cloud + /// Delete a Cluster /// /// /// The operations group for this extension method. @@ -391,18 +440,21 @@ public static void BeginDelete(this IClustersOperations operations, string resou /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IClustersOperations operations, string resourceGroupName, string privateCloudName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List clusters in a private cloud + /// List Cluster resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -416,7 +468,7 @@ public static IPage ListNext(this IClustersOperations operations, strin } /// - /// List clusters in a private cloud + /// List Cluster resources by PrivateCloud /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/DatastoresOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/DatastoresOperations.cs index cd53b56cffeb6..d4eb338c141e6 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/DatastoresOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/DatastoresOperations.cs @@ -51,7 +51,7 @@ internal DatastoresOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List datastores in a private cloud cluster + /// List Datastore resources by Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -60,7 +60,7 @@ internal DatastoresOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// Headers that will be added to request. @@ -68,7 +68,7 @@ internal DatastoresOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -85,15 +85,15 @@ internal DatastoresOperations(AvsClient client) /// public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -115,19 +115,22 @@ internal DatastoresOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (clusterName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (clusterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - if (Client.ApiVersion != null) + if (clusterName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); } } // Tracing @@ -146,7 +149,7 @@ internal DatastoresOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -215,14 +218,13 @@ internal DatastoresOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -232,10 +234,6 @@ internal DatastoresOperations(AvsClient client) } 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); @@ -281,7 +279,7 @@ internal DatastoresOperations(AvsClient client) } /// - /// Get a datastore in a private cloud cluster + /// Get a Datastore /// /// /// The name of the resource group. The name is case insensitive. @@ -290,10 +288,10 @@ internal DatastoresOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// /// Headers that will be added to request. @@ -301,7 +299,7 @@ internal DatastoresOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -318,15 +316,15 @@ internal DatastoresOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -348,23 +346,33 @@ internal DatastoresOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } if (clusterName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - if (datastoreName == null) + if (clusterName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "datastoreName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (datastoreName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "datastoreName"); } - if (Client.ApiVersion != null) + if (datastoreName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(datastoreName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "datastoreName", "^[-\\w\\._]+$"); } } // Tracing @@ -384,7 +392,7 @@ internal DatastoresOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -454,14 +462,13 @@ internal DatastoresOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -471,10 +478,6 @@ internal DatastoresOperations(AvsClient client) } 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); @@ -520,7 +523,7 @@ internal DatastoresOperations(AvsClient client) } /// - /// Create or update a datastore in a private cloud cluster + /// Create a Datastore /// /// /// The name of the resource group. The name is case insensitive. @@ -529,13 +532,13 @@ internal DatastoresOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// - /// A datastore in a private cloud cluster + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -543,15 +546,15 @@ internal DatastoresOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Datastore datastore, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Datastore datastore, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a datastore in a private cloud cluster + /// Delete a Datastore /// /// /// The name of the resource group. The name is case insensitive. @@ -560,10 +563,10 @@ internal DatastoresOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// /// The headers that will be added to request. @@ -571,15 +574,15 @@ internal DatastoresOperations(AvsClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update a datastore in a private cloud cluster + /// Create a Datastore /// /// /// The name of the resource group. The name is case insensitive. @@ -588,13 +591,13 @@ internal DatastoresOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// - /// A datastore in a private cloud cluster + /// Resource create parameters. /// /// /// Headers that will be added to request. @@ -602,7 +605,7 @@ internal DatastoresOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -617,17 +620,17 @@ internal DatastoresOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Datastore datastore, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Datastore datastore, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -649,14 +652,35 @@ internal DatastoresOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } if (clusterName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } + if (clusterName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); + } + } if (datastoreName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "datastoreName"); } + if (datastoreName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(datastoreName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "datastoreName", "^[-\\w\\._]+$"); + } + } if (datastore == null) { throw new ValidationException(ValidationRules.CannotBeNull, "datastore"); @@ -665,17 +689,6 @@ internal DatastoresOperations(AvsClient client) { datastore.Validate(); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -694,7 +707,7 @@ internal DatastoresOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -770,14 +783,13 @@ internal DatastoresOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -787,10 +799,6 @@ internal DatastoresOperations(AvsClient client) } 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); @@ -803,7 +811,7 @@ internal DatastoresOperations(AvsClient 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")) @@ -846,6 +854,19 @@ internal DatastoresOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -854,7 +875,7 @@ internal DatastoresOperations(AvsClient client) } /// - /// Delete a datastore in a private cloud cluster + /// Delete a Datastore /// /// /// The name of the resource group. The name is case insensitive. @@ -863,10 +884,10 @@ internal DatastoresOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// /// Headers that will be added to request. @@ -874,7 +895,7 @@ internal DatastoresOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -886,17 +907,17 @@ internal DatastoresOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -918,23 +939,33 @@ internal DatastoresOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } if (clusterName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - if (datastoreName == null) + if (clusterName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "datastoreName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (datastoreName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "datastoreName"); } - if (Client.ApiVersion != null) + if (datastoreName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(datastoreName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "datastoreName", "^[-\\w\\._]+$"); } } // Tracing @@ -954,7 +985,7 @@ internal DatastoresOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -1024,14 +1055,13 @@ internal DatastoresOperations(AvsClient client) 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)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1041,10 +1071,6 @@ internal DatastoresOperations(AvsClient client) } 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); @@ -1057,13 +1083,26 @@ internal DatastoresOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1072,7 +1111,7 @@ internal DatastoresOperations(AvsClient client) } /// - /// List datastores in a private cloud cluster + /// List Datastore resources by Cluster /// /// /// The NextLink from the previous successful call to List operation. @@ -1083,7 +1122,7 @@ internal DatastoresOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1179,14 +1218,13 @@ internal DatastoresOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1196,10 +1234,6 @@ internal DatastoresOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/DatastoresOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/DatastoresOperationsExtensions.cs index 894dd94ac3a80..7457225cc1031 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/DatastoresOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/DatastoresOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class DatastoresOperationsExtensions { /// - /// List datastores in a private cloud cluster + /// List Datastore resources by Cluster /// /// /// The operations group for this extension method. @@ -34,7 +34,7 @@ public static partial class DatastoresOperationsExtensions /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// public static IPage List(this IDatastoresOperations operations, string resourceGroupName, string privateCloudName, string clusterName) { @@ -42,7 +42,7 @@ public static IPage List(this IDatastoresOperations operations, strin } /// - /// List datastores in a private cloud cluster + /// List Datastore resources by Cluster /// /// /// The operations group for this extension method. @@ -54,7 +54,7 @@ public static IPage List(this IDatastoresOperations operations, strin /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The cancellation token. @@ -68,7 +68,7 @@ public static IPage List(this IDatastoresOperations operations, strin } /// - /// Get a datastore in a private cloud cluster + /// Get a Datastore /// /// /// The operations group for this extension method. @@ -80,10 +80,10 @@ public static IPage List(this IDatastoresOperations operations, strin /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// public static Datastore Get(this IDatastoresOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName) { @@ -91,7 +91,7 @@ public static Datastore Get(this IDatastoresOperations operations, string resour } /// - /// Get a datastore in a private cloud cluster + /// Get a Datastore /// /// /// The operations group for this extension method. @@ -103,10 +103,10 @@ public static Datastore Get(this IDatastoresOperations operations, string resour /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// /// The cancellation token. @@ -120,7 +120,7 @@ public static Datastore Get(this IDatastoresOperations operations, string resour } /// - /// Create or update a datastore in a private cloud cluster + /// Create a Datastore /// /// /// The operations group for this extension method. @@ -132,13 +132,13 @@ public static Datastore Get(this IDatastoresOperations operations, string resour /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// - /// A datastore in a private cloud cluster + /// Resource create parameters. /// public static Datastore CreateOrUpdate(this IDatastoresOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Datastore datastore) { @@ -146,7 +146,7 @@ public static Datastore CreateOrUpdate(this IDatastoresOperations operations, st } /// - /// Create or update a datastore in a private cloud cluster + /// Create a Datastore /// /// /// The operations group for this extension method. @@ -158,13 +158,13 @@ public static Datastore CreateOrUpdate(this IDatastoresOperations operations, st /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// - /// A datastore in a private cloud cluster + /// Resource create parameters. /// /// /// The cancellation token. @@ -178,7 +178,7 @@ public static Datastore CreateOrUpdate(this IDatastoresOperations operations, st } /// - /// Delete a datastore in a private cloud cluster + /// Delete a Datastore /// /// /// The operations group for this extension method. @@ -190,18 +190,18 @@ public static Datastore CreateOrUpdate(this IDatastoresOperations operations, st /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// - public static void Delete(this IDatastoresOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName) + public static DatastoresDeleteHeaders Delete(this IDatastoresOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName) { - operations.DeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName).GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName).GetAwaiter().GetResult(); } /// - /// Delete a datastore in a private cloud cluster + /// Delete a Datastore /// /// /// The operations group for this extension method. @@ -213,21 +213,24 @@ public static void Delete(this IDatastoresOperations operations, string resource /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IDatastoresOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IDatastoresOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create or update a datastore in a private cloud cluster + /// Create a Datastore /// /// /// The operations group for this extension method. @@ -239,13 +242,13 @@ public static void Delete(this IDatastoresOperations operations, string resource /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// - /// A datastore in a private cloud cluster + /// Resource create parameters. /// public static Datastore BeginCreateOrUpdate(this IDatastoresOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Datastore datastore) { @@ -253,7 +256,7 @@ public static Datastore BeginCreateOrUpdate(this IDatastoresOperations operation } /// - /// Create or update a datastore in a private cloud cluster + /// Create a Datastore /// /// /// The operations group for this extension method. @@ -265,13 +268,13 @@ public static Datastore BeginCreateOrUpdate(this IDatastoresOperations operation /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// - /// A datastore in a private cloud cluster + /// Resource create parameters. /// /// /// The cancellation token. @@ -285,7 +288,7 @@ public static Datastore BeginCreateOrUpdate(this IDatastoresOperations operation } /// - /// Delete a datastore in a private cloud cluster + /// Delete a Datastore /// /// /// The operations group for this extension method. @@ -297,18 +300,18 @@ public static Datastore BeginCreateOrUpdate(this IDatastoresOperations operation /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// - public static void BeginDelete(this IDatastoresOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName) + public static DatastoresDeleteHeaders BeginDelete(this IDatastoresOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName) { - operations.BeginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName).GetAwaiter().GetResult(); + return operations.BeginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName).GetAwaiter().GetResult(); } /// - /// Delete a datastore in a private cloud cluster + /// Delete a Datastore /// /// /// The operations group for this extension method. @@ -320,21 +323,24 @@ public static void BeginDelete(this IDatastoresOperations operations, string res /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IDatastoresOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IDatastoresOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List datastores in a private cloud cluster + /// List Datastore resources by Cluster /// /// /// The operations group for this extension method. @@ -348,7 +354,7 @@ public static IPage ListNext(this IDatastoresOperations operations, s } /// - /// List datastores in a private cloud cluster + /// List Datastore resources by Cluster /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/GlobalReachConnectionsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/GlobalReachConnectionsOperations.cs index d7a5e3200259d..e61a7c470453a 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/GlobalReachConnectionsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/GlobalReachConnectionsOperations.cs @@ -51,7 +51,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List global reach connections in a private cloud + /// List GlobalReachConnection resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -65,7 +65,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,15 +82,15 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -112,15 +112,11 @@ internal GlobalReachConnectionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -138,7 +134,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -206,14 +202,13 @@ internal GlobalReachConnectionsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -223,10 +218,6 @@ internal GlobalReachConnectionsOperations(AvsClient client) } 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); @@ -272,7 +263,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) } /// - /// Get a global reach connection by name in a private cloud + /// Get a GlobalReachConnection /// /// /// The name of the resource group. The name is case insensitive. @@ -281,7 +272,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// /// Headers that will be added to request. @@ -289,7 +280,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -306,15 +297,15 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -336,19 +327,22 @@ internal GlobalReachConnectionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (globalReachConnectionName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "globalReachConnectionName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (globalReachConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "globalReachConnectionName"); } - if (Client.ApiVersion != null) + if (globalReachConnectionName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(globalReachConnectionName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "globalReachConnectionName", "^[-\\w\\._]+$"); } } // Tracing @@ -367,7 +361,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{globalReachConnectionName}", System.Uri.EscapeDataString(globalReachConnectionName)); @@ -436,14 +430,13 @@ internal GlobalReachConnectionsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -453,10 +446,6 @@ internal GlobalReachConnectionsOperations(AvsClient client) } 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); @@ -502,19 +491,19 @@ internal GlobalReachConnectionsOperations(AvsClient client) } /// - /// Create or update a global reach connection in a private cloud + /// Create a GlobalReachConnection /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// - /// A global reach connection in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -522,15 +511,15 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, GlobalReachConnection globalReachConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, GlobalReachConnection globalReachConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a global reach connection in a private cloud + /// Delete a GlobalReachConnection /// /// /// The name of the resource group. The name is case insensitive. @@ -539,7 +528,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// /// The headers that will be added to request. @@ -547,27 +536,27 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, globalReachConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, globalReachConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update a global reach connection in a private cloud + /// Create a GlobalReachConnection /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// - /// A global reach connection in the private cloud + /// Resource create parameters. /// /// /// Headers that will be added to request. @@ -575,7 +564,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -590,17 +579,17 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, GlobalReachConnection globalReachConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, GlobalReachConnection globalReachConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -622,25 +611,28 @@ internal GlobalReachConnectionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (globalReachConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "globalReachConnectionName"); - } - if (globalReachConnection == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "globalReachConnection"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (globalReachConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "globalReachConnectionName"); } - if (Client.ApiVersion != null) + if (globalReachConnectionName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(globalReachConnectionName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "globalReachConnectionName", "^[-\\w\\._]+$"); } } + if (globalReachConnection == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "globalReachConnection"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -658,7 +650,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{globalReachConnectionName}", System.Uri.EscapeDataString(globalReachConnectionName)); @@ -733,14 +725,13 @@ internal GlobalReachConnectionsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -750,10 +741,6 @@ internal GlobalReachConnectionsOperations(AvsClient client) } 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); @@ -766,7 +753,7 @@ internal GlobalReachConnectionsOperations(AvsClient 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")) @@ -809,6 +796,19 @@ internal GlobalReachConnectionsOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -817,7 +817,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) } /// - /// Delete a global reach connection in a private cloud + /// Delete a GlobalReachConnection /// /// /// The name of the resource group. The name is case insensitive. @@ -826,7 +826,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// /// Headers that will be added to request. @@ -834,7 +834,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -846,17 +846,17 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -878,19 +878,22 @@ internal GlobalReachConnectionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (globalReachConnectionName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "globalReachConnectionName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (globalReachConnectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "globalReachConnectionName"); } - if (Client.ApiVersion != null) + if (globalReachConnectionName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(globalReachConnectionName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "globalReachConnectionName", "^[-\\w\\._]+$"); } } // Tracing @@ -909,7 +912,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{globalReachConnectionName}", System.Uri.EscapeDataString(globalReachConnectionName)); @@ -978,14 +981,13 @@ internal GlobalReachConnectionsOperations(AvsClient client) 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)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -995,10 +997,6 @@ internal GlobalReachConnectionsOperations(AvsClient client) } 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); @@ -1011,13 +1009,26 @@ internal GlobalReachConnectionsOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1026,7 +1037,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) } /// - /// List global reach connections in a private cloud + /// List GlobalReachConnection resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -1037,7 +1048,7 @@ internal GlobalReachConnectionsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1133,14 +1144,13 @@ internal GlobalReachConnectionsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1150,10 +1160,6 @@ internal GlobalReachConnectionsOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/GlobalReachConnectionsOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/GlobalReachConnectionsOperationsExtensions.cs index 378441896ac2d..0809ad96c6d4f 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/GlobalReachConnectionsOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/GlobalReachConnectionsOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class GlobalReachConnectionsOperationsExtensions { /// - /// List global reach connections in a private cloud + /// List GlobalReachConnection resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -39,7 +39,7 @@ public static IPage List(this IGlobalReachConnectionsOper } /// - /// List global reach connections in a private cloud + /// List GlobalReachConnection resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -62,7 +62,7 @@ public static IPage List(this IGlobalReachConnectionsOper } /// - /// Get a global reach connection by name in a private cloud + /// Get a GlobalReachConnection /// /// /// The operations group for this extension method. @@ -74,7 +74,7 @@ public static IPage List(this IGlobalReachConnectionsOper /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// public static GlobalReachConnection Get(this IGlobalReachConnectionsOperations operations, string resourceGroupName, string privateCloudName, string globalReachConnectionName) { @@ -82,7 +82,7 @@ public static GlobalReachConnection Get(this IGlobalReachConnectionsOperations o } /// - /// Get a global reach connection by name in a private cloud + /// Get a GlobalReachConnection /// /// /// The operations group for this extension method. @@ -94,7 +94,7 @@ public static GlobalReachConnection Get(this IGlobalReachConnectionsOperations o /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// /// The cancellation token. @@ -108,7 +108,7 @@ public static GlobalReachConnection Get(this IGlobalReachConnectionsOperations o } /// - /// Create or update a global reach connection in a private cloud + /// Create a GlobalReachConnection /// /// /// The operations group for this extension method. @@ -117,13 +117,13 @@ public static GlobalReachConnection Get(this IGlobalReachConnectionsOperations o /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// - /// A global reach connection in the private cloud + /// Resource create parameters. /// public static GlobalReachConnection CreateOrUpdate(this IGlobalReachConnectionsOperations operations, string resourceGroupName, string privateCloudName, string globalReachConnectionName, GlobalReachConnection globalReachConnection) { @@ -131,7 +131,7 @@ public static GlobalReachConnection CreateOrUpdate(this IGlobalReachConnectionsO } /// - /// Create or update a global reach connection in a private cloud + /// Create a GlobalReachConnection /// /// /// The operations group for this extension method. @@ -140,13 +140,13 @@ public static GlobalReachConnection CreateOrUpdate(this IGlobalReachConnectionsO /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// - /// A global reach connection in the private cloud + /// Resource create parameters. /// /// /// The cancellation token. @@ -160,7 +160,7 @@ public static GlobalReachConnection CreateOrUpdate(this IGlobalReachConnectionsO } /// - /// Delete a global reach connection in a private cloud + /// Delete a GlobalReachConnection /// /// /// The operations group for this extension method. @@ -172,15 +172,15 @@ public static GlobalReachConnection CreateOrUpdate(this IGlobalReachConnectionsO /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// - public static void Delete(this IGlobalReachConnectionsOperations operations, string resourceGroupName, string privateCloudName, string globalReachConnectionName) + public static GlobalReachConnectionsDeleteHeaders Delete(this IGlobalReachConnectionsOperations operations, string resourceGroupName, string privateCloudName, string globalReachConnectionName) { - operations.DeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName).GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName).GetAwaiter().GetResult(); } /// - /// Delete a global reach connection in a private cloud + /// Delete a GlobalReachConnection /// /// /// The operations group for this extension method. @@ -192,18 +192,21 @@ public static void Delete(this IGlobalReachConnectionsOperations operations, str /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IGlobalReachConnectionsOperations operations, string resourceGroupName, string privateCloudName, string globalReachConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IGlobalReachConnectionsOperations operations, string resourceGroupName, string privateCloudName, string globalReachConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, globalReachConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, globalReachConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create or update a global reach connection in a private cloud + /// Create a GlobalReachConnection /// /// /// The operations group for this extension method. @@ -212,13 +215,13 @@ public static void Delete(this IGlobalReachConnectionsOperations operations, str /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// - /// A global reach connection in the private cloud + /// Resource create parameters. /// public static GlobalReachConnection BeginCreateOrUpdate(this IGlobalReachConnectionsOperations operations, string resourceGroupName, string privateCloudName, string globalReachConnectionName, GlobalReachConnection globalReachConnection) { @@ -226,7 +229,7 @@ public static GlobalReachConnection BeginCreateOrUpdate(this IGlobalReachConnect } /// - /// Create or update a global reach connection in a private cloud + /// Create a GlobalReachConnection /// /// /// The operations group for this extension method. @@ -235,13 +238,13 @@ public static GlobalReachConnection BeginCreateOrUpdate(this IGlobalReachConnect /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// - /// A global reach connection in the private cloud + /// Resource create parameters. /// /// /// The cancellation token. @@ -255,7 +258,7 @@ public static GlobalReachConnection BeginCreateOrUpdate(this IGlobalReachConnect } /// - /// Delete a global reach connection in a private cloud + /// Delete a GlobalReachConnection /// /// /// The operations group for this extension method. @@ -267,15 +270,15 @@ public static GlobalReachConnection BeginCreateOrUpdate(this IGlobalReachConnect /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// - public static void BeginDelete(this IGlobalReachConnectionsOperations operations, string resourceGroupName, string privateCloudName, string globalReachConnectionName) + public static GlobalReachConnectionsDeleteHeaders BeginDelete(this IGlobalReachConnectionsOperations operations, string resourceGroupName, string privateCloudName, string globalReachConnectionName) { - operations.BeginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName).GetAwaiter().GetResult(); + return operations.BeginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName).GetAwaiter().GetResult(); } /// - /// Delete a global reach connection in a private cloud + /// Delete a GlobalReachConnection /// /// /// The operations group for this extension method. @@ -287,18 +290,21 @@ public static void BeginDelete(this IGlobalReachConnectionsOperations operations /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IGlobalReachConnectionsOperations operations, string resourceGroupName, string privateCloudName, string globalReachConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IGlobalReachConnectionsOperations operations, string resourceGroupName, string privateCloudName, string globalReachConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, globalReachConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, globalReachConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List global reach connections in a private cloud + /// List GlobalReachConnection resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -312,7 +318,7 @@ public static IPage ListNext(this IGlobalReachConnections } /// - /// List global reach connections in a private cloud + /// List GlobalReachConnection resources by PrivateCloud /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/HcxEnterpriseSitesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/HcxEnterpriseSitesOperations.cs index f2ab538bf2d1d..6acbb251343aa 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/HcxEnterpriseSitesOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/HcxEnterpriseSitesOperations.cs @@ -51,7 +51,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List HCX Enterprise Sites in a private cloud + /// List HcxEnterpriseSite resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -65,7 +65,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,15 +82,15 @@ internal HcxEnterpriseSitesOperations(AvsClient client) /// public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -112,15 +112,11 @@ internal HcxEnterpriseSitesOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -138,7 +134,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -206,14 +202,13 @@ internal HcxEnterpriseSitesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -223,10 +218,6 @@ internal HcxEnterpriseSitesOperations(AvsClient client) } 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); @@ -272,7 +263,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) } /// - /// Get an HCX Enterprise Site by name in a private cloud + /// Get a HcxEnterpriseSite /// /// /// The name of the resource group. The name is case insensitive. @@ -281,7 +272,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the HCX Enterprise Site /// /// /// Headers that will be added to request. @@ -289,7 +280,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -306,15 +297,15 @@ internal HcxEnterpriseSitesOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -336,19 +327,22 @@ internal HcxEnterpriseSitesOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (hcxEnterpriseSiteName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hcxEnterpriseSiteName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (hcxEnterpriseSiteName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "hcxEnterpriseSiteName"); } - if (Client.ApiVersion != null) + if (hcxEnterpriseSiteName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(hcxEnterpriseSiteName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "hcxEnterpriseSiteName", "^[-\\w\\._]+$"); } } // Tracing @@ -367,7 +361,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{hcxEnterpriseSiteName}", System.Uri.EscapeDataString(hcxEnterpriseSiteName)); @@ -436,14 +430,13 @@ internal HcxEnterpriseSitesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -453,10 +446,6 @@ internal HcxEnterpriseSitesOperations(AvsClient client) } 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); @@ -502,16 +491,16 @@ internal HcxEnterpriseSitesOperations(AvsClient client) } /// - /// Create or update an HCX Enterprise Site in a private cloud + /// Create a HcxEnterpriseSite /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the HCX Enterprise Site /// /// /// Headers that will be added to request. @@ -519,7 +508,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -536,15 +525,15 @@ internal HcxEnterpriseSitesOperations(AvsClient client) /// public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -566,19 +555,22 @@ internal HcxEnterpriseSitesOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (hcxEnterpriseSiteName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hcxEnterpriseSiteName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (hcxEnterpriseSiteName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "hcxEnterpriseSiteName"); } - if (Client.ApiVersion != null) + if (hcxEnterpriseSiteName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(hcxEnterpriseSiteName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "hcxEnterpriseSiteName", "^[-\\w\\._]+$"); } } HcxEnterpriseSite hcxEnterpriseSite = new HcxEnterpriseSite(); @@ -599,7 +591,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{hcxEnterpriseSiteName}", System.Uri.EscapeDataString(hcxEnterpriseSiteName)); @@ -674,14 +666,13 @@ internal HcxEnterpriseSitesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -691,10 +682,6 @@ internal HcxEnterpriseSitesOperations(AvsClient client) } 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); @@ -758,7 +745,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) } /// - /// Delete an HCX Enterprise Site in a private cloud + /// Delete a HcxEnterpriseSite /// /// /// The name of the resource group. The name is case insensitive. @@ -767,7 +754,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the HCX Enterprise Site /// /// /// Headers that will be added to request. @@ -775,7 +762,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -789,15 +776,15 @@ internal HcxEnterpriseSitesOperations(AvsClient client) /// public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -819,19 +806,22 @@ internal HcxEnterpriseSitesOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (hcxEnterpriseSiteName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "hcxEnterpriseSiteName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (hcxEnterpriseSiteName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "hcxEnterpriseSiteName"); } - if (Client.ApiVersion != null) + if (hcxEnterpriseSiteName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(hcxEnterpriseSiteName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "hcxEnterpriseSiteName", "^[-\\w\\._]+$"); } } // Tracing @@ -850,7 +840,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{hcxEnterpriseSiteName}", System.Uri.EscapeDataString(hcxEnterpriseSiteName)); @@ -919,14 +909,13 @@ internal HcxEnterpriseSitesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -936,10 +925,6 @@ internal HcxEnterpriseSitesOperations(AvsClient client) } 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); @@ -967,7 +952,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) } /// - /// List HCX Enterprise Sites in a private cloud + /// List HcxEnterpriseSite resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -978,7 +963,7 @@ internal HcxEnterpriseSitesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1074,14 +1059,13 @@ internal HcxEnterpriseSitesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1091,10 +1075,6 @@ internal HcxEnterpriseSitesOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/HcxEnterpriseSitesOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/HcxEnterpriseSitesOperationsExtensions.cs index 8479b065feae0..5193bea88b217 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/HcxEnterpriseSitesOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/HcxEnterpriseSitesOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class HcxEnterpriseSitesOperationsExtensions { /// - /// List HCX Enterprise Sites in a private cloud + /// List HcxEnterpriseSite resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -39,7 +39,7 @@ public static IPage List(this IHcxEnterpriseSitesOperations o } /// - /// List HCX Enterprise Sites in a private cloud + /// List HcxEnterpriseSite resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -62,7 +62,7 @@ public static IPage List(this IHcxEnterpriseSitesOperations o } /// - /// Get an HCX Enterprise Site by name in a private cloud + /// Get a HcxEnterpriseSite /// /// /// The operations group for this extension method. @@ -74,7 +74,7 @@ public static IPage List(this IHcxEnterpriseSitesOperations o /// Name of the private cloud /// /// - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the HCX Enterprise Site /// public static HcxEnterpriseSite Get(this IHcxEnterpriseSitesOperations operations, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName) { @@ -82,7 +82,7 @@ public static HcxEnterpriseSite Get(this IHcxEnterpriseSitesOperations operation } /// - /// Get an HCX Enterprise Site by name in a private cloud + /// Get a HcxEnterpriseSite /// /// /// The operations group for this extension method. @@ -94,7 +94,7 @@ public static HcxEnterpriseSite Get(this IHcxEnterpriseSitesOperations operation /// Name of the private cloud /// /// - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the HCX Enterprise Site /// /// /// The cancellation token. @@ -108,7 +108,7 @@ public static HcxEnterpriseSite Get(this IHcxEnterpriseSitesOperations operation } /// - /// Create or update an HCX Enterprise Site in a private cloud + /// Create a HcxEnterpriseSite /// /// /// The operations group for this extension method. @@ -117,10 +117,10 @@ public static HcxEnterpriseSite Get(this IHcxEnterpriseSitesOperations operation /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the HCX Enterprise Site /// public static HcxEnterpriseSite CreateOrUpdate(this IHcxEnterpriseSitesOperations operations, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName) { @@ -128,7 +128,7 @@ public static HcxEnterpriseSite CreateOrUpdate(this IHcxEnterpriseSitesOperation } /// - /// Create or update an HCX Enterprise Site in a private cloud + /// Create a HcxEnterpriseSite /// /// /// The operations group for this extension method. @@ -137,10 +137,10 @@ public static HcxEnterpriseSite CreateOrUpdate(this IHcxEnterpriseSitesOperation /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the HCX Enterprise Site /// /// /// The cancellation token. @@ -154,7 +154,7 @@ public static HcxEnterpriseSite CreateOrUpdate(this IHcxEnterpriseSitesOperation } /// - /// Delete an HCX Enterprise Site in a private cloud + /// Delete a HcxEnterpriseSite /// /// /// The operations group for this extension method. @@ -166,7 +166,7 @@ public static HcxEnterpriseSite CreateOrUpdate(this IHcxEnterpriseSitesOperation /// Name of the private cloud /// /// - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the HCX Enterprise Site /// public static void Delete(this IHcxEnterpriseSitesOperations operations, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName) { @@ -174,7 +174,7 @@ public static void Delete(this IHcxEnterpriseSitesOperations operations, string } /// - /// Delete an HCX Enterprise Site in a private cloud + /// Delete a HcxEnterpriseSite /// /// /// The operations group for this extension method. @@ -186,7 +186,7 @@ public static void Delete(this IHcxEnterpriseSitesOperations operations, string /// Name of the private cloud /// /// - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the HCX Enterprise Site /// /// /// The cancellation token. @@ -197,7 +197,7 @@ public static void Delete(this IHcxEnterpriseSitesOperations operations, string } /// - /// List HCX Enterprise Sites in a private cloud + /// List HcxEnterpriseSite resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -211,7 +211,7 @@ public static IPage ListNext(this IHcxEnterpriseSitesOperatio } /// - /// List HCX Enterprise Sites in a private cloud + /// List HcxEnterpriseSite resources by PrivateCloud /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAddonsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAddonsOperations.cs index 33d6b9190e137..960f6709ed960 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAddonsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAddonsOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IAddonsOperations { /// - /// List addons in a private cloud + /// List Addon resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -38,7 +38,7 @@ public partial interface IAddonsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -49,7 +49,7 @@ public partial interface IAddonsOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get an addon by name in a private cloud + /// Get a Addon /// /// /// The name of the resource group. The name is case insensitive. @@ -58,7 +58,7 @@ public partial interface IAddonsOperations /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// /// The headers that will be added to request. @@ -66,7 +66,7 @@ public partial interface IAddonsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,19 +77,19 @@ public partial interface IAddonsOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a addon in a private cloud + /// Create a Addon /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// - /// A addon in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -97,7 +97,7 @@ public partial interface IAddonsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -106,9 +106,9 @@ public partial interface IAddonsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Addon addon, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Addon addon, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a addon in a private cloud + /// Delete a Addon /// /// /// The name of the resource group. The name is case insensitive. @@ -117,7 +117,7 @@ public partial interface IAddonsOperations /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// /// The headers that will be added to request. @@ -125,27 +125,27 @@ public partial interface IAddonsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a addon in a private cloud + /// Create a Addon /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// - /// A addon in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -153,7 +153,7 @@ public partial interface IAddonsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -162,9 +162,9 @@ public partial interface IAddonsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Addon addon, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Addon addon, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a addon in a private cloud + /// Delete a Addon /// /// /// The name of the resource group. The name is case insensitive. @@ -173,7 +173,7 @@ public partial interface IAddonsOperations /// Name of the private cloud /// /// - /// Name of the addon for the private cloud + /// Name of the addon. /// /// /// The headers that will be added to request. @@ -181,15 +181,15 @@ public partial interface IAddonsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string addonName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List addons in a private cloud + /// List Addon resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -200,7 +200,7 @@ public partial interface IAddonsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAuthorizationsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAuthorizationsOperations.cs index d6b64beb94b30..23efb488789a5 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAuthorizationsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAuthorizationsOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IAuthorizationsOperations { /// - /// List ExpressRoute Circuit Authorizations in a private cloud + /// List ExpressRouteAuthorization resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -38,7 +38,7 @@ public partial interface IAuthorizationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -49,8 +49,7 @@ public partial interface IAuthorizationsOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get an ExpressRoute Circuit Authorization by name in a private - /// cloud + /// Get a ExpressRouteAuthorization /// /// /// The name of the resource group. The name is case insensitive. @@ -59,7 +58,7 @@ public partial interface IAuthorizationsOperations /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// /// The headers that will be added to request. @@ -67,7 +66,7 @@ public partial interface IAuthorizationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -78,20 +77,19 @@ public partial interface IAuthorizationsOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update an ExpressRoute Circuit Authorization in a private - /// cloud + /// Create a ExpressRouteAuthorization /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// - /// An ExpressRoute Circuit Authorization + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -99,7 +97,7 @@ public partial interface IAuthorizationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -108,9 +106,9 @@ public partial interface IAuthorizationsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete an ExpressRoute Circuit Authorization in a private cloud + /// Delete a ExpressRouteAuthorization /// /// /// The name of the resource group. The name is case insensitive. @@ -119,7 +117,7 @@ public partial interface IAuthorizationsOperations /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// /// The headers that will be added to request. @@ -127,28 +125,27 @@ public partial interface IAuthorizationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update an ExpressRoute Circuit Authorization in a private - /// cloud + /// Create a ExpressRouteAuthorization /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// - /// An ExpressRoute Circuit Authorization + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -156,7 +153,7 @@ public partial interface IAuthorizationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -165,9 +162,9 @@ public partial interface IAuthorizationsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, ExpressRouteAuthorization authorization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete an ExpressRoute Circuit Authorization in a private cloud + /// Delete a ExpressRouteAuthorization /// /// /// The name of the resource group. The name is case insensitive. @@ -176,7 +173,7 @@ public partial interface IAuthorizationsOperations /// Name of the private cloud /// /// - /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// Name of the ExpressRoute Circuit Authorization /// /// /// The headers that will be added to request. @@ -184,15 +181,15 @@ public partial interface IAuthorizationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List ExpressRoute Circuit Authorizations in a private cloud + /// List ExpressRouteAuthorization resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -203,7 +200,7 @@ public partial interface IAuthorizationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAvsClient.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAvsClient.cs index ed73047e95f42..9f535837469b0 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAvsClient.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IAvsClient.cs @@ -41,14 +41,14 @@ public partial interface IAvsClient : System.IDisposable ServiceClientCredentials Credentials { get; } /// - /// The API version to use for this operation. + /// The ID of the target subscription. The value must be an UUID. /// - string ApiVersion { get; } + System.Guid SubscriptionId { get; set; } /// - /// The ID of the target subscription. + /// The API version to use for this operation. /// - string SubscriptionId { get; set; } + string ApiVersion { get; } /// /// The preferred language for the response. @@ -85,54 +85,59 @@ public partial interface IAvsClient : System.IDisposable IPrivateCloudsOperations PrivateClouds { get; } /// - /// Gets the IClustersOperations. + /// Gets the IAddonsOperations. /// - IClustersOperations Clusters { get; } + IAddonsOperations Addons { get; } /// - /// Gets the IDatastoresOperations. + /// Gets the IAuthorizationsOperations. /// - IDatastoresOperations Datastores { get; } + IAuthorizationsOperations Authorizations { get; } /// - /// Gets the IHcxEnterpriseSitesOperations. + /// Gets the ICloudLinksOperations. /// - IHcxEnterpriseSitesOperations HcxEnterpriseSites { get; } + ICloudLinksOperations CloudLinks { get; } /// - /// Gets the IAuthorizationsOperations. + /// Gets the IClustersOperations. /// - IAuthorizationsOperations Authorizations { get; } + IClustersOperations Clusters { get; } /// - /// Gets the IGlobalReachConnectionsOperations. + /// Gets the IDatastoresOperations. /// - IGlobalReachConnectionsOperations GlobalReachConnections { get; } + IDatastoresOperations Datastores { get; } /// - /// Gets the IWorkloadNetworksOperations. + /// Gets the IPlacementPoliciesOperations. /// - IWorkloadNetworksOperations WorkloadNetworks { get; } + IPlacementPoliciesOperations PlacementPolicies { get; } /// - /// Gets the ICloudLinksOperations. + /// Gets the IVirtualMachinesOperations. /// - ICloudLinksOperations CloudLinks { get; } + IVirtualMachinesOperations VirtualMachines { get; } /// - /// Gets the IAddonsOperations. + /// Gets the IGlobalReachConnectionsOperations. /// - IAddonsOperations Addons { get; } + IGlobalReachConnectionsOperations GlobalReachConnections { get; } /// - /// Gets the IVirtualMachinesOperations. + /// Gets the IHcxEnterpriseSitesOperations. /// - IVirtualMachinesOperations VirtualMachines { get; } + IHcxEnterpriseSitesOperations HcxEnterpriseSites { get; } /// - /// Gets the IPlacementPoliciesOperations. + /// Gets the IIscsiPathsOperations. /// - IPlacementPoliciesOperations PlacementPolicies { get; } + IIscsiPathsOperations IscsiPaths { get; } + + /// + /// Gets the IScriptExecutionsOperations. + /// + IScriptExecutionsOperations ScriptExecutions { get; } /// /// Gets the IScriptPackagesOperations. @@ -145,9 +150,9 @@ public partial interface IAvsClient : System.IDisposable IScriptCmdletsOperations ScriptCmdlets { get; } /// - /// Gets the IScriptExecutionsOperations. + /// Gets the IWorkloadNetworksOperations. /// - IScriptExecutionsOperations ScriptExecutions { get; } + IWorkloadNetworksOperations WorkloadNetworks { get; } } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ICloudLinksOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ICloudLinksOperations.cs index efd3225e758d9..a13800be0b28a 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ICloudLinksOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ICloudLinksOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface ICloudLinksOperations { /// - /// List cloud link in a private cloud + /// List CloudLink resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -38,7 +38,7 @@ public partial interface ICloudLinksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -49,7 +49,7 @@ public partial interface ICloudLinksOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get an cloud link by name in a private cloud + /// Get a CloudLink /// /// /// The name of the resource group. The name is case insensitive. @@ -58,7 +58,7 @@ public partial interface ICloudLinksOperations /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// /// The headers that will be added to request. @@ -66,7 +66,7 @@ public partial interface ICloudLinksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,19 +77,19 @@ public partial interface ICloudLinksOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a cloud link in a private cloud + /// Create a CloudLink /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// - /// A cloud link in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -97,7 +97,7 @@ public partial interface ICloudLinksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -106,9 +106,9 @@ public partial interface ICloudLinksOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, CloudLink cloudLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, CloudLink cloudLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a cloud link in a private cloud + /// Delete a CloudLink /// /// /// The name of the resource group. The name is case insensitive. @@ -117,7 +117,7 @@ public partial interface ICloudLinksOperations /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// /// The headers that will be added to request. @@ -125,27 +125,27 @@ public partial interface ICloudLinksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a cloud link in a private cloud + /// Create a CloudLink /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// - /// A cloud link in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -153,7 +153,7 @@ public partial interface ICloudLinksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -162,9 +162,9 @@ public partial interface ICloudLinksOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, CloudLink cloudLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, CloudLink cloudLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a cloud link in a private cloud + /// Delete a CloudLink /// /// /// The name of the resource group. The name is case insensitive. @@ -173,7 +173,7 @@ public partial interface ICloudLinksOperations /// Name of the private cloud /// /// - /// Name of the cloud link resource + /// Name of the cloud link. /// /// /// The headers that will be added to request. @@ -181,15 +181,15 @@ public partial interface ICloudLinksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string cloudLinkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List cloud link in a private cloud + /// List CloudLink resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -200,7 +200,7 @@ public partial interface ICloudLinksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IClustersOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IClustersOperations.cs index d69c6b729be23..cc90efcd96a56 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IClustersOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IClustersOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IClustersOperations { /// - /// List clusters in a private cloud + /// List Cluster resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -38,7 +38,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -49,7 +49,7 @@ public partial interface IClustersOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a cluster by name in a private cloud + /// Get a Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -58,7 +58,7 @@ public partial interface IClustersOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The headers that will be added to request. @@ -66,7 +66,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,19 +77,19 @@ public partial interface IClustersOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a cluster in a private cloud + /// Create a Cluster /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// A cluster in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -97,7 +97,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -106,9 +106,9 @@ public partial interface IClustersOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Cluster cluster, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Cluster cluster, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Update a cluster in a private cloud + /// Update a Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -117,10 +117,10 @@ public partial interface IClustersOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// The cluster properties to be updated + /// The cluster properties to be updated. /// /// /// The headers that will be added to request. @@ -128,7 +128,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -137,9 +137,34 @@ public partial interface IClustersOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, ClusterUpdate clusterUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, ClusterUpdate clusterUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Cluster + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Name of the cluster + /// + /// + /// 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 privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a cluster in a private cloud + /// List hosts by zone in a cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -148,7 +173,7 @@ public partial interface IClustersOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The headers that will be added to request. @@ -156,27 +181,30 @@ public partial interface IClustersOperations /// /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListZonesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a cluster in a private cloud + /// Create a Cluster /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// A cluster in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -184,7 +212,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -193,9 +221,9 @@ public partial interface IClustersOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Cluster cluster, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Cluster cluster, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Update a cluster in a private cloud + /// Update a Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -204,10 +232,10 @@ public partial interface IClustersOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// The cluster properties to be updated + /// The cluster properties to be updated. /// /// /// The headers that will be added to request. @@ -215,7 +243,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -224,9 +252,9 @@ public partial interface IClustersOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, ClusterUpdate clusterUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, ClusterUpdate clusterUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a cluster in a private cloud + /// Delete a Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -235,7 +263,7 @@ public partial interface IClustersOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The headers that will be added to request. @@ -243,15 +271,15 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List clusters in a private cloud + /// List Cluster resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -262,7 +290,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IDatastoresOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IDatastoresOperations.cs index eb0e4e390d7c6..76c8eaba392ea 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IDatastoresOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IDatastoresOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IDatastoresOperations { /// - /// List datastores in a private cloud cluster + /// List Datastore resources by Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -33,7 +33,7 @@ public partial interface IDatastoresOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The headers that will be added to request. @@ -41,7 +41,7 @@ public partial interface IDatastoresOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -52,7 +52,7 @@ public partial interface IDatastoresOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a datastore in a private cloud cluster + /// Get a Datastore /// /// /// The name of the resource group. The name is case insensitive. @@ -61,10 +61,10 @@ public partial interface IDatastoresOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// /// The headers that will be added to request. @@ -72,7 +72,7 @@ public partial interface IDatastoresOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -83,7 +83,7 @@ public partial interface IDatastoresOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a datastore in a private cloud cluster + /// Create a Datastore /// /// /// The name of the resource group. The name is case insensitive. @@ -92,13 +92,13 @@ public partial interface IDatastoresOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// - /// A datastore in a private cloud cluster + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -106,7 +106,7 @@ public partial interface IDatastoresOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -115,9 +115,9 @@ public partial interface IDatastoresOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Datastore datastore, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Datastore datastore, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a datastore in a private cloud cluster + /// Delete a Datastore /// /// /// The name of the resource group. The name is case insensitive. @@ -126,10 +126,10 @@ public partial interface IDatastoresOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// /// The headers that will be added to request. @@ -137,15 +137,15 @@ public partial interface IDatastoresOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a datastore in a private cloud cluster + /// Create a Datastore /// /// /// The name of the resource group. The name is case insensitive. @@ -154,13 +154,13 @@ public partial interface IDatastoresOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// - /// A datastore in a private cloud cluster + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -168,7 +168,7 @@ public partial interface IDatastoresOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -177,9 +177,9 @@ public partial interface IDatastoresOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Datastore datastore, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Datastore datastore, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a datastore in a private cloud cluster + /// Delete a Datastore /// /// /// The name of the resource group. The name is case insensitive. @@ -188,10 +188,10 @@ public partial interface IDatastoresOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the datastore in the private cloud cluster + /// Name of the datastore /// /// /// The headers that will be added to request. @@ -199,15 +199,15 @@ public partial interface IDatastoresOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List datastores in a private cloud cluster + /// List Datastore resources by Cluster /// /// /// The NextLink from the previous successful call to List operation. @@ -218,7 +218,7 @@ public partial interface IDatastoresOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IGlobalReachConnectionsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IGlobalReachConnectionsOperations.cs index ab9136b335ace..4050f46e8f162 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IGlobalReachConnectionsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IGlobalReachConnectionsOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IGlobalReachConnectionsOperations { /// - /// List global reach connections in a private cloud + /// List GlobalReachConnection resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -38,7 +38,7 @@ public partial interface IGlobalReachConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -49,7 +49,7 @@ public partial interface IGlobalReachConnectionsOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a global reach connection by name in a private cloud + /// Get a GlobalReachConnection /// /// /// The name of the resource group. The name is case insensitive. @@ -58,7 +58,7 @@ public partial interface IGlobalReachConnectionsOperations /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// /// The headers that will be added to request. @@ -66,7 +66,7 @@ public partial interface IGlobalReachConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,19 +77,19 @@ public partial interface IGlobalReachConnectionsOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a global reach connection in a private cloud + /// Create a GlobalReachConnection /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// - /// A global reach connection in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -97,7 +97,7 @@ public partial interface IGlobalReachConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -106,9 +106,9 @@ public partial interface IGlobalReachConnectionsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, GlobalReachConnection globalReachConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, GlobalReachConnection globalReachConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a global reach connection in a private cloud + /// Delete a GlobalReachConnection /// /// /// The name of the resource group. The name is case insensitive. @@ -117,7 +117,7 @@ public partial interface IGlobalReachConnectionsOperations /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// /// The headers that will be added to request. @@ -125,27 +125,27 @@ public partial interface IGlobalReachConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a global reach connection in a private cloud + /// Create a GlobalReachConnection /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// - /// A global reach connection in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -153,7 +153,7 @@ public partial interface IGlobalReachConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -162,9 +162,9 @@ public partial interface IGlobalReachConnectionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, GlobalReachConnection globalReachConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, GlobalReachConnection globalReachConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a global reach connection in a private cloud + /// Delete a GlobalReachConnection /// /// /// The name of the resource group. The name is case insensitive. @@ -173,7 +173,7 @@ public partial interface IGlobalReachConnectionsOperations /// Name of the private cloud /// /// - /// Name of the global reach connection in the private cloud + /// Name of the global reach connection /// /// /// The headers that will be added to request. @@ -181,15 +181,15 @@ public partial interface IGlobalReachConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string globalReachConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List global reach connections in a private cloud + /// List GlobalReachConnection resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -200,7 +200,7 @@ public partial interface IGlobalReachConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IHcxEnterpriseSitesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IHcxEnterpriseSitesOperations.cs index 9a41a4eec5f35..ac99e2d6bf4be 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IHcxEnterpriseSitesOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IHcxEnterpriseSitesOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IHcxEnterpriseSitesOperations { /// - /// List HCX Enterprise Sites in a private cloud + /// List HcxEnterpriseSite resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -38,7 +38,7 @@ public partial interface IHcxEnterpriseSitesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -49,7 +49,7 @@ public partial interface IHcxEnterpriseSitesOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get an HCX Enterprise Site by name in a private cloud + /// Get a HcxEnterpriseSite /// /// /// The name of the resource group. The name is case insensitive. @@ -58,7 +58,7 @@ public partial interface IHcxEnterpriseSitesOperations /// Name of the private cloud /// /// - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the HCX Enterprise Site /// /// /// The headers that will be added to request. @@ -66,7 +66,7 @@ public partial interface IHcxEnterpriseSitesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,16 +77,16 @@ public partial interface IHcxEnterpriseSitesOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update an HCX Enterprise Site in a private cloud + /// Create a HcxEnterpriseSite /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the HCX Enterprise Site /// /// /// The headers that will be added to request. @@ -94,7 +94,7 @@ public partial interface IHcxEnterpriseSitesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -105,7 +105,7 @@ public partial interface IHcxEnterpriseSitesOperations /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete an HCX Enterprise Site in a private cloud + /// Delete a HcxEnterpriseSite /// /// /// The name of the resource group. The name is case insensitive. @@ -114,7 +114,7 @@ public partial interface IHcxEnterpriseSitesOperations /// Name of the private cloud /// /// - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the HCX Enterprise Site /// /// /// The headers that will be added to request. @@ -122,7 +122,7 @@ public partial interface IHcxEnterpriseSitesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -130,7 +130,7 @@ public partial interface IHcxEnterpriseSitesOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List HCX Enterprise Sites in a private cloud + /// List HcxEnterpriseSite resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -141,7 +141,7 @@ public partial interface IHcxEnterpriseSitesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IIscsiPathsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IIscsiPathsOperations.cs new file mode 100644 index 0000000000000..64dced5432b4a --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IIscsiPathsOperations.cs @@ -0,0 +1,199 @@ +// +// 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.Avs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// IscsiPathsOperations operations. + /// + public partial interface IIscsiPathsOperations + { + /// + /// List IscsiPath resources by PrivateCloud + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// 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>> ListByPrivateCloudWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a IscsiPath + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// 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 privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create a IscsiPath + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Resource create parameters. + /// + /// + /// 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 privateCloudName, IscsiPath resource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a IscsiPath + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// 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 privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create a IscsiPath + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Resource create parameters. + /// + /// + /// 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 privateCloudName, IscsiPath resource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a IscsiPath + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// 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 privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List IscsiPath resources by PrivateCloud + /// + /// + /// 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>> ListByPrivateCloudNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ILocationsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ILocationsOperations.cs index dfd3b6412a86f..7b6c8b3c72dde 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ILocationsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ILocationsOperations.cs @@ -24,10 +24,10 @@ namespace Microsoft.Azure.Management.Avs public partial interface ILocationsOperations { /// - /// Return trial status for subscription by region + /// Return quota for subscription by region /// /// - /// Azure region + /// The name of the Azure region. /// /// /// The headers that will be added to request. @@ -35,7 +35,7 @@ public partial interface ILocationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -44,12 +44,15 @@ public partial interface ILocationsOperations /// /// Thrown when a required parameter is null /// - Task> CheckTrialAvailabilityWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CheckQuotaAvailabilityWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Return quota for subscription by region + /// Return trial status for subscription by region /// /// - /// Azure region + /// The name of the Azure region. + /// + /// + /// Optionally, check for a specific SKU /// /// /// The headers that will be added to request. @@ -57,7 +60,7 @@ public partial interface ILocationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -66,6 +69,6 @@ public partial interface ILocationsOperations /// /// Thrown when a required parameter is null /// - Task> CheckQuotaAvailabilityWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CheckTrialAvailabilityWithHttpMessagesAsync(string location, Sku sku = default(Sku), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IOperations.cs index a9c3edc4a3929..ca7b99a719f96 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IOperations { /// - /// Lists all of the available operations + /// List the operations for the provider /// /// /// The headers that will be added to request. @@ -32,7 +32,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -43,7 +43,7 @@ public partial interface IOperations /// Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all of the available operations + /// List the operations for the provider /// /// /// The NextLink from the previous successful call to List operation. @@ -54,7 +54,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IPlacementPoliciesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IPlacementPoliciesOperations.cs index ab3883ca42c32..8e4776744d8ff 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IPlacementPoliciesOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IPlacementPoliciesOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IPlacementPoliciesOperations { /// - /// List placement policies in a private cloud cluster + /// List PlacementPolicy resources by Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -33,7 +33,7 @@ public partial interface IPlacementPoliciesOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The headers that will be added to request. @@ -41,7 +41,7 @@ public partial interface IPlacementPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -52,7 +52,7 @@ public partial interface IPlacementPoliciesOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a placement policy by name in a private cloud cluster + /// Get a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -61,11 +61,10 @@ public partial interface IPlacementPoliciesOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) - /// placement policy + /// Name of the placement policy. /// /// /// The headers that will be added to request. @@ -73,7 +72,7 @@ public partial interface IPlacementPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -84,7 +83,7 @@ public partial interface IPlacementPoliciesOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a placement policy in a private cloud cluster + /// Create a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -93,14 +92,13 @@ public partial interface IPlacementPoliciesOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) - /// placement policy + /// Name of the placement policy. /// /// - /// A placement policy in the private cloud cluster + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -108,7 +106,7 @@ public partial interface IPlacementPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -117,9 +115,9 @@ public partial interface IPlacementPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Update a placement policy in a private cloud cluster + /// Update a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -128,14 +126,13 @@ public partial interface IPlacementPoliciesOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) - /// placement policy + /// Name of the placement policy. /// /// - /// The placement policy properties that may be updated + /// The placement policy properties to be updated. /// /// /// The headers that will be added to request. @@ -143,7 +140,7 @@ public partial interface IPlacementPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -152,9 +149,9 @@ public partial interface IPlacementPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a placement policy in a private cloud cluster + /// Delete a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -163,11 +160,10 @@ public partial interface IPlacementPoliciesOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) - /// placement policy + /// Name of the placement policy. /// /// /// The headers that will be added to request. @@ -175,15 +171,15 @@ public partial interface IPlacementPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a placement policy in a private cloud cluster + /// Create a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -192,14 +188,13 @@ public partial interface IPlacementPoliciesOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) - /// placement policy + /// Name of the placement policy. /// /// - /// A placement policy in the private cloud cluster + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -207,7 +202,7 @@ public partial interface IPlacementPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -216,9 +211,9 @@ public partial interface IPlacementPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Update a placement policy in a private cloud cluster + /// Update a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -227,14 +222,13 @@ public partial interface IPlacementPoliciesOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) - /// placement policy + /// Name of the placement policy. /// /// - /// The placement policy properties that may be updated + /// The placement policy properties to be updated. /// /// /// The headers that will be added to request. @@ -242,7 +236,7 @@ public partial interface IPlacementPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -251,9 +245,9 @@ public partial interface IPlacementPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a placement policy in a private cloud cluster + /// Delete a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -262,11 +256,10 @@ public partial interface IPlacementPoliciesOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) - /// placement policy + /// Name of the placement policy. /// /// /// The headers that will be added to request. @@ -274,15 +267,15 @@ public partial interface IPlacementPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List placement policies in a private cloud cluster + /// List PlacementPolicy resources by Cluster /// /// /// The NextLink from the previous successful call to List operation. @@ -293,7 +286,7 @@ public partial interface IPlacementPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IPrivateCloudsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IPrivateCloudsOperations.cs index 75ef5239f7730..7ea0c82f452d2 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IPrivateCloudsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IPrivateCloudsOperations.cs @@ -24,18 +24,15 @@ namespace Microsoft.Azure.Management.Avs public partial interface IPrivateCloudsOperations { /// - /// List private clouds in a resource group + /// List PrivateCloud resources by subscription ID /// - /// - /// The name of the resource group. The name is case insensitive. - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -44,17 +41,20 @@ public partial interface IPrivateCloudsOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List private clouds in a subscription + /// List PrivateCloud resources by resource group /// + /// + /// The name of the resource group. The name is case insensitive. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -63,9 +63,9 @@ public partial interface IPrivateCloudsOperations /// /// Thrown when a required parameter is null /// - Task>> ListInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a private cloud + /// Get a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -79,7 +79,7 @@ public partial interface IPrivateCloudsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -90,7 +90,7 @@ public partial interface IPrivateCloudsOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a private cloud + /// Create a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -99,7 +99,7 @@ public partial interface IPrivateCloudsOperations /// Name of the private cloud /// /// - /// The private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -107,7 +107,7 @@ public partial interface IPrivateCloudsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -116,9 +116,9 @@ public partial interface IPrivateCloudsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloud privateCloud, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloud privateCloud, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Update a private cloud + /// Update a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -127,7 +127,7 @@ public partial interface IPrivateCloudsOperations /// Name of the private cloud /// /// - /// The private cloud properties to be updated + /// The private cloud properties to be updated. /// /// /// The headers that will be added to request. @@ -135,7 +135,7 @@ public partial interface IPrivateCloudsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -144,9 +144,9 @@ public partial interface IPrivateCloudsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloudUpdate privateCloudUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloudUpdate privateCloudUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a private cloud + /// Delete a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -160,15 +160,15 @@ public partial interface IPrivateCloudsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Rotate the vCenter password + /// List the admin credentials for the private cloud /// /// /// The name of the resource group. The name is case insensitive. @@ -182,13 +182,16 @@ public partial interface IPrivateCloudsOperations /// /// 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 RotateVcenterPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListAdminCredentialsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Rotate the NSX-T Manager password /// @@ -204,15 +207,15 @@ public partial interface IPrivateCloudsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task RotateNsxtPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RotateNsxtPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List the admin credentials for the private cloud + /// Rotate the vCenter password /// /// /// The name of the resource group. The name is case insensitive. @@ -226,18 +229,15 @@ public partial interface IPrivateCloudsOperations /// /// 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> ListAdminCredentialsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RotateVcenterPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a private cloud + /// Create a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -246,7 +246,7 @@ public partial interface IPrivateCloudsOperations /// Name of the private cloud /// /// - /// The private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -254,7 +254,7 @@ public partial interface IPrivateCloudsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -263,9 +263,9 @@ public partial interface IPrivateCloudsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloud privateCloud, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloud privateCloud, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Update a private cloud + /// Update a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -274,7 +274,7 @@ public partial interface IPrivateCloudsOperations /// Name of the private cloud /// /// - /// The private cloud properties to be updated + /// The private cloud properties to be updated. /// /// /// The headers that will be added to request. @@ -282,7 +282,7 @@ public partial interface IPrivateCloudsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -291,9 +291,9 @@ public partial interface IPrivateCloudsOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloudUpdate privateCloudUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloudUpdate privateCloudUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a private cloud + /// Delete a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -307,15 +307,15 @@ public partial interface IPrivateCloudsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Rotate the vCenter password + /// Rotate the NSX-T Manager password /// /// /// The name of the resource group. The name is case insensitive. @@ -329,15 +329,15 @@ public partial interface IPrivateCloudsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginRotateVcenterPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginRotateNsxtPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Rotate the NSX-T Manager password + /// Rotate the vCenter password /// /// /// The name of the resource group. The name is case insensitive. @@ -351,15 +351,15 @@ public partial interface IPrivateCloudsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginRotateNsxtPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginRotateVcenterPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List private clouds in a resource group + /// List PrivateCloud resources by subscription ID /// /// /// The NextLink from the previous successful call to List operation. @@ -370,7 +370,7 @@ public partial interface IPrivateCloudsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -379,9 +379,9 @@ public partial interface IPrivateCloudsOperations /// /// Thrown when a required parameter is null /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List private clouds in a subscription + /// List PrivateCloud resources by resource group /// /// /// The NextLink from the previous successful call to List operation. @@ -392,7 +392,7 @@ public partial interface IPrivateCloudsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -401,6 +401,6 @@ public partial interface IPrivateCloudsOperations /// /// Thrown when a required parameter is null /// - Task>> ListInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptCmdletsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptCmdletsOperations.cs index 4225c4ddf30fe..5fe3dfbc75a2f 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptCmdletsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptCmdletsOperations.cs @@ -24,8 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IScriptCmdletsOperations { /// - /// List script cmdlet resources available for a private cloud to - /// create a script execution resource on a private cloud + /// List ScriptCmdlet resources by ScriptPackage /// /// /// The name of the resource group. The name is case insensitive. @@ -34,7 +33,7 @@ public partial interface IScriptCmdletsOperations /// Name of the private cloud /// /// - /// Name of the script package in the private cloud + /// Name of the script package. /// /// /// The headers that will be added to request. @@ -42,7 +41,7 @@ public partial interface IScriptCmdletsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -53,8 +52,7 @@ public partial interface IScriptCmdletsOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptPackageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Return information about a script cmdlet resource in a specific - /// package on a private cloud + /// Get a ScriptCmdlet /// /// /// The name of the resource group. The name is case insensitive. @@ -63,11 +61,10 @@ public partial interface IScriptCmdletsOperations /// Name of the private cloud /// /// - /// Name of the script package in the private cloud + /// Name of the script package. /// /// - /// Name of the script cmdlet resource in the script package in the - /// private cloud + /// Name of the script cmdlet. /// /// /// The headers that will be added to request. @@ -75,7 +72,7 @@ public partial interface IScriptCmdletsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -86,8 +83,7 @@ public partial interface IScriptCmdletsOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptPackageName, string scriptCmdletName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List script cmdlet resources available for a private cloud to - /// create a script execution resource on a private cloud + /// List ScriptCmdlet resources by ScriptPackage /// /// /// The NextLink from the previous successful call to List operation. @@ -98,7 +94,7 @@ public partial interface IScriptCmdletsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptExecutionsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptExecutionsOperations.cs index 92dde14012daf..c12096f12998a 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptExecutionsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptExecutionsOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IScriptExecutionsOperations { /// - /// List script executions in a private cloud + /// List ScriptExecution resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -38,7 +38,7 @@ public partial interface IScriptExecutionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -49,7 +49,7 @@ public partial interface IScriptExecutionsOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get an script execution by name in a private cloud + /// Get a ScriptExecution /// /// /// The name of the resource group. The name is case insensitive. @@ -58,7 +58,7 @@ public partial interface IScriptExecutionsOperations /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// The headers that will be added to request. @@ -66,7 +66,7 @@ public partial interface IScriptExecutionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,19 +77,19 @@ public partial interface IScriptExecutionsOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a script execution in a private cloud + /// Create a ScriptExecution /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// - /// A script running in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -97,7 +97,7 @@ public partial interface IScriptExecutionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -106,9 +106,9 @@ public partial interface IScriptExecutionsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, ScriptExecution scriptExecution, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, ScriptExecution scriptExecution, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Cancel a ScriptExecution in a private cloud + /// Delete a ScriptExecution /// /// /// The name of the resource group. The name is case insensitive. @@ -117,7 +117,7 @@ public partial interface IScriptExecutionsOperations /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// The headers that will be added to request. @@ -125,13 +125,13 @@ public partial interface IScriptExecutionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Return the logs for a script execution resource /// @@ -142,11 +142,11 @@ public partial interface IScriptExecutionsOperations /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// Name of the desired output stream to return. If not provided, will - /// return all. An empty array will return nothing + /// return all. An empty array will return nothing. /// /// /// The headers that will be added to request. @@ -154,7 +154,7 @@ public partial interface IScriptExecutionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -165,19 +165,19 @@ public partial interface IScriptExecutionsOperations /// Task> GetExecutionLogsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, IList scriptOutputStreamType = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a script execution in a private cloud + /// Create a ScriptExecution /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// - /// A script running in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -185,7 +185,7 @@ public partial interface IScriptExecutionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -194,9 +194,9 @@ public partial interface IScriptExecutionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, ScriptExecution scriptExecution, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, ScriptExecution scriptExecution, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Cancel a ScriptExecution in a private cloud + /// Delete a ScriptExecution /// /// /// The name of the resource group. The name is case insensitive. @@ -205,7 +205,7 @@ public partial interface IScriptExecutionsOperations /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// The headers that will be added to request. @@ -213,15 +213,15 @@ public partial interface IScriptExecutionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List script executions in a private cloud + /// List ScriptExecution resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -232,7 +232,7 @@ public partial interface IScriptExecutionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptPackagesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptPackagesOperations.cs index 45ac3a9fe974c..4ca95ec376dcd 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptPackagesOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IScriptPackagesOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IScriptPackagesOperations { /// - /// List script packages available to run on the private cloud + /// List ScriptPackage resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -38,7 +38,7 @@ public partial interface IScriptPackagesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -49,7 +49,7 @@ public partial interface IScriptPackagesOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a script package available to run on a private cloud + /// Get a ScriptPackage /// /// /// The name of the resource group. The name is case insensitive. @@ -58,7 +58,7 @@ public partial interface IScriptPackagesOperations /// Name of the private cloud /// /// - /// Name of the script package in the private cloud + /// Name of the script package. /// /// /// The headers that will be added to request. @@ -66,7 +66,7 @@ public partial interface IScriptPackagesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,7 +77,7 @@ public partial interface IScriptPackagesOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptPackageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List script packages available to run on the private cloud + /// List ScriptPackage resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -88,7 +88,7 @@ public partial interface IScriptPackagesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IVirtualMachinesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IVirtualMachinesOperations.cs index e7c8f45396771..1da32bdcb4416 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IVirtualMachinesOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IVirtualMachinesOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IVirtualMachinesOperations { /// - /// List of virtual machines in a private cloud cluster + /// List VirtualMachine resources by Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -33,7 +33,7 @@ public partial interface IVirtualMachinesOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The headers that will be added to request. @@ -41,7 +41,7 @@ public partial interface IVirtualMachinesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -52,7 +52,7 @@ public partial interface IVirtualMachinesOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a virtual machine by id in a private cloud cluster + /// Get a VirtualMachine /// /// /// The name of the resource group. The name is case insensitive. @@ -61,10 +61,10 @@ public partial interface IVirtualMachinesOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Virtual Machine identifier + /// ID of the virtual machine. /// /// /// The headers that will be added to request. @@ -72,7 +72,7 @@ public partial interface IVirtualMachinesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -92,14 +92,13 @@ public partial interface IVirtualMachinesOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Virtual Machine identifier + /// ID of the virtual machine. /// /// - /// Whether VM DRS-driven movement is restricted (Enabled) or not - /// (Disabled) + /// The body type of the operation request. /// /// /// The headers that will be added to request. @@ -107,13 +106,13 @@ public partial interface IVirtualMachinesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task RestrictMovementWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RestrictMovementWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Enable or disable DRS-driven VM movement restriction /// @@ -124,14 +123,13 @@ public partial interface IVirtualMachinesOperations /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Virtual Machine identifier + /// ID of the virtual machine. /// /// - /// Whether VM DRS-driven movement is restricted (Enabled) or not - /// (Disabled) + /// The body type of the operation request. /// /// /// The headers that will be added to request. @@ -139,15 +137,15 @@ public partial interface IVirtualMachinesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginRestrictMovementWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginRestrictMovementWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of virtual machines in a private cloud cluster + /// List VirtualMachine resources by Cluster /// /// /// The NextLink from the previous successful call to List operation. @@ -158,7 +156,7 @@ public partial interface IVirtualMachinesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IWorkloadNetworksOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IWorkloadNetworksOperations.cs index 2edbd415feac9..3f8e7739e002b 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IWorkloadNetworksOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IWorkloadNetworksOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public partial interface IWorkloadNetworksOperations { /// - /// List of segments in a private cloud workload network. + /// List WorkloadNetwork resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -38,7 +38,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -47,9 +47,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a segment by id in a private cloud workload network. + /// Get a WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -57,17 +57,13 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display - /// name - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -76,9 +72,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> GetSegmentWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a segment by id in a private cloud workload network. + /// List WorkloadNetworkDhcp resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -86,20 +82,13 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display - /// name - /// - /// - /// NSX Segment - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -108,31 +97,26 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> CreateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a segment by id in a private cloud workload - /// network. + /// Get a WorkloadNetworkDhcp /// /// /// The name of the resource group. The name is case insensitive. /// + /// + /// The ID of the DHCP configuration + /// /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display - /// name - /// - /// - /// NSX Segment - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -141,9 +125,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> UpdateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetDhcpWithHttpMessagesAsync(string resourceGroupName, string dhcpId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a segment by id in a private cloud workload network. + /// Create a WorkloadNetworkDhcp /// /// /// The name of the resource group. The name is case insensitive. @@ -151,9 +135,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display - /// name + /// + /// The ID of the DHCP configuration + /// + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -161,15 +147,18 @@ public partial interface IWorkloadNetworksOperations /// /// 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 DeleteSegmentWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List dhcp in a private cloud workload network. + /// Update a WorkloadNetworkDhcp /// /// /// The name of the resource group. The name is case insensitive. @@ -177,13 +166,19 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// + /// + /// The ID of the DHCP configuration + /// + /// + /// The resource properties to be updated. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -192,15 +187,37 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcpUpdate workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get dhcp by id in a private cloud workload network. + /// Delete a WorkloadNetworkDhcp /// /// /// The name of the resource group. The name is case insensitive. /// + /// + /// Name of the private cloud + /// /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// The ID of the DHCP configuration + /// + /// + /// 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> DeleteDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List WorkloadNetworkDnsService resources by WorkloadNetwork + /// + /// + /// The name of the resource group. The name is case insensitive. /// /// /// Name of the private cloud @@ -211,7 +228,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -220,9 +237,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> GetDhcpWithHttpMessagesAsync(string resourceGroupName, string dhcpId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListDnsServicesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create dhcp by id in a private cloud workload network. + /// Get a WorkloadNetworkDnsService /// /// /// The name of the resource group. The name is case insensitive. @@ -230,11 +247,8 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// - /// - /// NSX DHCP + /// + /// ID of the DNS service. /// /// /// The headers that will be added to request. @@ -242,7 +256,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -251,9 +265,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> CreateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update dhcp by id in a private cloud workload network. + /// Create a WorkloadNetworkDnsService /// /// /// The name of the resource group. The name is case insensitive. @@ -261,11 +275,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// + /// ID of the DNS service. /// - /// - /// NSX DHCP + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -273,7 +287,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -282,9 +296,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> UpdateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete dhcp by id in a private cloud workload network. + /// Update a WorkloadNetworkDnsService /// /// /// The name of the resource group. The name is case insensitive. @@ -292,8 +306,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// + /// ID of the DNS service. + /// + /// + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -301,19 +318,25 @@ public partial interface IWorkloadNetworksOperations /// /// 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 DeleteDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsServiceUpdate workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of gateways in a private cloud workload network. + /// Delete a WorkloadNetworkDnsService /// /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS service. + /// /// /// Name of the private cloud /// @@ -323,18 +346,15 @@ public partial interface IWorkloadNetworksOperations /// /// 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>> ListGatewaysWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteDnsServiceWithHttpMessagesAsync(string resourceGroupName, string dnsServiceId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a gateway by id in a private cloud workload network. + /// List WorkloadNetworkDnsZone resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -342,17 +362,13 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Gateway identifier. Generally the same as the Gateway's display - /// name - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -361,10 +377,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> GetGatewayWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string gatewayId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListDnsZonesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of port mirroring profiles in a private cloud workload - /// network. + /// Get a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. @@ -372,13 +387,16 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// + /// + /// ID of the DNS zone. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -387,10 +405,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListPortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a port mirroring profile by id in a private cloud workload - /// network. + /// Create a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. @@ -398,9 +415,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port - /// Mirroring display name + /// + /// ID of the DNS zone. + /// + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -408,7 +427,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -417,10 +436,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> GetPortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a port mirroring profile by id in a private cloud workload - /// network. + /// Update a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. @@ -428,12 +446,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port - /// Mirroring display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -441,7 +458,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -450,23 +467,40 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> CreatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZoneUpdate workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a port mirroring profile by id in a private cloud - /// workload network. + /// Delete a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS zone. + /// /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port - /// Mirroring display name + /// + /// The headers that will be added to request. /// - /// - /// NSX port mirroring + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeleteDnsZoneWithHttpMessagesAsync(string resourceGroupName, string dnsZoneId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List WorkloadNetworkGateway resources by WorkloadNetwork + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud /// /// /// The headers that will be added to request. @@ -474,7 +508,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -483,36 +517,37 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> UpdatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListGatewaysWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a port mirroring profile by id in a private cloud workload - /// network. + /// Get a WorkloadNetworkGateway /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port - /// Mirroring display name - /// /// /// Name of the private cloud /// + /// + /// The ID of the NSX Gateway + /// /// /// 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 DeletePortMirroringWithHttpMessagesAsync(string resourceGroupName, string portMirroringId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetGatewayWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string gatewayId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of vm groups in a private cloud workload network. + /// List WorkloadNetworkPortMirroring resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -526,7 +561,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -535,9 +570,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListVMGroupsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListPortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a vm group by id in a private cloud workload network. + /// Get a WorkloadNetworkPortMirroring /// /// /// The name of the resource group. The name is case insensitive. @@ -545,9 +580,8 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's - /// display name + /// + /// ID of the NSX port mirroring profile. /// /// /// The headers that will be added to request. @@ -555,7 +589,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -564,9 +598,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> GetVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetPortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a vm group by id in a private cloud workload network. + /// Create a WorkloadNetworkPortMirroring /// /// /// The name of the resource group. The name is case insensitive. @@ -574,12 +608,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's - /// display name + /// + /// ID of the NSX port mirroring profile. /// - /// - /// NSX VM Group + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -587,7 +620,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -596,10 +629,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> CreateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a vm group by id in a private cloud workload - /// network. + /// Update a WorkloadNetworkPortMirroring /// /// /// The name of the resource group. The name is case insensitive. @@ -607,12 +639,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's - /// display name + /// + /// ID of the NSX port mirroring profile. /// - /// - /// NSX VM Group + /// + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -620,7 +651,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -629,16 +660,15 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> UpdateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroringUpdate workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a vm group by id in a private cloud workload network. + /// Delete a WorkloadNetworkPortMirroring /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's - /// display name + /// + /// ID of the NSX port mirroring profile. /// /// /// Name of the private cloud @@ -649,15 +679,15 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task DeleteVMGroupWithHttpMessagesAsync(string resourceGroupName, string vmGroupId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeletePortMirroringWithHttpMessagesAsync(string resourceGroupName, string portMirroringId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of virtual machines in a private cloud workload network. + /// List WorkloadNetworkPublicIP resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -671,7 +701,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -680,9 +710,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListVirtualMachinesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListPublicIPsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a virtual machine by id in a private cloud workload network. + /// Get a WorkloadNetworkPublicIP /// /// /// The name of the resource group. The name is case insensitive. @@ -690,8 +720,8 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// Virtual Machine identifier + /// + /// ID of the DNS zone. /// /// /// The headers that will be added to request. @@ -699,7 +729,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -708,9 +738,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> GetVirtualMachineWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string virtualMachineId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetPublicIPWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string publicIPId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of DNS services in a private cloud workload network. + /// Create a WorkloadNetworkPublicIP /// /// /// The name of the resource group. The name is case insensitive. @@ -718,13 +748,19 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// + /// + /// ID of the DNS zone. + /// + /// + /// Resource create parameters. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -733,38 +769,34 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListDnsServicesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreatePublicIPWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a DNS service by id in a private cloud workload network. + /// Delete a WorkloadNetworkPublicIP /// /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS zone. + /// /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's - /// display name - /// /// /// 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> GetDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeletePublicIPWithHttpMessagesAsync(string resourceGroupName, string publicIPId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a DNS service by id in a private cloud workload network. + /// List WorkloadNetworkSegment resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -772,20 +804,13 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's - /// display name - /// - /// - /// NSX DNS Service - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -794,10 +819,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> CreateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a DNS service by id in a private cloud workload - /// network. + /// Get a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. @@ -805,12 +829,8 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's - /// display name - /// - /// - /// NSX DNS Service + /// + /// The ID of the NSX Segment /// /// /// The headers that will be added to request. @@ -818,7 +838,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -827,35 +847,40 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> UpdateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetSegmentWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a DNS service by id in a private cloud workload network. + /// Create a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's - /// display name - /// /// /// Name of the private cloud /// + /// + /// The ID of the NSX Segment + /// + /// + /// Resource create parameters. + /// /// /// 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 DeleteDnsServiceWithHttpMessagesAsync(string resourceGroupName, string dnsServiceId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of DNS zones in a private cloud workload network. + /// Update a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. @@ -863,13 +888,19 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// + /// + /// The ID of the NSX Segment + /// + /// + /// The resource properties to be updated. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -878,9 +909,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListDnsZonesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegmentUpdate workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a DNS zone by id in a private cloud workload network. + /// Delete a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. @@ -888,9 +919,8 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's - /// display name + /// + /// The ID of the NSX Segment /// /// /// The headers that will be added to request. @@ -898,18 +928,15 @@ public partial interface IWorkloadNetworksOperations /// /// 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> GetDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteSegmentWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a DNS zone by id in a private cloud workload network. + /// List WorkloadNetworkVirtualMachine resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -917,20 +944,13 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's - /// display name - /// - /// - /// NSX DNS Zone - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -939,10 +959,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> CreateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListVirtualMachinesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a DNS zone by id in a private cloud workload - /// network. + /// Get a WorkloadNetworkVirtualMachine /// /// /// The name of the resource group. The name is case insensitive. @@ -950,12 +969,8 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's - /// display name - /// - /// - /// NSX DNS Zone + /// + /// ID of the virtual machine. /// /// /// The headers that will be added to request. @@ -963,7 +978,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -972,17 +987,13 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> UpdateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetVirtualMachineWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string virtualMachineId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a DNS zone by id in a private cloud workload network. + /// List WorkloadNetworkVMGroup resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's - /// display name - /// /// /// Name of the private cloud /// @@ -992,15 +1003,18 @@ public partial interface IWorkloadNetworksOperations /// /// 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 DeleteDnsZoneWithHttpMessagesAsync(string resourceGroupName, string dnsZoneId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListVMGroupsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of Public IP Blocks in a private cloud workload network. + /// Get a WorkloadNetworkVMGroup /// /// /// The name of the resource group. The name is case insensitive. @@ -1008,13 +1022,16 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// + /// + /// ID of the VM group. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1023,9 +1040,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListPublicIPsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a Public IP Block by id in a private cloud workload network. + /// Create a WorkloadNetworkVMGroup /// /// /// The name of the resource group. The name is case insensitive. @@ -1033,9 +1050,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP - /// Block's display name + /// + /// ID of the VM group. + /// + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -1043,7 +1062,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1052,9 +1071,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> GetPublicIPWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string publicIPId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a Public IP Block by id in a private cloud workload network. + /// Update a WorkloadNetworkVMGroup /// /// /// The name of the resource group. The name is case insensitive. @@ -1062,12 +1081,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP - /// Block's display name + /// + /// ID of the VM group. /// - /// - /// NSX Public IP Block + /// + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -1075,7 +1093,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1084,16 +1102,15 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> CreatePublicIPWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroupUpdate workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a Public IP Block by id in a private cloud workload network. + /// Delete a WorkloadNetworkVMGroup /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP - /// Block's display name + /// + /// ID of the VM group. /// /// /// Name of the private cloud @@ -1104,15 +1121,15 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task DeletePublicIPWithHttpMessagesAsync(string resourceGroupName, string publicIPId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteVMGroupWithHttpMessagesAsync(string resourceGroupName, string vmGroupId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a segment by id in a private cloud workload network. + /// Create a WorkloadNetworkDhcp /// /// /// The name of the resource group. The name is case insensitive. @@ -1120,12 +1137,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display - /// name + /// + /// The ID of the DHCP configuration /// - /// - /// NSX Segment + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -1133,7 +1149,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1142,10 +1158,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a segment by id in a private cloud workload - /// network. + /// Update a WorkloadNetworkDhcp /// /// /// The name of the resource group. The name is case insensitive. @@ -1153,12 +1168,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display - /// name + /// + /// The ID of the DHCP configuration /// - /// - /// NSX Segment + /// + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -1166,7 +1180,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1175,9 +1189,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcpUpdate workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a segment by id in a private cloud workload network. + /// Delete a WorkloadNetworkDhcp /// /// /// The name of the resource group. The name is case insensitive. @@ -1185,9 +1199,8 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display - /// name + /// + /// The ID of the DHCP configuration /// /// /// The headers that will be added to request. @@ -1195,15 +1208,15 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteSegmentWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create dhcp by id in a private cloud workload network. + /// Create a WorkloadNetworkDnsService /// /// /// The name of the resource group. The name is case insensitive. @@ -1211,11 +1224,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// + /// ID of the DNS service. /// - /// - /// NSX DHCP + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -1223,7 +1236,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1232,9 +1245,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update dhcp by id in a private cloud workload network. + /// Update a WorkloadNetworkDnsService /// /// /// The name of the resource group. The name is case insensitive. @@ -1242,11 +1255,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// + /// ID of the DNS service. /// - /// - /// NSX DHCP + /// + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -1254,7 +1267,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1263,35 +1276,34 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsServiceUpdate workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete dhcp by id in a private cloud workload network. + /// Delete a WorkloadNetworkDnsService /// /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS service. + /// /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// /// /// 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 BeginDeleteDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteDnsServiceWithHttpMessagesAsync(string resourceGroupName, string dnsServiceId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a port mirroring profile by id in a private cloud workload - /// network. + /// Create a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. @@ -1299,12 +1311,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port - /// Mirroring display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -1312,7 +1323,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1321,10 +1332,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a port mirroring profile by id in a private cloud - /// workload network. + /// Update a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. @@ -1332,12 +1342,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port - /// Mirroring display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -1345,7 +1354,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1354,17 +1363,15 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZoneUpdate workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a port mirroring profile by id in a private cloud workload - /// network. + /// Delete a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port - /// Mirroring display name + /// + /// ID of the DNS zone. /// /// /// Name of the private cloud @@ -1375,15 +1382,15 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeletePortMirroringWithHttpMessagesAsync(string resourceGroupName, string portMirroringId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteDnsZoneWithHttpMessagesAsync(string resourceGroupName, string dnsZoneId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a vm group by id in a private cloud workload network. + /// Create a WorkloadNetworkPortMirroring /// /// /// The name of the resource group. The name is case insensitive. @@ -1391,12 +1398,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's - /// display name + /// + /// ID of the NSX port mirroring profile. /// - /// - /// NSX VM Group + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -1404,7 +1410,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1413,10 +1419,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a vm group by id in a private cloud workload - /// network. + /// Update a WorkloadNetworkPortMirroring /// /// /// The name of the resource group. The name is case insensitive. @@ -1424,12 +1429,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's - /// display name + /// + /// ID of the NSX port mirroring profile. /// - /// - /// NSX VM Group + /// + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -1437,7 +1441,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1446,16 +1450,15 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroringUpdate workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a vm group by id in a private cloud workload network. + /// Delete a WorkloadNetworkPortMirroring /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's - /// display name + /// + /// ID of the NSX port mirroring profile. /// /// /// Name of the private cloud @@ -1466,15 +1469,15 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteVMGroupWithHttpMessagesAsync(string resourceGroupName, string vmGroupId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeletePortMirroringWithHttpMessagesAsync(string resourceGroupName, string portMirroringId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a DNS service by id in a private cloud workload network. + /// Create a WorkloadNetworkPublicIP /// /// /// The name of the resource group. The name is case insensitive. @@ -1482,12 +1485,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's - /// display name + /// + /// ID of the DNS zone. /// - /// - /// NSX DNS Service + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -1495,7 +1497,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1504,68 +1506,65 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreatePublicIPWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a DNS service by id in a private cloud workload - /// network. + /// Delete a WorkloadNetworkPublicIP /// /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS zone. + /// /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's - /// display name - /// - /// - /// NSX DNS 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> BeginUpdateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeletePublicIPWithHttpMessagesAsync(string resourceGroupName, string publicIPId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a DNS service by id in a private cloud workload network. + /// Create a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's - /// display name - /// /// /// Name of the private cloud /// + /// + /// The ID of the NSX Segment + /// + /// + /// Resource create parameters. + /// /// /// 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 BeginDeleteDnsServiceWithHttpMessagesAsync(string resourceGroupName, string dnsServiceId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a DNS zone by id in a private cloud workload network. + /// Update a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. @@ -1573,12 +1572,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's - /// display name + /// + /// The ID of the NSX Segment /// - /// - /// NSX DNS Zone + /// + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -1586,7 +1584,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1595,10 +1593,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegmentUpdate workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update a DNS zone by id in a private cloud workload - /// network. + /// Delete a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. @@ -1606,12 +1603,8 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's - /// display name - /// - /// - /// NSX DNS Zone + /// + /// The ID of the NSX Segment /// /// /// The headers that will be added to request. @@ -1619,44 +1612,46 @@ public partial interface IWorkloadNetworksOperations /// /// 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> BeginUpdateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteSegmentWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a DNS zone by id in a private cloud workload network. + /// Create a WorkloadNetworkVMGroup /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's - /// display name - /// /// /// Name of the private cloud /// + /// + /// ID of the VM group. + /// + /// + /// Resource create parameters. + /// /// /// 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 BeginDeleteDnsZoneWithHttpMessagesAsync(string resourceGroupName, string dnsZoneId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a Public IP Block by id in a private cloud workload network. + /// Update a WorkloadNetworkVMGroup /// /// /// The name of the resource group. The name is case insensitive. @@ -1664,12 +1659,11 @@ public partial interface IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP - /// Block's display name + /// + /// ID of the VM group. /// - /// - /// NSX Public IP Block + /// + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -1677,7 +1671,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1686,16 +1680,15 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreatePublicIPWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroupUpdate workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete a Public IP Block by id in a private cloud workload network. + /// Delete a WorkloadNetworkVMGroup /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP - /// Block's display name + /// + /// ID of the VM group. /// /// /// Name of the private cloud @@ -1706,15 +1699,15 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task BeginDeletePublicIPWithHttpMessagesAsync(string resourceGroupName, string publicIPId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteVMGroupWithHttpMessagesAsync(string resourceGroupName, string vmGroupId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of segments in a private cloud workload network. + /// List WorkloadNetwork resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -1725,7 +1718,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1734,9 +1727,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListSegmentsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List dhcp in a private cloud workload network. + /// List WorkloadNetworkDhcp resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -1747,7 +1740,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1758,7 +1751,7 @@ public partial interface IWorkloadNetworksOperations /// Task>> ListDhcpNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of gateways in a private cloud workload network. + /// List WorkloadNetworkDnsService resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -1769,7 +1762,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1778,10 +1771,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListGatewaysNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListDnsServicesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of port mirroring profiles in a private cloud workload - /// network. + /// List WorkloadNetworkDnsZone resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -1792,7 +1784,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1801,9 +1793,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListPortMirroringNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListDnsZonesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of vm groups in a private cloud workload network. + /// List WorkloadNetworkGateway resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -1814,7 +1806,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1823,9 +1815,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListVMGroupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListGatewaysNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of virtual machines in a private cloud workload network. + /// List WorkloadNetworkPortMirroring resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -1836,7 +1828,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1845,9 +1837,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListVirtualMachinesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListPortMirroringNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of DNS services in a private cloud workload network. + /// List WorkloadNetworkPublicIP resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -1858,7 +1850,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1867,9 +1859,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListDnsServicesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListPublicIPsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of DNS zones in a private cloud workload network. + /// List WorkloadNetworkSegment resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -1880,7 +1872,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1889,9 +1881,9 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListDnsZonesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListSegmentsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of Public IP Blocks in a private cloud workload network. + /// List WorkloadNetworkVirtualMachine resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -1902,7 +1894,7 @@ public partial interface IWorkloadNetworksOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1911,6 +1903,28 @@ public partial interface IWorkloadNetworksOperations /// /// Thrown when a required parameter is null /// - Task>> ListPublicIPsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListVirtualMachinesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List WorkloadNetworkVMGroup resources by WorkloadNetwork + /// + /// + /// 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>> ListVMGroupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IscsiPathsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IscsiPathsOperations.cs new file mode 100644 index 0000000000000..e1b1ae1041c1c --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IscsiPathsOperations.cs @@ -0,0 +1,1158 @@ +// +// 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.Avs +{ + 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; + + /// + /// IscsiPathsOperations operations. + /// + internal partial class IscsiPathsOperations : IServiceOperations, IIscsiPathsOperations + { + /// + /// Initializes a new instance of the IscsiPathsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal IscsiPathsOperations(AvsClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AvsClient + /// + public AvsClient Client { get; private set; } + + /// + /// List IscsiPath resources by PrivateCloud + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// 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>> ListByPrivateCloudWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByPrivateCloud", 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.AVS/privateClouds/{privateCloudName}/iscsiPaths").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Get a IscsiPath + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// 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 privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + 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.AVS/privateClouds/{privateCloudName}/iscsiPaths/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Create a IscsiPath + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Resource create parameters. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, IscsiPath resource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, resource, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a IscsiPath + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create a IscsiPath + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Resource create parameters. + /// + /// + /// 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 privateCloudName, IscsiPath resource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } + if (resource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resource"); + } + if (resource != null) + { + resource.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("resource", resource); + 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.AVS/privateClouds/{privateCloudName}/iscsiPaths/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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(resource != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(resource, 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a IscsiPath + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// 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 privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + 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.AVS/privateClouds/{privateCloudName}/iscsiPaths/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List IscsiPath resources by PrivateCloud + /// + /// + /// 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>> ListByPrivateCloudNextWithHttpMessagesAsync(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, "ListByPrivateCloudNext", 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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/avs/Microsoft.Azure.Management.Avs/src/Generated/IscsiPathsOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IscsiPathsOperationsExtensions.cs new file mode 100644 index 0000000000000..9ab4204403d98 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/IscsiPathsOperationsExtensions.cs @@ -0,0 +1,311 @@ +// +// 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.Avs +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for IscsiPathsOperations. + /// + public static partial class IscsiPathsOperationsExtensions + { + /// + /// List IscsiPath resources by PrivateCloud + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + public static IPage ListByPrivateCloud(this IIscsiPathsOperations operations, string resourceGroupName, string privateCloudName) + { + return operations.ListByPrivateCloudAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + } + + /// + /// List IscsiPath resources by PrivateCloud + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// The cancellation token. + /// + public static async Task> ListByPrivateCloudAsync(this IIscsiPathsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByPrivateCloudWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a IscsiPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + public static IscsiPath Get(this IIscsiPathsOperations operations, string resourceGroupName, string privateCloudName) + { + return operations.GetAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + } + + /// + /// Get a IscsiPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IIscsiPathsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create a IscsiPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Resource create parameters. + /// + public static IscsiPath CreateOrUpdate(this IIscsiPathsOperations operations, string resourceGroupName, string privateCloudName, IscsiPath resource) + { + return operations.CreateOrUpdateAsync(resourceGroupName, privateCloudName, resource).GetAwaiter().GetResult(); + } + + /// + /// Create a IscsiPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Resource create parameters. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IIscsiPathsOperations operations, string resourceGroupName, string privateCloudName, IscsiPath resource, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, resource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a IscsiPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + public static IscsiPathsDeleteHeaders Delete(this IIscsiPathsOperations operations, string resourceGroupName, string privateCloudName) + { + return operations.DeleteAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + } + + /// + /// Delete a IscsiPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IIscsiPathsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// Create a IscsiPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Resource create parameters. + /// + public static IscsiPath BeginCreateOrUpdate(this IIscsiPathsOperations operations, string resourceGroupName, string privateCloudName, IscsiPath resource) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, privateCloudName, resource).GetAwaiter().GetResult(); + } + + /// + /// Create a IscsiPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// Resource create parameters. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IIscsiPathsOperations operations, string resourceGroupName, string privateCloudName, IscsiPath resource, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, resource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a IscsiPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + public static IscsiPathsDeleteHeaders BeginDelete(this IIscsiPathsOperations operations, string resourceGroupName, string privateCloudName) + { + return operations.BeginDeleteAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + } + + /// + /// Delete a IscsiPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IIscsiPathsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// List IscsiPath resources by PrivateCloud + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByPrivateCloudNext(this IIscsiPathsOperations operations, string nextPageLink) + { + return operations.ListByPrivateCloudNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List IscsiPath resources by PrivateCloud + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByPrivateCloudNextAsync(this IIscsiPathsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByPrivateCloudNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/LocationsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/LocationsOperations.cs index fffd5e9e857e0..fc6eaa89daeb4 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/LocationsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/LocationsOperations.cs @@ -51,10 +51,10 @@ internal LocationsOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// Return trial status for subscription by region + /// Return quota for subscription by region /// /// - /// Azure region + /// The name of the Azure region. /// /// /// Headers that will be added to request. @@ -62,7 +62,7 @@ internal LocationsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,32 +77,28 @@ internal LocationsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckTrialAvailabilityWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CheckQuotaAvailabilityWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (location == null) { throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - if (Client.ApiVersion == null) + if (location != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) + if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.MinLength, "location", 1); } } // Tracing @@ -114,12 +110,12 @@ internal LocationsOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckTrialAvailability", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CheckQuotaAvailability", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -186,14 +182,13 @@ internal LocationsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -203,10 +198,6 @@ internal LocationsOperations(AvsClient client) } 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); @@ -219,7 +210,7 @@ internal LocationsOperations(AvsClient 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")) @@ -232,7 +223,7 @@ internal LocationsOperations(AvsClient 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) { @@ -252,10 +243,13 @@ internal LocationsOperations(AvsClient client) } /// - /// Return quota for subscription by region + /// Return trial status for subscription by region /// /// - /// Azure region + /// The name of the Azure region. + /// + /// + /// Optionally, check for a specific SKU /// /// /// Headers that will be added to request. @@ -263,7 +257,7 @@ internal LocationsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -278,34 +272,34 @@ internal LocationsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckQuotaAvailabilityWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CheckTrialAvailabilityWithHttpMessagesAsync(string location, Sku sku = default(Sku), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (location == null) { throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (location != null) { - if (Client.ApiVersion.Length < 1) + if (location.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.MinLength, "location", 1); } } + if (sku != null) + { + sku.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -314,13 +308,14 @@ internal LocationsOperations(AvsClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); + tracingParameters.Add("sku", sku); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckQuotaAvailability", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CheckTrialAvailability", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -365,6 +360,12 @@ internal LocationsOperations(AvsClient client) // Serialize Request string _requestContent = null; + if(sku != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(sku, 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) { @@ -387,14 +388,13 @@ internal LocationsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -404,10 +404,6 @@ internal LocationsOperations(AvsClient client) } 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); @@ -420,7 +416,7 @@ internal LocationsOperations(AvsClient 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")) @@ -433,7 +429,7 @@ internal LocationsOperations(AvsClient 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/avs/Microsoft.Azure.Management.Avs/src/Generated/LocationsOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/LocationsOperationsExtensions.cs index 4904021c1aa10..6aa7346a914ff 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/LocationsOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/LocationsOperationsExtensions.cs @@ -22,68 +22,74 @@ namespace Microsoft.Azure.Management.Avs public static partial class LocationsOperationsExtensions { /// - /// Return trial status for subscription by region + /// Return quota for subscription by region /// /// /// The operations group for this extension method. /// /// - /// Azure region + /// The name of the Azure region. /// - public static Trial CheckTrialAvailability(this ILocationsOperations operations, string location) + public static Quota CheckQuotaAvailability(this ILocationsOperations operations, string location) { - return operations.CheckTrialAvailabilityAsync(location).GetAwaiter().GetResult(); + return operations.CheckQuotaAvailabilityAsync(location).GetAwaiter().GetResult(); } /// - /// Return trial status for subscription by region + /// Return quota for subscription by region /// /// /// The operations group for this extension method. /// /// - /// Azure region + /// The name of the Azure region. /// /// /// The cancellation token. /// - public static async Task CheckTrialAvailabilityAsync(this ILocationsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CheckQuotaAvailabilityAsync(this ILocationsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CheckTrialAvailabilityWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CheckQuotaAvailabilityWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Return quota for subscription by region + /// Return trial status for subscription by region /// /// /// The operations group for this extension method. /// /// - /// Azure region + /// The name of the Azure region. /// - public static Quota CheckQuotaAvailability(this ILocationsOperations operations, string location) + /// + /// Optionally, check for a specific SKU + /// + public static Trial CheckTrialAvailability(this ILocationsOperations operations, string location, Sku sku = default(Sku)) { - return operations.CheckQuotaAvailabilityAsync(location).GetAwaiter().GetResult(); + return operations.CheckTrialAvailabilityAsync(location, sku).GetAwaiter().GetResult(); } /// - /// Return quota for subscription by region + /// Return trial status for subscription by region /// /// /// The operations group for this extension method. /// /// - /// Azure region + /// The name of the Azure region. + /// + /// + /// Optionally, check for a specific SKU /// /// /// The cancellation token. /// - public static async Task CheckQuotaAvailabilityAsync(this ILocationsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CheckTrialAvailabilityAsync(this ILocationsOperations operations, string location, Sku sku = default(Sku), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CheckQuotaAvailabilityWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CheckTrialAvailabilityWithHttpMessagesAsync(location, sku, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ActionType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ActionType.cs new file mode 100644 index 0000000000000..017fb0263fa85 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ActionType.cs @@ -0,0 +1,21 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for ActionType. + /// + public static class ActionType + { + public const string Internal = "Internal"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Addon.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Addon.cs index 9292ce7d47df4..5df5d63ba6d3a 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Addon.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Addon.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Avs.Models /// /// An addon resource /// - public partial class Addon : Resource + public partial class Addon : ProxyResource { /// /// Initializes a new instance of the Addon class. @@ -29,13 +29,18 @@ public Addon() /// /// Initializes a new instance of the Addon class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// The properties of an addon - /// resource - public Addon(string id = default(string), string name = default(string), string type = default(string), AddonProperties properties = default(AddonProperties)) - : base(id, name, type) + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The resource-specific properties for this + /// resource. + public Addon(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), AddonProperties properties = default(AddonProperties)) + : base(id, name, type, systemData) { Properties = properties; CustomInit(); @@ -47,7 +52,7 @@ public Addon() partial void CustomInit(); /// - /// Gets or sets the properties of an addon resource + /// Gets or sets the resource-specific properties for this resource. /// [JsonProperty(PropertyName = "properties")] public AddonProperties Properties { get; set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonArcProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonArcProperties.cs new file mode 100644 index 0000000000000..0a1eb2222fd9a --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonArcProperties.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties of an Arc addon + /// + [Newtonsoft.Json.JsonObject("Arc")] + public partial class AddonArcProperties : AddonProperties + { + /// + /// Initializes a new instance of the AddonArcProperties class. + /// + public AddonArcProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AddonArcProperties class. + /// + /// The state of the addon + /// provisioning. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled', 'Cancelled', 'Building', 'Deleting', 'Updating' + /// The VMware vCenter resource ID + public AddonArcProperties(string provisioningState = default(string), string vCenter = default(string)) + : base(provisioningState) + { + VCenter = vCenter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the VMware vCenter resource ID + /// + [JsonProperty(PropertyName = "vCenter")] + public string VCenter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonHcxProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonHcxProperties.cs index 6925ebc72b24c..44fdb7aecfe3d 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonHcxProperties.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonHcxProperties.cs @@ -35,7 +35,7 @@ public AddonHcxProperties() /// Provider (Enterprise) /// The state of the addon /// provisioning. Possible values include: 'Succeeded', 'Failed', - /// 'Cancelled', 'Building', 'Deleting', 'Updating' + /// 'Canceled', 'Cancelled', 'Building', 'Deleting', 'Updating' public AddonHcxProperties(string offer, string provisioningState = default(string)) : base(provisioningState) { diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonProperties.cs index 5e77708dd55fd..36fdd91b67929 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonProperties.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonProperties.cs @@ -31,7 +31,7 @@ public AddonProperties() /// /// The state of the addon /// provisioning. Possible values include: 'Succeeded', 'Failed', - /// 'Cancelled', 'Building', 'Deleting', 'Updating' + /// 'Canceled', 'Cancelled', 'Building', 'Deleting', 'Updating' public AddonProperties(string provisioningState = default(string)) { ProvisioningState = provisioningState; @@ -45,8 +45,8 @@ public AddonProperties() /// /// Gets the state of the addon provisioning. Possible values include: - /// 'Succeeded', 'Failed', 'Cancelled', 'Building', 'Deleting', - /// 'Updating' + /// 'Succeeded', 'Failed', 'Canceled', 'Cancelled', 'Building', + /// 'Deleting', 'Updating' /// [JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonProvisioningState.cs index 9aab6aecd2d42..1976cef688529 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonProvisioningState.cs @@ -16,11 +16,33 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class AddonProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is cancelled + /// public const string Cancelled = "Cancelled"; + /// + /// is building + /// public const string Building = "Building"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonSrmProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonSrmProperties.cs index c2039dda6ce25..a52f4a25ad43a 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonSrmProperties.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonSrmProperties.cs @@ -32,7 +32,7 @@ public AddonSrmProperties() /// /// The state of the addon /// provisioning. Possible values include: 'Succeeded', 'Failed', - /// 'Cancelled', 'Building', 'Deleting', 'Updating' + /// 'Canceled', 'Cancelled', 'Building', 'Deleting', 'Updating' /// The Site Recovery Manager (SRM) /// license public AddonSrmProperties(string provisioningState = default(string), string licenseKey = default(string)) diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonType.cs new file mode 100644 index 0000000000000..1faaa58d26b7b --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonType.cs @@ -0,0 +1,24 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for AddonType. + /// + public static class AddonType + { + public const string SRM = "SRM"; + public const string VR = "VR"; + public const string HCX = "HCX"; + public const string Arc = "Arc"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonVrProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonVrProperties.cs index dfcb5ac3fd90a..3c62368d2db50 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonVrProperties.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonVrProperties.cs @@ -34,7 +34,7 @@ public AddonVrProperties() /// count /// The state of the addon /// provisioning. Possible values include: 'Succeeded', 'Failed', - /// 'Cancelled', 'Building', 'Deleting', 'Updating' + /// 'Canceled', 'Cancelled', 'Building', 'Deleting', 'Updating' public AddonVrProperties(int vrsCount, string provisioningState = default(string)) : base(provisioningState) { diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonsCreateOrUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonsCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..d7ab0b7f6c33b --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonsCreateOrUpdateHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class AddonsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the AddonsCreateOrUpdateHeaders + /// class. + /// + public AddonsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AddonsCreateOrUpdateHeaders + /// class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public AddonsCreateOrUpdateHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonsDeleteHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonsDeleteHeaders.cs new file mode 100644 index 0000000000000..c47bfbaf591f7 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AddonsDeleteHeaders.cs @@ -0,0 +1,64 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class AddonsDeleteHeaders + { + /// + /// Initializes a new instance of the AddonsDeleteHeaders class. + /// + public AddonsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AddonsDeleteHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public AddonsDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AffinityStrength.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AffinityStrength.cs new file mode 100644 index 0000000000000..1ca1476b52857 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AffinityStrength.cs @@ -0,0 +1,28 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for AffinityStrength. + /// + public static class AffinityStrength + { + /// + /// is should + /// + public const string Should = "Should"; + /// + /// is must + /// + public const string Must = "Must"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AffinityType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AffinityType.cs index 6909957635fe5..bd6dc31f95be3 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AffinityType.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AffinityType.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class AffinityType { + /// + /// is affinity + /// public const string Affinity = "Affinity"; + /// + /// is anti-affinity + /// public const string AntiAffinity = "AntiAffinity"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AuthorizationsCreateOrUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AuthorizationsCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..438f077643354 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AuthorizationsCreateOrUpdateHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class AuthorizationsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the + /// AuthorizationsCreateOrUpdateHeaders class. + /// + public AuthorizationsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AuthorizationsCreateOrUpdateHeaders class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public AuthorizationsCreateOrUpdateHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AuthorizationsDeleteHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AuthorizationsDeleteHeaders.cs new file mode 100644 index 0000000000000..3dd5a50d5e6cd --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AuthorizationsDeleteHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class AuthorizationsDeleteHeaders + { + /// + /// Initializes a new instance of the AuthorizationsDeleteHeaders + /// class. + /// + public AuthorizationsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AuthorizationsDeleteHeaders + /// class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public AuthorizationsDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AvailabilityStrategy.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AvailabilityStrategy.cs index 1a31efe57e512..a6f3fcfb119f0 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AvailabilityStrategy.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AvailabilityStrategy.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class AvailabilityStrategy { + /// + /// in single zone + /// public const string SingleZone = "SingleZone"; + /// + /// in two zones + /// public const string DualZone = "DualZone"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AzureEntityResource.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AzureEntityResource.cs new file mode 100644 index 0000000000000..a8794733b2050 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AzureEntityResource.cs @@ -0,0 +1,64 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Entity Resource + /// + /// + /// The resource model definition for an Azure Resource Manager resource + /// with an etag. + /// + public partial class AzureEntityResource : Resource + { + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + public AzureEntityResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// Resource Etag. + public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string)) + : base(id, name, type, systemData) + { + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Etag. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AzureHybridBenefitType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AzureHybridBenefitType.cs new file mode 100644 index 0000000000000..0c6b8009be0f7 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/AzureHybridBenefitType.cs @@ -0,0 +1,28 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for AzureHybridBenefitType. + /// + public static class AzureHybridBenefitType + { + /// + /// is SqlHost + /// + public const string SqlHost = "SqlHost"; + /// + /// is None + /// + public const string None = "None"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLink.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLink.cs index d223ef852417a..76a51ba347bf8 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLink.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLink.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.Avs.Models /// A cloud link resource /// [Rest.Serialization.JsonTransformation] - public partial class CloudLink : Resource + public partial class CloudLink : ProxyResource { /// /// Initializes a new instance of the CloudLink class. @@ -32,17 +32,26 @@ public CloudLink() /// /// Initializes a new instance of the CloudLink class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled' /// The state of the cloud link. Possible values /// include: 'Active', 'Building', 'Deleting', 'Failed', /// 'Disconnected' /// Identifier of the other private cloud /// participating in the link. - public CloudLink(string id = default(string), string name = default(string), string type = default(string), string status = default(string), string linkedCloud = default(string)) - : base(id, name, type) + public CloudLink(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string status = default(string), string linkedCloud = default(string)) + : base(id, name, type, systemData) { + ProvisioningState = provisioningState; Status = status; LinkedCloud = linkedCloud; CustomInit(); @@ -53,6 +62,13 @@ public CloudLink() /// partial void CustomInit(); + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + /// /// Gets the state of the cloud link. Possible values include: /// 'Active', 'Building', 'Deleting', 'Failed', 'Disconnected' diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinkProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinkProvisioningState.cs new file mode 100644 index 0000000000000..55f766206c3e7 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinkProvisioningState.cs @@ -0,0 +1,32 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for CloudLinkProvisioningState. + /// + public static class CloudLinkProvisioningState + { + /// + /// Resource has been created. + /// + public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// + public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinkStatus.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinkStatus.cs index ca62b15f68a6a..c4e2c0716a793 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinkStatus.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinkStatus.cs @@ -16,10 +16,25 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class CloudLinkStatus { + /// + /// is active + /// public const string Active = "Active"; + /// + /// is building + /// public const string Building = "Building"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; + /// + /// is failed + /// public const string Failed = "Failed"; + /// + /// is disconnected + /// public const string Disconnected = "Disconnected"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinksCreateOrUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinksCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..c8a461bf043b5 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinksCreateOrUpdateHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class CloudLinksCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the CloudLinksCreateOrUpdateHeaders + /// class. + /// + public CloudLinksCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudLinksCreateOrUpdateHeaders + /// class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public CloudLinksCreateOrUpdateHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinksDeleteHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinksDeleteHeaders.cs new file mode 100644 index 0000000000000..1ca1b5d4ace1a --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CloudLinksDeleteHeaders.cs @@ -0,0 +1,64 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class CloudLinksDeleteHeaders + { + /// + /// Initializes a new instance of the CloudLinksDeleteHeaders class. + /// + public CloudLinksDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CloudLinksDeleteHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public CloudLinksDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Cluster.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Cluster.cs index dd401c0c1c2e5..1ebcbe242c3c6 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Cluster.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Cluster.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Avs.Models /// A cluster resource /// [Rest.Serialization.JsonTransformation] - public partial class Cluster : Resource + public partial class Cluster : ProxyResource { /// /// Initializes a new instance of the Cluster class. @@ -34,24 +34,33 @@ public Cluster() /// /// Initializes a new instance of the Cluster class. /// - /// The cluster SKU - /// Resource ID. - /// Resource name. - /// Resource type. + /// The SKU (Stock Keeping Unit) assigned to this + /// resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// The cluster size /// The state of the cluster /// provisioning. Possible values include: 'Succeeded', 'Failed', - /// 'Cancelled', 'Deleting', 'Updating' + /// 'Canceled', 'Cancelled', 'Deleting', 'Updating' /// The identity /// The hosts - public Cluster(Sku sku, string id = default(string), string name = default(string), string type = default(string), int? clusterSize = default(int?), string provisioningState = default(string), int? clusterId = default(int?), IList hosts = default(IList)) - : base(id, name, type) + /// Name of the vsan datastore + /// associated with the cluster + public Cluster(Sku sku, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), int? clusterSize = default(int?), string provisioningState = default(string), int? clusterId = default(int?), IList hosts = default(IList), string vsanDatastoreName = default(string)) + : base(id, name, type, systemData) { - Sku = sku; ClusterSize = clusterSize; ProvisioningState = provisioningState; ClusterId = clusterId; Hosts = hosts; + VsanDatastoreName = vsanDatastoreName; + Sku = sku; CustomInit(); } @@ -60,12 +69,6 @@ public Cluster() /// partial void CustomInit(); - /// - /// Gets or sets the cluster SKU - /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - /// /// Gets or sets the cluster size /// @@ -73,11 +76,12 @@ public Cluster() public int? ClusterSize { get; set; } /// - /// Gets or sets the state of the cluster provisioning. Possible values - /// include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + /// Gets the state of the cluster provisioning. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled', 'Cancelled', + /// 'Deleting', 'Updating' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + public string ProvisioningState { get; private set; } /// /// Gets the identity @@ -91,6 +95,19 @@ public Cluster() [JsonProperty(PropertyName = "properties.hosts")] public IList Hosts { get; set; } + /// + /// Gets or sets name of the vsan datastore associated with the cluster + /// + [JsonProperty(PropertyName = "properties.vsanDatastoreName")] + public string VsanDatastoreName { get; set; } + + /// + /// Gets or sets the SKU (Stock Keeping Unit) assigned to this + /// resource. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + /// /// Validate the object. /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterProvisioningState.cs index c9d9118757b02..5c7fe7bf88003 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterProvisioningState.cs @@ -16,10 +16,29 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class ClusterProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is cancelled + /// public const string Cancelled = "Cancelled"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterUpdate.cs index 9bf31fa13b205..d330b3b2e51b9 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterUpdate.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterUpdate.cs @@ -34,10 +34,13 @@ public ClusterUpdate() /// /// Initializes a new instance of the ClusterUpdate class. /// + /// The SKU (Stock Keeping Unit) assigned to this + /// resource. /// The cluster size /// The hosts - public ClusterUpdate(int? clusterSize = default(int?), IList hosts = default(IList)) + public ClusterUpdate(Sku sku = default(Sku), int? clusterSize = default(int?), IList hosts = default(IList)) { + Sku = sku; ClusterSize = clusterSize; Hosts = hosts; CustomInit(); @@ -48,6 +51,13 @@ public ClusterUpdate() /// partial void CustomInit(); + /// + /// Gets or sets the SKU (Stock Keeping Unit) assigned to this + /// resource. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + /// /// Gets or sets the cluster size /// @@ -60,5 +70,18 @@ public ClusterUpdate() [JsonProperty(PropertyName = "properties.hosts")] public IList Hosts { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Sku != null) + { + Sku.Validate(); + } + } } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterZone.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterZone.cs new file mode 100644 index 0000000000000..b94e4e51c4127 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterZone.cs @@ -0,0 +1,62 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Zone and associated hosts info + /// + public partial class ClusterZone + { + /// + /// Initializes a new instance of the ClusterZone class. + /// + public ClusterZone() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClusterZone class. + /// + /// List of hosts belonging to the availability + /// zone in a cluster + /// Availability zone identifier + public ClusterZone(IList hosts = default(IList), string zone = default(string)) + { + Hosts = hosts; + Zone = zone; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets list of hosts belonging to the availability zone in a cluster + /// + [JsonProperty(PropertyName = "hosts")] + public IList Hosts { get; private set; } + + /// + /// Gets availability zone identifier + /// + [JsonProperty(PropertyName = "zone")] + public string Zone { get; private set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/OperationProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterZoneList.cs similarity index 55% rename from sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/OperationProperties.cs rename to sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterZoneList.cs index 3c2f913b17e10..b1d6486468780 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/OperationProperties.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClusterZoneList.cs @@ -11,29 +11,30 @@ namespace Microsoft.Azure.Management.Avs.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Extra Operation properties + /// List of all zones and associated hosts for a cluster /// - public partial class OperationProperties + public partial class ClusterZoneList { /// - /// Initializes a new instance of the OperationProperties class. + /// Initializes a new instance of the ClusterZoneList class. /// - public OperationProperties() + public ClusterZoneList() { CustomInit(); } /// - /// Initializes a new instance of the OperationProperties class. + /// Initializes a new instance of the ClusterZoneList class. /// - /// Service specifications of the - /// operation - public OperationProperties(ServiceSpecification serviceSpecification = default(ServiceSpecification)) + /// Zone and associated hosts info + public ClusterZoneList(IList zones = default(IList)) { - ServiceSpecification = serviceSpecification; + Zones = zones; CustomInit(); } @@ -43,10 +44,10 @@ public OperationProperties() partial void CustomInit(); /// - /// Gets or sets service specifications of the operation + /// Gets or sets zone and associated hosts info /// - [JsonProperty(PropertyName = "serviceSpecification")] - public ServiceSpecification ServiceSpecification { get; set; } + [JsonProperty(PropertyName = "zones")] + public IList Zones { get; set; } } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClustersCreateOrUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClustersCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..025c57aa29d40 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClustersCreateOrUpdateHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class ClustersCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the ClustersCreateOrUpdateHeaders + /// class. + /// + public ClustersCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClustersCreateOrUpdateHeaders + /// class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public ClustersCreateOrUpdateHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClustersDeleteHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClustersDeleteHeaders.cs new file mode 100644 index 0000000000000..1832086d6e5f0 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClustersDeleteHeaders.cs @@ -0,0 +1,64 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class ClustersDeleteHeaders + { + /// + /// Initializes a new instance of the ClustersDeleteHeaders class. + /// + public ClustersDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClustersDeleteHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public ClustersDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClustersUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClustersUpdateHeaders.cs new file mode 100644 index 0000000000000..76ac52647b04f --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ClustersUpdateHeaders.cs @@ -0,0 +1,64 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Update operation. + /// + public partial class ClustersUpdateHeaders + { + /// + /// Initializes a new instance of the ClustersUpdateHeaders class. + /// + public ClustersUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClustersUpdateHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public ClustersUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CommonClusterProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CommonClusterProperties.cs deleted file mode 100644 index aa02ad36a1361..0000000000000 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CommonClusterProperties.cs +++ /dev/null @@ -1,80 +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.Avs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The common properties of a cluster - /// - public partial class CommonClusterProperties - { - /// - /// Initializes a new instance of the CommonClusterProperties class. - /// - public CommonClusterProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CommonClusterProperties class. - /// - /// The cluster size - /// The state of the cluster - /// provisioning. Possible values include: 'Succeeded', 'Failed', - /// 'Cancelled', 'Deleting', 'Updating' - /// The identity - /// The hosts - public CommonClusterProperties(int? clusterSize = default(int?), string provisioningState = default(string), int? clusterId = default(int?), IList hosts = default(IList)) - { - ClusterSize = clusterSize; - ProvisioningState = provisioningState; - ClusterId = clusterId; - Hosts = hosts; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the cluster size - /// - [JsonProperty(PropertyName = "clusterSize")] - public int? ClusterSize { get; set; } - - /// - /// Gets or sets the state of the cluster provisioning. Possible values - /// include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' - /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; set; } - - /// - /// Gets the identity - /// - [JsonProperty(PropertyName = "clusterId")] - public int? ClusterId { get; private set; } - - /// - /// Gets or sets the hosts - /// - [JsonProperty(PropertyName = "hosts")] - public IList Hosts { get; set; } - - } -} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CreatedByType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CreatedByType.cs new file mode 100644 index 0000000000000..0445d0c4299d8 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,24 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Datastore.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Datastore.cs index d44f040753d17..c19fd6a38f7aa 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Datastore.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Datastore.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.Avs.Models /// A datastore resource /// [Rest.Serialization.JsonTransformation] - public partial class Datastore : Resource + public partial class Datastore : ProxyResource { /// /// Initializes a new instance of the Datastore class. @@ -32,23 +32,31 @@ public Datastore() /// /// Initializes a new instance of the Datastore class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// The state of the datastore /// provisioning. Possible values include: 'Succeeded', 'Failed', - /// 'Cancelled', 'Pending', 'Creating', 'Updating', 'Deleting' + /// 'Canceled', 'Cancelled', 'Pending', 'Creating', 'Updating', + /// 'Deleting' /// An Azure NetApp Files volume /// An iSCSI volume + /// An Elastic SAN volume /// The operational status of the datastore. /// Possible values include: 'Unknown', 'Accessible', 'Inaccessible', /// 'Attached', 'Detached', 'LostCommunication', 'DeadOrError' - public Datastore(string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), NetAppVolume netAppVolume = default(NetAppVolume), DiskPoolVolume diskPoolVolume = default(DiskPoolVolume), string status = default(string)) - : base(id, name, type) + public Datastore(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), NetAppVolume netAppVolume = default(NetAppVolume), DiskPoolVolume diskPoolVolume = default(DiskPoolVolume), ElasticSanVolume elasticSanVolume = default(ElasticSanVolume), string status = default(string)) + : base(id, name, type, systemData) { ProvisioningState = provisioningState; NetAppVolume = netAppVolume; DiskPoolVolume = diskPoolVolume; + ElasticSanVolume = elasticSanVolume; Status = status; CustomInit(); } @@ -60,8 +68,8 @@ public Datastore() /// /// Gets the state of the datastore provisioning. Possible values - /// include: 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Creating', - /// 'Updating', 'Deleting' + /// include: 'Succeeded', 'Failed', 'Canceled', 'Cancelled', 'Pending', + /// 'Creating', 'Updating', 'Deleting' /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } @@ -78,6 +86,12 @@ public Datastore() [JsonProperty(PropertyName = "properties.diskPoolVolume")] public DiskPoolVolume DiskPoolVolume { get; set; } + /// + /// Gets or sets an Elastic SAN volume + /// + [JsonProperty(PropertyName = "properties.elasticSanVolume")] + public ElasticSanVolume ElasticSanVolume { get; set; } + /// /// Gets the operational status of the datastore. Possible values /// include: 'Unknown', 'Accessible', 'Inaccessible', 'Attached', @@ -102,6 +116,10 @@ public virtual void Validate() { DiskPoolVolume.Validate(); } + if (ElasticSanVolume != null) + { + ElasticSanVolume.Validate(); + } } } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoreProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoreProvisioningState.cs index 6820829b58cf9..ca0e75ad5304d 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoreProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoreProvisioningState.cs @@ -16,12 +16,37 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class DatastoreProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is cancelled + /// public const string Cancelled = "Cancelled"; + /// + /// is pending + /// public const string Pending = "Pending"; + /// + /// is creating + /// public const string Creating = "Creating"; + /// + /// is updating + /// public const string Updating = "Updating"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoreStatus.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoreStatus.cs index 74a4c2d613992..5013f01e42b2d 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoreStatus.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoreStatus.cs @@ -16,12 +16,33 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class DatastoreStatus { + /// + /// is unknown + /// public const string Unknown = "Unknown"; + /// + /// is accessible + /// public const string Accessible = "Accessible"; + /// + /// is inaccessible + /// public const string Inaccessible = "Inaccessible"; + /// + /// is attached + /// public const string Attached = "Attached"; + /// + /// is detached + /// public const string Detached = "Detached"; + /// + /// is lost communication + /// public const string LostCommunication = "LostCommunication"; + /// + /// is dead or error + /// public const string DeadOrError = "DeadOrError"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoresCreateOrUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoresCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..1861ef85032dd --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoresCreateOrUpdateHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class DatastoresCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the DatastoresCreateOrUpdateHeaders + /// class. + /// + public DatastoresCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DatastoresCreateOrUpdateHeaders + /// class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public DatastoresCreateOrUpdateHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoresDeleteHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoresDeleteHeaders.cs new file mode 100644 index 0000000000000..6e525d424644a --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DatastoresDeleteHeaders.cs @@ -0,0 +1,64 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class DatastoresDeleteHeaders + { + /// + /// Initializes a new instance of the DatastoresDeleteHeaders class. + /// + public DatastoresDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DatastoresDeleteHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public DatastoresDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DhcpTypeEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DhcpTypeEnum.cs new file mode 100644 index 0000000000000..2ec5a14a41dde --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DhcpTypeEnum.cs @@ -0,0 +1,22 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for DhcpTypeEnum. + /// + public static class DhcpTypeEnum + { + public const string SERVER = "SERVER"; + public const string RELAY = "RELAY"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DiskPoolVolume.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DiskPoolVolume.cs index 5a509417b8eb1..1b7522e97d1c6 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DiskPoolVolume.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DiskPoolVolume.cs @@ -35,8 +35,9 @@ public DiskPoolVolume() /// Name of the LUN to be used for /// datastore /// Mode that describes whether the LUN has - /// to be mounted as a datastore or attached as a LUN. Possible values - /// include: 'MOUNT', 'ATTACH' + /// to be mounted as a datastore or + /// attached as a LUN. Possible values include: 'MOUNT', + /// 'ATTACH' /// Device path public DiskPoolVolume(string targetId, string lunName, string mountOption = default(string), string path = default(string)) { @@ -66,8 +67,8 @@ public DiskPoolVolume() /// /// Gets or sets mode that describes whether the LUN has to be mounted - /// as a datastore or attached as a LUN. Possible values include: - /// 'MOUNT', 'ATTACH' + /// as a datastore or + /// attached as a LUN. Possible values include: 'MOUNT', 'ATTACH' /// [JsonProperty(PropertyName = "mountOption")] public string MountOption { get; set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DnsServiceLogLevelEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DnsServiceLogLevelEnum.cs index bba10d46957b9..49c69ff98fc43 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DnsServiceLogLevelEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DnsServiceLogLevelEnum.cs @@ -16,10 +16,25 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class DnsServiceLogLevelEnum { + /// + /// is debug + /// public const string DEBUG = "DEBUG"; + /// + /// is info + /// public const string INFO = "INFO"; + /// + /// is warning + /// public const string WARNING = "WARNING"; + /// + /// is error + /// public const string ERROR = "ERROR"; + /// + /// is fatal + /// public const string FATAL = "FATAL"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DnsServiceStatusEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DnsServiceStatusEnum.cs index ee1e7c60339a1..5a5d7e5ecf2b7 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DnsServiceStatusEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DnsServiceStatusEnum.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class DnsServiceStatusEnum { + /// + /// is success + /// public const string SUCCESS = "SUCCESS"; + /// + /// is failure + /// public const string FAILURE = "FAILURE"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DnsZoneType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DnsZoneType.cs new file mode 100644 index 0000000000000..034be66219b22 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/DnsZoneType.cs @@ -0,0 +1,28 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for DnsZoneType. + /// + public static class DnsZoneType + { + /// + /// Primary DNS zone. + /// + public const string Public = "Public"; + /// + /// Private DNS zone. + /// + public const string Private = "Private"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ElasticSanVolume.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ElasticSanVolume.cs new file mode 100644 index 0000000000000..98bac2a6a0153 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ElasticSanVolume.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// An Elastic SAN volume from Microsoft.ElasticSan provider + /// + public partial class ElasticSanVolume + { + /// + /// Initializes a new instance of the ElasticSanVolume class. + /// + public ElasticSanVolume() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ElasticSanVolume class. + /// + /// Azure resource ID of the Elastic SAN + /// Volume + public ElasticSanVolume(string targetId) + { + TargetId = targetId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets azure resource ID of the Elastic SAN Volume + /// + [JsonProperty(PropertyName = "targetId")] + public string TargetId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TargetId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetId"); + } + } + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyStatus.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyStatus.cs index 56601b3b2ca59..35e37c4bc28d9 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyStatus.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyStatus.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class EncryptionKeyStatus { + /// + /// is connected + /// public const string Connected = "Connected"; + /// + /// is access denied + /// public const string AccessDenied = "AccessDenied"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyVaultProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyVaultProperties.cs index 9ba727d39b8d5..073acff82dbd9 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyVaultProperties.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionKeyVaultProperties.cs @@ -33,16 +33,19 @@ public EncryptionKeyVaultProperties() /// /// The name of the key. /// The version of the key. + /// The auto-detected version of + /// the key if versionType is auto-detected. /// The URL of the vault. /// The state of key provided. Possible values /// include: 'Connected', 'AccessDenied' /// Property of the key if user provided or /// auto detected. Possible values include: 'Fixed', /// 'AutoDetected' - public EncryptionKeyVaultProperties(string keyName = default(string), string keyVersion = default(string), string keyVaultUrl = default(string), string keyState = default(string), string versionType = default(string)) + public EncryptionKeyVaultProperties(string keyName = default(string), string keyVersion = default(string), string autoDetectedKeyVersion = default(string), string keyVaultUrl = default(string), string keyState = default(string), string versionType = default(string)) { KeyName = keyName; KeyVersion = keyVersion; + AutoDetectedKeyVersion = autoDetectedKeyVersion; KeyVaultUrl = keyVaultUrl; KeyState = keyState; VersionType = versionType; @@ -66,6 +69,13 @@ public EncryptionKeyVaultProperties() [JsonProperty(PropertyName = "keyVersion")] public string KeyVersion { get; set; } + /// + /// Gets the auto-detected version of the key if versionType is + /// auto-detected. + /// + [JsonProperty(PropertyName = "autoDetectedKeyVersion")] + public string AutoDetectedKeyVersion { get; private set; } + /// /// Gets or sets the URL of the vault. /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionState.cs index 0ed8959430785..26d51c8933ea4 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionState.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class EncryptionState { + /// + /// is enabled + /// public const string Enabled = "Enabled"; + /// + /// is disabled + /// public const string Disabled = "Disabled"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionVersionType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionVersionType.cs index 784ca45fd04e2..0e9cf1b0a625d 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionVersionType.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/EncryptionVersionType.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class EncryptionVersionType { + /// + /// is fixed + /// public const string Fixed = "Fixed"; + /// + /// is auto-detected + /// public const string AutoDetected = "AutoDetected"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Endpoints.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Endpoints.cs index 2178ac6b2713a..f2f89f4ddb957 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Endpoints.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Endpoints.cs @@ -29,17 +29,26 @@ public Endpoints() /// /// Initializes a new instance of the Endpoints class. /// - /// Endpoint for the NSX-T Data Center + /// Endpoint FQDN for the NSX-T Data Center /// manager - /// Endpoint for Virtual Center Server + /// Endpoint FQDN for Virtual Center Server /// Appliance - /// Endpoint for the HCX Cloud + /// Endpoint FQDN for the HCX Cloud /// Manager - public Endpoints(string nsxtManager = default(string), string vcsa = default(string), string hcxCloudManager = default(string)) + /// Endpoint IP for the NSX-T Data Center + /// manager + /// Endpoint IP for Virtual Center Server + /// Appliance + /// Endpoint IP for the HCX Cloud + /// Manager + public Endpoints(string nsxtManager = default(string), string vcsa = default(string), string hcxCloudManager = default(string), string nsxtManagerIp = default(string), string vcenterIp = default(string), string hcxCloudManagerIp = default(string)) { NsxtManager = nsxtManager; Vcsa = vcsa; HcxCloudManager = hcxCloudManager; + NsxtManagerIp = nsxtManagerIp; + VcenterIp = vcenterIp; + HcxCloudManagerIp = hcxCloudManagerIp; CustomInit(); } @@ -49,22 +58,40 @@ public Endpoints() partial void CustomInit(); /// - /// Gets endpoint for the NSX-T Data Center manager + /// Gets endpoint FQDN for the NSX-T Data Center manager /// [JsonProperty(PropertyName = "nsxtManager")] public string NsxtManager { get; private set; } /// - /// Gets endpoint for Virtual Center Server Appliance + /// Gets endpoint FQDN for Virtual Center Server Appliance /// [JsonProperty(PropertyName = "vcsa")] public string Vcsa { get; private set; } /// - /// Gets endpoint for the HCX Cloud Manager + /// Gets endpoint FQDN for the HCX Cloud Manager /// [JsonProperty(PropertyName = "hcxCloudManager")] public string HcxCloudManager { get; private set; } + /// + /// Gets endpoint IP for the NSX-T Data Center manager + /// + [JsonProperty(PropertyName = "nsxtManagerIp")] + public string NsxtManagerIp { get; private set; } + + /// + /// Gets endpoint IP for Virtual Center Server Appliance + /// + [JsonProperty(PropertyName = "vcenterIp")] + public string VcenterIp { get; private set; } + + /// + /// Gets endpoint IP for the HCX Cloud Manager + /// + [JsonProperty(PropertyName = "hcxCloudManagerIp")] + public string HcxCloudManagerIp { get; private set; } + } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ErrorDetail.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 0000000000000..a50cdea3db1f5 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ErrorResponse.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ErrorResponse.cs index f90dd8e1653b2..50e2bcf36a3a7 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ErrorResponse.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ErrorResponse.cs @@ -11,17 +11,15 @@ namespace Microsoft.Azure.Management.Avs.Models { using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Error Response + /// Error response /// /// /// Common error response for all Azure Resource Manager APIs to return /// error details for failed operations. (This also follows the OData error - /// response format.) + /// response format.). /// public partial class ErrorResponse { @@ -36,18 +34,10 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// The error code. - /// The error message. - /// The error target. - /// The error details. - /// The error additional info. - public ErrorResponse(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) { - Code = code; - Message = message; - Target = target; - Details = details; - AdditionalInfo = additionalInfo; + Error = error; CustomInit(); } @@ -57,34 +47,10 @@ public ErrorResponse() partial void CustomInit(); /// - /// Gets the error code. + /// Gets or sets the error object. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } - - /// - /// Gets the error message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets the error target. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; private set; } - - /// - /// Gets the error details. - /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; private set; } - - /// - /// Gets the error additional info. - /// - [JsonProperty(PropertyName = "additionalInfo")] - public IList AdditionalInfo { get; private set; } + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ErrorResponseException.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ErrorResponseException.cs new file mode 100644 index 0000000000000..c36a28ff53bff --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ExpressRouteAuthorization.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ExpressRouteAuthorization.cs index adf509db542a9..e2657ecbd0f42 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ExpressRouteAuthorization.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ExpressRouteAuthorization.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.Avs.Models /// ExpressRoute Circuit Authorization /// [Rest.Serialization.JsonTransformation] - public partial class ExpressRouteAuthorization : Resource + public partial class ExpressRouteAuthorization : ProxyResource { /// /// Initializes a new instance of the ExpressRouteAuthorization class. @@ -32,20 +32,25 @@ public ExpressRouteAuthorization() /// /// Initializes a new instance of the ExpressRouteAuthorization class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// The state of the ExpressRoute + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The state of the ExpressRoute /// Circuit Authorization provisioning. Possible values include: - /// 'Succeeded', 'Failed', 'Updating' + /// 'Succeeded', 'Failed', 'Canceled', 'Updating' /// The ID of the /// ExpressRoute Circuit Authorization /// The key of the /// ExpressRoute Circuit Authorization /// The ID of the ExpressRoute /// Circuit - public ExpressRouteAuthorization(string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), string expressRouteAuthorizationId = default(string), string expressRouteAuthorizationKey = default(string), string expressRouteId = default(string)) - : base(id, name, type) + public ExpressRouteAuthorization(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string expressRouteAuthorizationId = default(string), string expressRouteAuthorizationKey = default(string), string expressRouteId = default(string)) + : base(id, name, type, systemData) { ProvisioningState = provisioningState; ExpressRouteAuthorizationId = expressRouteAuthorizationId; @@ -60,9 +65,9 @@ public ExpressRouteAuthorization() partial void CustomInit(); /// - /// Gets the state of the ExpressRoute Circuit Authorization + /// Gets the state of the ExpressRoute Circuit Authorization /// provisioning. Possible values include: 'Succeeded', 'Failed', - /// 'Updating' + /// 'Canceled', 'Updating' /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ExpressRouteAuthorizationProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ExpressRouteAuthorizationProvisioningState.cs index 98ae02036550e..dac1ba69613ae 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ExpressRouteAuthorizationProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ExpressRouteAuthorizationProvisioningState.cs @@ -16,8 +16,21 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class ExpressRouteAuthorizationProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnection.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnection.cs index 7b90bb9eebeb6..84d94fa5d6081 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnection.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnection.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.Avs.Models /// A global reach connection resource /// [Rest.Serialization.JsonTransformation] - public partial class GlobalReachConnection : Resource + public partial class GlobalReachConnection : ProxyResource { /// /// Initializes a new instance of the GlobalReachConnection class. @@ -32,17 +32,23 @@ public GlobalReachConnection() /// /// Initializes a new instance of the GlobalReachConnection class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// The state of the ExpressRoute /// Circuit Authorization provisioning. Possible values include: - /// 'Succeeded', 'Failed', 'Updating' + /// 'Succeeded', 'Failed', 'Canceled', 'Updating' /// The network used for global reach - /// carved out from the original network block provided for the private - /// cloud + /// carved out from the original network block + /// provided for the private cloud /// Authorization key from the peer - /// express route used for the global reach connection + /// express route used for the global reach + /// connection /// The connection status of the /// global reach connection. Possible values include: 'Connected', /// 'Connecting', 'Disconnected' @@ -50,10 +56,10 @@ public GlobalReachConnection() /// ExpressRoute Circuit to peer with in the global reach /// connection /// The ID of the Private Cloud's - /// ExpressRoute Circuit that is participating in the global reach - /// connection - public GlobalReachConnection(string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), string addressPrefix = default(string), string authorizationKey = default(string), string circuitConnectionStatus = default(string), string peerExpressRouteCircuit = default(string), string expressRouteId = default(string)) - : base(id, name, type) + /// ExpressRoute Circuit that is participating in the + /// global reach connection + public GlobalReachConnection(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string addressPrefix = default(string), string authorizationKey = default(string), string circuitConnectionStatus = default(string), string peerExpressRouteCircuit = default(string), string expressRouteId = default(string)) + : base(id, name, type, systemData) { ProvisioningState = provisioningState; AddressPrefix = addressPrefix; @@ -72,21 +78,23 @@ public GlobalReachConnection() /// /// Gets the state of the ExpressRoute Circuit Authorization /// provisioning. Possible values include: 'Succeeded', 'Failed', - /// 'Updating' + /// 'Canceled', 'Updating' /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } /// /// Gets the network used for global reach carved out from the original - /// network block provided for the private cloud + /// network block + /// provided for the private cloud /// [JsonProperty(PropertyName = "properties.addressPrefix")] public string AddressPrefix { get; private set; } /// /// Gets or sets authorization key from the peer express route used for - /// the global reach connection + /// the global reach + /// connection /// [JsonProperty(PropertyName = "properties.authorizationKey")] public string AuthorizationKey { get; set; } @@ -100,14 +108,16 @@ public GlobalReachConnection() /// /// Gets or sets identifier of the ExpressRoute Circuit to peer with in - /// the global reach connection + /// the global reach + /// connection /// [JsonProperty(PropertyName = "properties.peerExpressRouteCircuit")] public string PeerExpressRouteCircuit { get; set; } /// /// Gets or sets the ID of the Private Cloud's ExpressRoute Circuit - /// that is participating in the global reach connection + /// that is participating in the + /// global reach connection /// [JsonProperty(PropertyName = "properties.expressRouteId")] public string ExpressRouteId { get; set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionProvisioningState.cs index 759acff8e4c41..8da67d04d022d 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionProvisioningState.cs @@ -16,8 +16,21 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class GlobalReachConnectionProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionStatus.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionStatus.cs index 65e388184c8ee..3924696c8e938 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionStatus.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionStatus.cs @@ -16,8 +16,17 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class GlobalReachConnectionStatus { + /// + /// is connected + /// public const string Connected = "Connected"; + /// + /// is connecting + /// public const string Connecting = "Connecting"; + /// + /// is disconnected + /// public const string Disconnected = "Disconnected"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionsCreateOrUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionsCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..a0ea8af77a326 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionsCreateOrUpdateHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class GlobalReachConnectionsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the + /// GlobalReachConnectionsCreateOrUpdateHeaders class. + /// + public GlobalReachConnectionsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GlobalReachConnectionsCreateOrUpdateHeaders class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public GlobalReachConnectionsCreateOrUpdateHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionsDeleteHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionsDeleteHeaders.cs new file mode 100644 index 0000000000000..d6ae65a3198bb --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/GlobalReachConnectionsDeleteHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class GlobalReachConnectionsDeleteHeaders + { + /// + /// Initializes a new instance of the + /// GlobalReachConnectionsDeleteHeaders class. + /// + public GlobalReachConnectionsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GlobalReachConnectionsDeleteHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public GlobalReachConnectionsDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/HcxEnterpriseSite.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/HcxEnterpriseSite.cs index 8d88666e5c01e..47182549f4985 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/HcxEnterpriseSite.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/HcxEnterpriseSite.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.Avs.Models /// An HCX Enterprise Site resource /// [Rest.Serialization.JsonTransformation] - public partial class HcxEnterpriseSite : Resource + public partial class HcxEnterpriseSite : ProxyResource { /// /// Initializes a new instance of the HcxEnterpriseSite class. @@ -32,16 +32,25 @@ public HcxEnterpriseSite() /// /// Initializes a new instance of the HcxEnterpriseSite class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled' /// The activation key /// The status of the HCX Enterprise Site. /// Possible values include: 'Available', 'Consumed', 'Deactivated', /// 'Deleted' - public HcxEnterpriseSite(string id = default(string), string name = default(string), string type = default(string), string activationKey = default(string), string status = default(string)) - : base(id, name, type) + public HcxEnterpriseSite(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string activationKey = default(string), string status = default(string)) + : base(id, name, type, systemData) { + ProvisioningState = provisioningState; ActivationKey = activationKey; Status = status; CustomInit(); @@ -52,6 +61,13 @@ public HcxEnterpriseSite() /// partial void CustomInit(); + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + /// /// Gets the activation key /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/HcxEnterpriseSiteProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/HcxEnterpriseSiteProvisioningState.cs new file mode 100644 index 0000000000000..a07eecf65becf --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/HcxEnterpriseSiteProvisioningState.cs @@ -0,0 +1,32 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for HcxEnterpriseSiteProvisioningState. + /// + public static class HcxEnterpriseSiteProvisioningState + { + /// + /// Resource has been created. + /// + public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// + public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/HcxEnterpriseSiteStatus.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/HcxEnterpriseSiteStatus.cs index eb9639dfe67a5..c4731481d0eee 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/HcxEnterpriseSiteStatus.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/HcxEnterpriseSiteStatus.cs @@ -16,9 +16,21 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class HcxEnterpriseSiteStatus { + /// + /// is available + /// public const string Available = "Available"; + /// + /// is consumed + /// public const string Consumed = "Consumed"; + /// + /// is deactivated + /// public const string Deactivated = "Deactivated"; + /// + /// is deleted + /// public const string Deleted = "Deleted"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Identity.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Identity.cs new file mode 100644 index 0000000000000..fe8fa2d4d0e76 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Identity.cs @@ -0,0 +1,72 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Identity for the resource. + /// + public partial class Identity + { + /// + /// Initializes a new instance of the Identity class. + /// + public Identity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Identity class. + /// + /// The principal ID of resource identity. + /// The value must be an UUID. + /// The tenant ID of resource. The value must be + /// an UUID. + /// The identity type. Possible values include: + /// 'SystemAssigned' + public Identity(System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?), ResourceIdentityType? type = default(ResourceIdentityType?)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal ID of resource identity. The value must be an + /// UUID. + /// + [JsonProperty(PropertyName = "principalId")] + public System.Guid? PrincipalId { get; private set; } + + /// + /// Gets the tenant ID of resource. The value must be an UUID. + /// + [JsonProperty(PropertyName = "tenantId")] + public System.Guid? TenantId { get; private set; } + + /// + /// Gets or sets the identity type. Possible values include: + /// 'SystemAssigned' + /// + [JsonProperty(PropertyName = "type")] + public ResourceIdentityType? Type { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IdentitySource.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IdentitySource.cs index 1ae7cd73cd4d9..b60e1c2fe7f9e 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IdentitySource.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IdentitySource.cs @@ -41,10 +41,11 @@ public IdentitySource() /// Protect LDAP communication using SSL certificate /// (LDAPS). Possible values include: 'Enabled', 'Disabled' /// The ID of an Active Directory user with a - /// minimum of read-only access to Base DN for users and group + /// minimum of read-only access to Base + /// DN for users and group /// The password of the Active Directory user - /// with a minimum of read-only access to Base DN for users and - /// groups. + /// with a minimum of read-only access to + /// Base DN for users and groups. public IdentitySource(string name = default(string), string alias = default(string), string domain = default(string), string baseUserDN = default(string), string baseGroupDN = default(string), string primaryServer = default(string), string secondaryServer = default(string), string ssl = default(string), string username = default(string), string password = default(string)) { Name = name; @@ -116,14 +117,16 @@ public IdentitySource() /// /// Gets or sets the ID of an Active Directory user with a minimum of - /// read-only access to Base DN for users and group + /// read-only access to Base + /// DN for users and group /// [JsonProperty(PropertyName = "username")] public string Username { get; set; } /// /// Gets or sets the password of the Active Directory user with a - /// minimum of read-only access to Base DN for users and groups. + /// minimum of read-only access to + /// Base DN for users and groups. /// [JsonProperty(PropertyName = "password")] public string Password { get; set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/InternetEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/InternetEnum.cs index 5b28963cb813b..aa4a8a487bd23 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/InternetEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/InternetEnum.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class InternetEnum { + /// + /// is enabled + /// public const string Enabled = "Enabled"; + /// + /// is disabled + /// public const string Disabled = "Disabled"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPath.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPath.cs new file mode 100644 index 0000000000000..895f8ada44c6d --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPath.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.Avs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// An iSCSI path resource + /// + [Rest.Serialization.JsonTransformation] + public partial class IscsiPath : ProxyResource + { + /// + /// Initializes a new instance of the IscsiPath class. + /// + public IscsiPath() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IscsiPath class. + /// + /// CIDR Block for iSCSI path. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The state of the iSCSI path + /// provisioning. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled', 'Pending', 'Building', 'Deleting', 'Updating' + public IscsiPath(string networkBlock, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string)) + : base(id, name, type, systemData) + { + ProvisioningState = provisioningState; + NetworkBlock = networkBlock; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the state of the iSCSI path provisioning. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled', 'Pending', 'Building', + /// 'Deleting', 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets CIDR Block for iSCSI path. + /// + [JsonProperty(PropertyName = "properties.networkBlock")] + public string NetworkBlock { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (NetworkBlock == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NetworkBlock"); + } + } + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPathProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPathProvisioningState.cs new file mode 100644 index 0000000000000..8c2da23625ff7 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPathProvisioningState.cs @@ -0,0 +1,48 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for IscsiPathProvisioningState. + /// + public static class IscsiPathProvisioningState + { + /// + /// Resource has been created. + /// + public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// + public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is pending + /// + public const string Pending = "Pending"; + /// + /// is building + /// + public const string Building = "Building"; + /// + /// is deleting + /// + public const string Deleting = "Deleting"; + /// + /// is updating + /// + public const string Updating = "Updating"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPathsCreateOrUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPathsCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..a1dabc3d22dbc --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPathsCreateOrUpdateHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class IscsiPathsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the IscsiPathsCreateOrUpdateHeaders + /// class. + /// + public IscsiPathsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IscsiPathsCreateOrUpdateHeaders + /// class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public IscsiPathsCreateOrUpdateHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPathsDeleteHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPathsDeleteHeaders.cs new file mode 100644 index 0000000000000..f68a35ae3aa92 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/IscsiPathsDeleteHeaders.cs @@ -0,0 +1,64 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class IscsiPathsDeleteHeaders + { + /// + /// Initializes a new instance of the IscsiPathsDeleteHeaders class. + /// + public IscsiPathsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IscsiPathsDeleteHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public IscsiPathsDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/LogSpecification.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/LogSpecification.cs deleted file mode 100644 index a7abbd4665d46..0000000000000 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/LogSpecification.cs +++ /dev/null @@ -1,68 +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.Avs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Specifications of the Log for Azure Monitoring - /// - public partial class LogSpecification - { - /// - /// Initializes a new instance of the LogSpecification class. - /// - public LogSpecification() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LogSpecification class. - /// - /// Name of the log - /// Localized friendly display name of the - /// log - /// Blob duration of the log - public LogSpecification(string name = default(string), string displayName = default(string), string blobDuration = default(string)) - { - Name = name; - DisplayName = displayName; - BlobDuration = blobDuration; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the log - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets localized friendly display name of the log - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets blob duration of the log - /// - [JsonProperty(PropertyName = "blobDuration")] - public string BlobDuration { get; set; } - - } -} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ManagementCluster.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ManagementCluster.cs index f02200e4a0b78..562d4a6f34646 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ManagementCluster.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ManagementCluster.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.Avs.Models { + using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -17,7 +18,7 @@ namespace Microsoft.Azure.Management.Avs.Models /// /// The properties of a management cluster /// - public partial class ManagementCluster : CommonClusterProperties + public partial class ManagementCluster { /// /// Initializes a new instance of the ManagementCluster class. @@ -33,12 +34,18 @@ public ManagementCluster() /// The cluster size /// The state of the cluster /// provisioning. Possible values include: 'Succeeded', 'Failed', - /// 'Cancelled', 'Deleting', 'Updating' + /// 'Canceled', 'Cancelled', 'Deleting', 'Updating' /// The identity /// The hosts - public ManagementCluster(int? clusterSize = default(int?), string provisioningState = default(string), int? clusterId = default(int?), IList hosts = default(IList)) - : base(clusterSize, provisioningState, clusterId, hosts) + /// Name of the vsan datastore + /// associated with the cluster + public ManagementCluster(int? clusterSize = default(int?), string provisioningState = default(string), int? clusterId = default(int?), IList hosts = default(IList), string vsanDatastoreName = default(string)) { + ClusterSize = clusterSize; + ProvisioningState = provisioningState; + ClusterId = clusterId; + Hosts = hosts; + VsanDatastoreName = vsanDatastoreName; CustomInit(); } @@ -47,5 +54,37 @@ public ManagementCluster() /// partial void CustomInit(); + /// + /// Gets or sets the cluster size + /// + [JsonProperty(PropertyName = "clusterSize")] + public int? ClusterSize { get; set; } + + /// + /// Gets the state of the cluster provisioning. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled', 'Cancelled', + /// 'Deleting', 'Updating' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the identity + /// + [JsonProperty(PropertyName = "clusterId")] + public int? ClusterId { get; private set; } + + /// + /// Gets or sets the hosts + /// + [JsonProperty(PropertyName = "hosts")] + public IList Hosts { get; set; } + + /// + /// Gets or sets name of the vsan datastore associated with the cluster + /// + [JsonProperty(PropertyName = "vsanDatastoreName")] + public string VsanDatastoreName { get; set; } + } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/MetricDimension.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/MetricDimension.cs deleted file mode 100644 index 9b4fb911f1751..0000000000000 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/MetricDimension.cs +++ /dev/null @@ -1,80 +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.Avs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Specifications of the Dimension of metrics - /// - public partial class MetricDimension - { - /// - /// Initializes a new instance of the MetricDimension class. - /// - public MetricDimension() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetricDimension class. - /// - /// Name of the dimension - /// Localized friendly display name of the - /// dimension - /// Name of the dimension as it appears in - /// MDM - /// A boolean flag indicating - /// whether this dimension should be included for the shoebox export - /// scenario - public MetricDimension(string name = default(string), string displayName = default(string), string internalName = default(string), bool? toBeExportedForShoebox = default(bool?)) - { - Name = name; - DisplayName = displayName; - InternalName = internalName; - ToBeExportedForShoebox = toBeExportedForShoebox; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the dimension - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets localized friendly display name of the dimension - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets name of the dimension as it appears in MDM - /// - [JsonProperty(PropertyName = "internalName")] - public string InternalName { get; set; } - - /// - /// Gets or sets a boolean flag indicating whether this dimension - /// should be included for the shoebox export scenario - /// - [JsonProperty(PropertyName = "toBeExportedForShoebox")] - public bool? ToBeExportedForShoebox { get; set; } - - } -} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/MetricSpecification.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/MetricSpecification.cs deleted file mode 100644 index 2362af571c91f..0000000000000 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/MetricSpecification.cs +++ /dev/null @@ -1,164 +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.Avs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Specifications of the Metrics for Azure Monitoring - /// - public partial class MetricSpecification - { - /// - /// Initializes a new instance of the MetricSpecification class. - /// - public MetricSpecification() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetricSpecification class. - /// - /// Name of the metric - /// Localized friendly display name of the - /// metric - /// Localized friendly description of - /// the metric - /// Unit that makes sense for the metric - /// Name of the metric category that the metric - /// belongs to. A metric can only belong to a single category. - /// Only provide one value for this - /// field. Valid values: Average, Minimum, Maximum, Total, - /// Count. - /// Supported aggregation - /// types - /// Supported time grain - /// types - /// Optional. If set to true, then zero - /// will be returned for time duration where no metric is - /// emitted/published. - /// Dimensions of the metric - /// Whether or not the service - /// is using regional MDM accounts. - /// The name of the MDM account. - /// The name of the MDM - /// namespace. - public MetricSpecification(string name = default(string), string displayName = default(string), string displayDescription = default(string), string unit = default(string), string category = default(string), string aggregationType = default(string), IList supportedAggregationTypes = default(IList), IList supportedTimeGrainTypes = default(IList), bool? fillGapWithZero = default(bool?), IList dimensions = default(IList), string enableRegionalMdmAccount = default(string), string sourceMdmAccount = default(string), string sourceMdmNamespace = default(string)) - { - Name = name; - DisplayName = displayName; - DisplayDescription = displayDescription; - Unit = unit; - Category = category; - AggregationType = aggregationType; - SupportedAggregationTypes = supportedAggregationTypes; - SupportedTimeGrainTypes = supportedTimeGrainTypes; - FillGapWithZero = fillGapWithZero; - Dimensions = dimensions; - EnableRegionalMdmAccount = enableRegionalMdmAccount; - SourceMdmAccount = sourceMdmAccount; - SourceMdmNamespace = sourceMdmNamespace; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the metric - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets localized friendly display name of the metric - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets localized friendly description of the metric - /// - [JsonProperty(PropertyName = "displayDescription")] - public string DisplayDescription { get; set; } - - /// - /// Gets or sets unit that makes sense for the metric - /// - [JsonProperty(PropertyName = "unit")] - public string Unit { get; set; } - - /// - /// Gets or sets name of the metric category that the metric belongs - /// to. A metric can only belong to a single category. - /// - [JsonProperty(PropertyName = "category")] - public string Category { get; set; } - - /// - /// Gets or sets only provide one value for this field. Valid values: - /// Average, Minimum, Maximum, Total, Count. - /// - [JsonProperty(PropertyName = "aggregationType")] - public string AggregationType { get; set; } - - /// - /// Gets or sets supported aggregation types - /// - [JsonProperty(PropertyName = "supportedAggregationTypes")] - public IList SupportedAggregationTypes { get; set; } - - /// - /// Gets or sets supported time grain types - /// - [JsonProperty(PropertyName = "supportedTimeGrainTypes")] - public IList SupportedTimeGrainTypes { get; set; } - - /// - /// Gets or sets optional. If set to true, then zero will be returned - /// for time duration where no metric is emitted/published. - /// - [JsonProperty(PropertyName = "fillGapWithZero")] - public bool? FillGapWithZero { get; set; } - - /// - /// Gets or sets dimensions of the metric - /// - [JsonProperty(PropertyName = "dimensions")] - public IList Dimensions { get; set; } - - /// - /// Gets or sets whether or not the service is using regional MDM - /// accounts. - /// - [JsonProperty(PropertyName = "enableRegionalMdmAccount")] - public string EnableRegionalMdmAccount { get; set; } - - /// - /// Gets or sets the name of the MDM account. - /// - [JsonProperty(PropertyName = "sourceMdmAccount")] - public string SourceMdmAccount { get; set; } - - /// - /// Gets or sets the name of the MDM namespace. - /// - [JsonProperty(PropertyName = "sourceMdmNamespace")] - public string SourceMdmNamespace { get; set; } - - } -} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/MountOptionEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/MountOptionEnum.cs index 74b24c90d19e4..517f863a328e8 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/MountOptionEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/MountOptionEnum.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class MountOptionEnum { + /// + /// is mount + /// public const string MOUNT = "MOUNT"; + /// + /// is attach + /// public const string ATTACH = "ATTACH"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/NsxPublicIpQuotaRaisedEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/NsxPublicIpQuotaRaisedEnum.cs new file mode 100644 index 0000000000000..a0f29e3229d45 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/NsxPublicIpQuotaRaisedEnum.cs @@ -0,0 +1,28 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for NsxPublicIpQuotaRaisedEnum. + /// + public static class NsxPublicIpQuotaRaisedEnum + { + /// + /// is enabled + /// + public const string Enabled = "Enabled"; + /// + /// is disabled + /// + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Operation.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Operation.cs index ac757b6f4ae59..e62fe47bdd7d6 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Operation.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Operation.cs @@ -14,8 +14,12 @@ namespace Microsoft.Azure.Management.Avs.Models using System.Linq; /// - /// A REST API operation + /// REST API Operation /// + /// + /// Details of a REST API operation, returned from the Resource Provider + /// Operations API + /// public partial class Operation { /// @@ -29,21 +33,29 @@ public Operation() /// /// Initializes a new instance of the Operation class. /// - /// Name of the operation being performed on this - /// object - /// Contains the localized display information - /// for this operation - /// Gets or sets a value indicating whether - /// the operation is a data action or not - /// Origin of the operation - /// Properties of the operation - public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay), bool? isDataAction = default(bool?), string origin = default(string), OperationProperties properties = default(OperationProperties)) + /// The name of the operation, as per Resource-Based + /// Access Control (RBAC). Examples: + /// "Microsoft.Compute/virtualMachines/write", + /// "Microsoft.Compute/virtualMachines/capture/action" + /// Whether the operation applies to + /// data-plane. This is "true" for data-plane operations and "false" + /// for ARM/control-plane operations. + /// Localized display information for this + /// particular operation. + /// The intended executor of the operation; as in + /// Resource Based Access Control (RBAC) and audit logs UX. Default + /// value is "user,system". Possible values include: 'user', 'system', + /// 'user,system' + /// Enum. Indicates the action type. + /// "Internal" refers to actions that are for internal only APIs. + /// Possible values include: 'Internal' + public Operation(string name = default(string), bool? isDataAction = default(bool?), OperationDisplay display = default(OperationDisplay), string origin = default(string), string actionType = default(string)) { Name = name; - Display = display; IsDataAction = isDataAction; + Display = display; Origin = origin; - Properties = properties; + ActionType = actionType; CustomInit(); } @@ -53,35 +65,45 @@ public Operation() partial void CustomInit(); /// - /// Gets name of the operation being performed on this object + /// Gets the name of the operation, as per Resource-Based Access + /// Control (RBAC). Examples: + /// "Microsoft.Compute/virtualMachines/write", + /// "Microsoft.Compute/virtualMachines/capture/action" /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// - /// Gets contains the localized display information for this operation + /// Gets whether the operation applies to data-plane. This is "true" + /// for data-plane operations and "false" for ARM/control-plane + /// operations. /// - [JsonProperty(PropertyName = "display")] - public OperationDisplay Display { get; private set; } + [JsonProperty(PropertyName = "isDataAction")] + public bool? IsDataAction { get; private set; } /// - /// Gets or sets a value indicating whether the operation is a data - /// action or not + /// Gets or sets localized display information for this particular + /// operation. /// - [JsonProperty(PropertyName = "isDataAction")] - public bool? IsDataAction { get; set; } + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } /// - /// Gets or sets origin of the operation + /// Gets the intended executor of the operation; as in Resource Based + /// Access Control (RBAC) and audit logs UX. Default value is + /// "user,system". Possible values include: 'user', 'system', + /// 'user,system' /// [JsonProperty(PropertyName = "origin")] - public string Origin { get; set; } + public string Origin { get; private set; } /// - /// Gets or sets properties of the operation + /// Gets enum. Indicates the action type. "Internal" refers to actions + /// that are for internal only APIs. Possible values include: + /// 'Internal' /// - [JsonProperty(PropertyName = "properties")] - public OperationProperties Properties { get; set; } + [JsonProperty(PropertyName = "actionType")] + public string ActionType { get; private set; } } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/OperationDisplay.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/OperationDisplay.cs index 7b0ad58aefc7a..dedd358538acd 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/OperationDisplay.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/OperationDisplay.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Avs.Models using System.Linq; /// - /// Contains the localized display information for this operation + /// Localized display information for this particular operation. /// public partial class OperationDisplay { @@ -29,14 +29,18 @@ public OperationDisplay() /// /// Initializes a new instance of the OperationDisplay class. /// - /// Localized friendly form of the resource - /// provider name - /// Localized friendly form of the resource type - /// related to this operation - /// Localized friendly name for the - /// operation - /// Localized friendly description for the - /// operation + /// The localized friendly form of the resource + /// provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + /// Compute". + /// The localized friendly name of the resource + /// type related to this operation. E.g. "Virtual Machines" or "Job + /// Schedule Collections". + /// The concise, localized friendly name for + /// the operation; suitable for dropdowns. E.g. "Create or Update + /// Virtual Machine", "Restart Virtual Machine". + /// The short, localized friendly description + /// of the operation; suitable for tool tips and detailed + /// views. public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) { Provider = provider; @@ -52,26 +56,31 @@ public OperationDisplay() partial void CustomInit(); /// - /// Gets localized friendly form of the resource provider name + /// Gets the localized friendly form of the resource provider name, + /// e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". /// [JsonProperty(PropertyName = "provider")] public string Provider { get; private set; } /// - /// Gets localized friendly form of the resource type related to this - /// operation + /// Gets the localized friendly name of the resource type related to + /// this operation. E.g. "Virtual Machines" or "Job Schedule + /// Collections". /// [JsonProperty(PropertyName = "resource")] public string Resource { get; private set; } /// - /// Gets localized friendly name for the operation + /// Gets the concise, localized friendly name for the operation; + /// suitable for dropdowns. E.g. "Create or Update Virtual Machine", + /// "Restart Virtual Machine". /// [JsonProperty(PropertyName = "operation")] public string Operation { get; private set; } /// - /// Gets localized friendly description for the operation + /// Gets the short, localized friendly description of the operation; + /// suitable for tool tips and detailed views. /// [JsonProperty(PropertyName = "description")] public string Description { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/OptionalParamEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/OptionalParamEnum.cs index 8fe4139538b1f..12aad20ee5aba 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/OptionalParamEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/OptionalParamEnum.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class OptionalParamEnum { + /// + /// is optional + /// public const string Optional = "Optional"; + /// + /// is required + /// public const string Required = "Required"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Origin.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Origin.cs new file mode 100644 index 0000000000000..b268dd884aa0a --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Origin.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.Avs.Models +{ + + /// + /// Defines values for Origin. + /// + public static class Origin + { + public const string User = "user"; + public const string System = "system"; + public const string Usersystem = "user,system"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPoliciesCreateOrUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPoliciesCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..744a2644d386d --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPoliciesCreateOrUpdateHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class PlacementPoliciesCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the + /// PlacementPoliciesCreateOrUpdateHeaders class. + /// + public PlacementPoliciesCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PlacementPoliciesCreateOrUpdateHeaders class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public PlacementPoliciesCreateOrUpdateHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPoliciesDeleteHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPoliciesDeleteHeaders.cs new file mode 100644 index 0000000000000..95eb84ca17ac4 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPoliciesDeleteHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class PlacementPoliciesDeleteHeaders + { + /// + /// Initializes a new instance of the PlacementPoliciesDeleteHeaders + /// class. + /// + public PlacementPoliciesDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PlacementPoliciesDeleteHeaders + /// class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public PlacementPoliciesDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPoliciesUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPoliciesUpdateHeaders.cs new file mode 100644 index 0000000000000..6ed0e3d5f40ab --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPoliciesUpdateHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Update operation. + /// + public partial class PlacementPoliciesUpdateHeaders + { + /// + /// Initializes a new instance of the PlacementPoliciesUpdateHeaders + /// class. + /// + public PlacementPoliciesUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PlacementPoliciesUpdateHeaders + /// class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public PlacementPoliciesUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicy.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicy.cs index 1302c5657dbf1..ccc68928f61fc 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicy.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicy.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Avs.Models /// /// A vSphere Distributed Resource Scheduler (DRS) placement policy /// - public partial class PlacementPolicy : Resource + public partial class PlacementPolicy : ProxyResource { /// /// Initializes a new instance of the PlacementPolicy class. @@ -29,12 +29,18 @@ public PlacementPolicy() /// /// Initializes a new instance of the PlacementPolicy class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// placement policy properties - public PlacementPolicy(string id = default(string), string name = default(string), string type = default(string), PlacementPolicyProperties properties = default(PlacementPolicyProperties)) - : base(id, name, type) + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The resource-specific properties for this + /// resource. + public PlacementPolicy(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), PlacementPolicyProperties properties = default(PlacementPolicyProperties)) + : base(id, name, type, systemData) { Properties = properties; CustomInit(); @@ -46,7 +52,7 @@ public PlacementPolicy() partial void CustomInit(); /// - /// Gets or sets placement policy properties + /// Gets or sets the resource-specific properties for this resource. /// [JsonProperty(PropertyName = "properties")] public PlacementPolicyProperties Properties { get; set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProperties.cs index a900368d9b58b..0b1f0dcdb3a00 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProperties.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProperties.cs @@ -34,8 +34,8 @@ public PlacementPolicyProperties() /// Display name of the placement /// policy /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', - /// 'Updating' + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' public PlacementPolicyProperties(string state = default(string), string displayName = default(string), string provisioningState = default(string)) { State = state; @@ -64,7 +64,7 @@ public PlacementPolicyProperties() /// /// Gets the provisioning state. Possible values include: 'Succeeded', - /// 'Failed', 'Building', 'Deleting', 'Updating' + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' /// [JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProvisioningState.cs index 997a5a64585f0..ea6b35b7adf55 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyProvisioningState.cs @@ -16,10 +16,29 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class PlacementPolicyProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is building + /// public const string Building = "Building"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyState.cs index fbc86b85ff25f..c211c00f3e8c0 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyState.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class PlacementPolicyState { + /// + /// is enabled + /// public const string Enabled = "Enabled"; + /// + /// is disabled + /// public const string Disabled = "Disabled"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyType.cs new file mode 100644 index 0000000000000..adbbf46c0e492 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyType.cs @@ -0,0 +1,22 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for PlacementPolicyType. + /// + public static class PlacementPolicyType + { + public const string VmVm = "VmVm"; + public const string VmHost = "VmHost"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyUpdate.cs index 0d8f222fc26ff..71a8eb8f6e255 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyUpdate.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PlacementPolicyUpdate.cs @@ -38,11 +38,19 @@ public PlacementPolicyUpdate() /// disabled. Possible values include: 'Enabled', 'Disabled' /// Virtual machine members list /// Host members list - public PlacementPolicyUpdate(string state = default(string), IList vmMembers = default(IList), IList hostMembers = default(IList)) + /// vm-host placement policy affinity + /// strength (should/must). Possible values include: 'Should', + /// 'Must' + /// placement policy azure hybrid + /// benefit opt-in type. Possible values include: 'SqlHost', + /// 'None' + public PlacementPolicyUpdate(string state = default(string), IList vmMembers = default(IList), IList hostMembers = default(IList), string affinityStrength = default(string), string azureHybridBenefitType = default(string)) { State = state; VmMembers = vmMembers; HostMembers = hostMembers; + AffinityStrength = affinityStrength; + AzureHybridBenefitType = azureHybridBenefitType; CustomInit(); } @@ -70,5 +78,19 @@ public PlacementPolicyUpdate() [JsonProperty(PropertyName = "properties.hostMembers")] public IList HostMembers { get; set; } + /// + /// Gets or sets vm-host placement policy affinity strength + /// (should/must). Possible values include: 'Should', 'Must' + /// + [JsonProperty(PropertyName = "properties.affinityStrength")] + public string AffinityStrength { get; set; } + + /// + /// Gets or sets placement policy azure hybrid benefit opt-in type. + /// Possible values include: 'SqlHost', 'None' + /// + [JsonProperty(PropertyName = "properties.azureHybridBenefitType")] + public string AzureHybridBenefitType { get; set; } + } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Plan.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Plan.cs new file mode 100644 index 0000000000000..c0f0178084c5b --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Plan.cs @@ -0,0 +1,116 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Plan for the resource. + /// + public partial class Plan + { + /// + /// Initializes a new instance of the Plan class. + /// + public Plan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Plan class. + /// + /// A user defined name of the 3rd Party Artifact + /// that is being procured. + /// The publisher of the 3rd Party Artifact + /// that is being bought. E.g. NewRelic + /// The 3rd Party artifact that is being + /// procured. E.g. NewRelic. Product maps to the OfferID specified for + /// the artifact at the time of Data Market onboarding. + /// A publisher provided promotion code as + /// provisioned in Data Market for the said product/artifact. + /// The version of the desired + /// product/artifact. + public Plan(string name, string publisher, string product, string promotionCode = default(string), string version = default(string)) + { + Name = name; + Publisher = publisher; + Product = product; + PromotionCode = promotionCode; + Version = version; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a user defined name of the 3rd Party Artifact that is + /// being procured. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the publisher of the 3rd Party Artifact that is being + /// bought. E.g. NewRelic + /// + [JsonProperty(PropertyName = "publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets the 3rd Party artifact that is being procured. E.g. + /// NewRelic. Product maps to the OfferID specified for the artifact at + /// the time of Data Market onboarding. + /// + [JsonProperty(PropertyName = "product")] + public string Product { get; set; } + + /// + /// Gets or sets a publisher provided promotion code as provisioned in + /// Data Market for the said product/artifact. + /// + [JsonProperty(PropertyName = "promotionCode")] + public string PromotionCode { get; set; } + + /// + /// Gets or sets the version of the desired product/artifact. + /// + [JsonProperty(PropertyName = "version")] + public string Version { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Publisher == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Publisher"); + } + if (Product == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Product"); + } + } + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringDirectionEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringDirectionEnum.cs index f147dad15abd4..0a82612cdd39c 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringDirectionEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringDirectionEnum.cs @@ -16,8 +16,17 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class PortMirroringDirectionEnum { + /// + /// is ingress + /// public const string INGRESS = "INGRESS"; + /// + /// is egress + /// public const string EGRESS = "EGRESS"; + /// + /// is bidirectional + /// public const string BIDIRECTIONAL = "BIDIRECTIONAL"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringStatusEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringStatusEnum.cs index 0f50ac49f6ef7..e640c445f90b2 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringStatusEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PortMirroringStatusEnum.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class PortMirroringStatusEnum { + /// + /// is success + /// public const string SUCCESS = "SUCCESS"; + /// + /// is failure + /// public const string FAILURE = "FAILURE"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloud.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloud.cs index 26cf5bba067be..4981aaa722215 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloud.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloud.cs @@ -34,18 +34,26 @@ public PrivateCloud() /// /// Initializes a new instance of the PrivateCloud class. /// - /// The private cloud SKU - /// The block of addresses should be unique - /// across VNet in your subscription as well as on-premise. Make sure - /// the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are - /// between 0 and 255, and X is between 0 and 22 - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location - /// Resource tags + /// The geo-location where the resource + /// lives /// The default cluster used for /// management + /// The block of addresses should be unique + /// across VNet in your subscription as + /// well as on-premise. Make sure the CIDR format is conformed to + /// (A.B.C.D/X) where + /// A,B,C,D are between 0 and 255, and X is between 0 and 22 + /// The SKU (Stock Keeping Unit) assigned to this + /// resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// Resource tags. /// Connectivity to internet is enabled or /// disabled. Possible values include: 'Enabled', 'Disabled' /// vCenter Single Sign On Identity @@ -54,9 +62,16 @@ public PrivateCloud() /// distributed across availability zones /// Customer managed key encryption, can be /// enabled or disabled + /// Array of additional networks + /// noncontiguous with networkBlock. Networks must be + /// unique and non-overlapping across VNet in your subscription, + /// on-premise, and + /// this privateCloud networkBlock attribute. Make sure the CIDR format + /// conforms to + /// (A.B.C.D/X). /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Cancelled', 'Pending', - /// 'Building', 'Deleting', 'Updating' + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Cancelled', + /// 'Pending', 'Building', 'Deleting', 'Updating' /// An ExpressRoute Circuit /// The endpoints /// Network used to access vCenter @@ -76,19 +91,27 @@ public PrivateCloud() /// Array of cloud link IDs from other /// clouds that connect to this one /// A secondary expressRoute circuit - /// from a separate AZ. Only present in a stretched private - /// cloud - /// The identity of the private cloud, if - /// configured. - public PrivateCloud(Sku sku, string networkBlock, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ManagementCluster managementCluster = default(ManagementCluster), string internet = default(string), IList identitySources = default(IList), AvailabilityProperties availability = default(AvailabilityProperties), Encryption encryption = default(Encryption), string provisioningState = default(string), Circuit circuit = default(Circuit), Endpoints endpoints = default(Endpoints), string managementNetwork = default(string), string provisioningNetwork = default(string), string vmotionNetwork = default(string), string vcenterPassword = default(string), string nsxtPassword = default(string), string vcenterCertificateThumbprint = default(string), string nsxtCertificateThumbprint = default(string), IList externalCloudLinks = default(IList), Circuit secondaryCircuit = default(Circuit), PrivateCloudIdentity identity = default(PrivateCloudIdentity)) - : base(id, name, type, location, tags) + /// from a separate AZ. Only present in a + /// stretched private cloud + /// Flag to indicate whether the + /// private cloud has the quota for provisioned NSX + /// Public IP count raised from 64 to 1024. Possible values include: + /// 'Enabled', 'Disabled' + /// Azure resource ID of the virtual + /// network + /// The type of DNS zone to use. Possible + /// values include: 'Public', 'Private' + /// The managed service identities assigned to + /// this resource. + public PrivateCloud(string location, ManagementCluster managementCluster, string networkBlock, Sku sku, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), string internet = default(string), IList identitySources = default(IList), AvailabilityProperties availability = default(AvailabilityProperties), Encryption encryption = default(Encryption), IList extendedNetworkBlocks = default(IList), string provisioningState = default(string), Circuit circuit = default(Circuit), Endpoints endpoints = default(Endpoints), string managementNetwork = default(string), string provisioningNetwork = default(string), string vmotionNetwork = default(string), string vcenterPassword = default(string), string nsxtPassword = default(string), string vcenterCertificateThumbprint = default(string), string nsxtCertificateThumbprint = default(string), IList externalCloudLinks = default(IList), Circuit secondaryCircuit = default(Circuit), string nsxPublicIpQuotaRaised = default(string), string virtualNetworkId = default(string), string dnsZoneType = default(string), SystemAssignedServiceIdentity identity = default(SystemAssignedServiceIdentity)) + : base(location, id, name, type, systemData, tags) { - Sku = sku; ManagementCluster = managementCluster; Internet = internet; IdentitySources = identitySources; Availability = availability; Encryption = encryption; + ExtendedNetworkBlocks = extendedNetworkBlocks; ProvisioningState = provisioningState; Circuit = circuit; Endpoints = endpoints; @@ -102,6 +125,10 @@ public PrivateCloud() NsxtCertificateThumbprint = nsxtCertificateThumbprint; ExternalCloudLinks = externalCloudLinks; SecondaryCircuit = secondaryCircuit; + NsxPublicIpQuotaRaised = nsxPublicIpQuotaRaised; + VirtualNetworkId = virtualNetworkId; + DnsZoneType = dnsZoneType; + Sku = sku; Identity = identity; CustomInit(); } @@ -111,12 +138,6 @@ public PrivateCloud() /// partial void CustomInit(); - /// - /// Gets or sets the private cloud SKU - /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - /// /// Gets or sets the default cluster used for management /// @@ -150,10 +171,22 @@ public PrivateCloud() [JsonProperty(PropertyName = "properties.encryption")] public Encryption Encryption { get; set; } + /// + /// Gets or sets array of additional networks noncontiguous with + /// networkBlock. Networks must be + /// unique and non-overlapping across VNet in your subscription, + /// on-premise, and + /// this privateCloud networkBlock attribute. Make sure the CIDR format + /// conforms to + /// (A.B.C.D/X). + /// + [JsonProperty(PropertyName = "properties.extendedNetworkBlocks")] + public IList ExtendedNetworkBlocks { get; set; } + /// /// Gets the provisioning state. Possible values include: 'Succeeded', - /// 'Failed', 'Cancelled', 'Pending', 'Building', 'Deleting', - /// 'Updating' + /// 'Failed', 'Canceled', 'Cancelled', 'Pending', 'Building', + /// 'Deleting', 'Updating' /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } @@ -172,9 +205,10 @@ public PrivateCloud() /// /// Gets or sets the block of addresses should be unique across VNet in - /// your subscription as well as on-premise. Make sure the CIDR format - /// is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, - /// and X is between 0 and 22 + /// your subscription as + /// well as on-premise. Make sure the CIDR format is conformed to + /// (A.B.C.D/X) where + /// A,B,C,D are between 0 and 255, and X is between 0 and 22 /// [JsonProperty(PropertyName = "properties.networkBlock")] public string NetworkBlock { get; set; } @@ -233,16 +267,47 @@ public PrivateCloud() /// /// Gets or sets a secondary expressRoute circuit from a separate AZ. - /// Only present in a stretched private cloud + /// Only present in a + /// stretched private cloud /// [JsonProperty(PropertyName = "properties.secondaryCircuit")] public Circuit SecondaryCircuit { get; set; } /// - /// Gets or sets the identity of the private cloud, if configured. + /// Gets flag to indicate whether the private cloud has the quota for + /// provisioned NSX + /// Public IP count raised from 64 to 1024. Possible values include: + /// 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.nsxPublicIpQuotaRaised")] + public string NsxPublicIpQuotaRaised { get; private set; } + + /// + /// Gets or sets azure resource ID of the virtual network + /// + [JsonProperty(PropertyName = "properties.virtualNetworkId")] + public string VirtualNetworkId { get; set; } + + /// + /// Gets or sets the type of DNS zone to use. Possible values include: + /// 'Public', 'Private' + /// + [JsonProperty(PropertyName = "properties.dnsZoneType")] + public string DnsZoneType { get; set; } + + /// + /// Gets or sets the SKU (Stock Keeping Unit) assigned to this + /// resource. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + + /// + /// Gets or sets the managed service identities assigned to this + /// resource. /// [JsonProperty(PropertyName = "identity")] - public PrivateCloudIdentity Identity { get; set; } + public SystemAssignedServiceIdentity Identity { get; set; } /// /// Validate the object. @@ -250,20 +315,29 @@ public PrivateCloud() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (Sku == null) + base.Validate(); + if (ManagementCluster == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); + throw new ValidationException(ValidationRules.CannotBeNull, "ManagementCluster"); } if (NetworkBlock == null) { throw new ValidationException(ValidationRules.CannotBeNull, "NetworkBlock"); } + if (Sku == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); + } if (Sku != null) { Sku.Validate(); } + if (Identity != null) + { + Identity.Validate(); + } } } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudIdentity.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudIdentity.cs deleted file mode 100644 index dd0cfb57bdd7b..0000000000000 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudIdentity.cs +++ /dev/null @@ -1,79 +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.Avs.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Identity for the virtual machine. - /// - public partial class PrivateCloudIdentity - { - /// - /// Initializes a new instance of the PrivateCloudIdentity class. - /// - public PrivateCloudIdentity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PrivateCloudIdentity class. - /// - /// The principal ID of private cloud - /// identity. This property will only be provided for a system assigned - /// identity. - /// The tenant ID associated with the private - /// cloud. This property will only be provided for a system assigned - /// identity. - /// The type of identity used for the private cloud. - /// The type 'SystemAssigned' refers to an implicitly created identity. - /// The type 'None' will remove any identities from the Private Cloud. - /// Possible values include: 'SystemAssigned', 'None' - public PrivateCloudIdentity(string principalId = default(string), string tenantId = default(string), string type = default(string)) - { - PrincipalId = principalId; - TenantId = tenantId; - Type = type; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the principal ID of private cloud identity. This property will - /// only be provided for a system assigned identity. - /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } - - /// - /// Gets the tenant ID associated with the private cloud. This property - /// will only be provided for a system assigned identity. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } - - /// - /// Gets or sets the type of identity used for the private cloud. The - /// type 'SystemAssigned' refers to an implicitly created identity. The - /// type 'None' will remove any identities from the Private Cloud. - /// Possible values include: 'SystemAssigned', 'None' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - } -} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudProvisioningState.cs index cf3b0c9029f64..6a661c8628083 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudProvisioningState.cs @@ -16,12 +16,37 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class PrivateCloudProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is cancelled + /// public const string Cancelled = "Cancelled"; + /// + /// is pending + /// public const string Pending = "Pending"; + /// + /// is building + /// public const string Building = "Building"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudUpdate.cs index 2503d994b3584..f363217ad8bba 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudUpdate.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudUpdate.cs @@ -34,7 +34,11 @@ public PrivateCloudUpdate() /// /// Initializes a new instance of the PrivateCloudUpdate class. /// - /// Resource tags + /// Resource tags. + /// The SKU (Stock Keeping Unit) assigned to this + /// resource. + /// The managed service identities assigned to + /// this resource. /// The default cluster used for /// management /// Connectivity to internet is enabled or @@ -45,17 +49,27 @@ public PrivateCloudUpdate() /// distributed across availability zones /// Customer managed key encryption, can be /// enabled or disabled - /// The identity of the private cloud, if - /// configured. - public PrivateCloudUpdate(IDictionary tags = default(IDictionary), ManagementCluster managementCluster = default(ManagementCluster), string internet = default(string), IList identitySources = default(IList), AvailabilityProperties availability = default(AvailabilityProperties), Encryption encryption = default(Encryption), PrivateCloudIdentity identity = default(PrivateCloudIdentity)) + /// Array of additional networks + /// noncontiguous with networkBlock. Networks must be + /// unique and non-overlapping across VNet in your subscription, + /// on-premise, and + /// this privateCloud networkBlock attribute. Make sure the CIDR format + /// conforms to + /// (A.B.C.D/X). + /// The type of DNS zone to use. Possible + /// values include: 'Public', 'Private' + public PrivateCloudUpdate(IDictionary tags = default(IDictionary), Sku sku = default(Sku), SystemAssignedServiceIdentity identity = default(SystemAssignedServiceIdentity), ManagementCluster managementCluster = default(ManagementCluster), string internet = default(string), IList identitySources = default(IList), AvailabilityProperties availability = default(AvailabilityProperties), Encryption encryption = default(Encryption), IList extendedNetworkBlocks = default(IList), string dnsZoneType = default(string)) { Tags = tags; + Sku = sku; + Identity = identity; ManagementCluster = managementCluster; Internet = internet; IdentitySources = identitySources; Availability = availability; Encryption = encryption; - Identity = identity; + ExtendedNetworkBlocks = extendedNetworkBlocks; + DnsZoneType = dnsZoneType; CustomInit(); } @@ -65,11 +79,25 @@ public PrivateCloudUpdate() partial void CustomInit(); /// - /// Gets or sets resource tags + /// Gets or sets resource tags. /// [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } + /// + /// Gets or sets the SKU (Stock Keeping Unit) assigned to this + /// resource. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + + /// + /// Gets or sets the managed service identities assigned to this + /// resource. + /// + [JsonProperty(PropertyName = "identity")] + public SystemAssignedServiceIdentity Identity { get; set; } + /// /// Gets or sets the default cluster used for management /// @@ -104,10 +132,40 @@ public PrivateCloudUpdate() public Encryption Encryption { get; set; } /// - /// Gets or sets the identity of the private cloud, if configured. + /// Gets or sets array of additional networks noncontiguous with + /// networkBlock. Networks must be + /// unique and non-overlapping across VNet in your subscription, + /// on-premise, and + /// this privateCloud networkBlock attribute. Make sure the CIDR format + /// conforms to + /// (A.B.C.D/X). /// - [JsonProperty(PropertyName = "identity")] - public PrivateCloudIdentity Identity { get; set; } + [JsonProperty(PropertyName = "properties.extendedNetworkBlocks")] + public IList ExtendedNetworkBlocks { get; set; } + + /// + /// Gets or sets the type of DNS zone to use. Possible values include: + /// 'Public', 'Private' + /// + [JsonProperty(PropertyName = "properties.dnsZoneType")] + public string DnsZoneType { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Sku != null) + { + Sku.Validate(); + } + if (Identity != null) + { + Identity.Validate(); + } + } } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsCreateOrUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..019c533e425bd --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsCreateOrUpdateHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class PrivateCloudsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the + /// PrivateCloudsCreateOrUpdateHeaders class. + /// + public PrivateCloudsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PrivateCloudsCreateOrUpdateHeaders class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public PrivateCloudsCreateOrUpdateHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsDeleteHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsDeleteHeaders.cs new file mode 100644 index 0000000000000..1fd70cfd54d46 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsDeleteHeaders.cs @@ -0,0 +1,64 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class PrivateCloudsDeleteHeaders + { + /// + /// Initializes a new instance of the PrivateCloudsDeleteHeaders class. + /// + public PrivateCloudsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateCloudsDeleteHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public PrivateCloudsDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsRotateNsxtPasswordHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsRotateNsxtPasswordHeaders.cs new file mode 100644 index 0000000000000..2ab4460deaa5e --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsRotateNsxtPasswordHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for RotateNsxtPassword operation. + /// + public partial class PrivateCloudsRotateNsxtPasswordHeaders + { + /// + /// Initializes a new instance of the + /// PrivateCloudsRotateNsxtPasswordHeaders class. + /// + public PrivateCloudsRotateNsxtPasswordHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PrivateCloudsRotateNsxtPasswordHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public PrivateCloudsRotateNsxtPasswordHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsRotateVcenterPasswordHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsRotateVcenterPasswordHeaders.cs new file mode 100644 index 0000000000000..d4876d74df281 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsRotateVcenterPasswordHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for RotateVcenterPassword operation. + /// + public partial class PrivateCloudsRotateVcenterPasswordHeaders + { + /// + /// Initializes a new instance of the + /// PrivateCloudsRotateVcenterPasswordHeaders class. + /// + public PrivateCloudsRotateVcenterPasswordHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PrivateCloudsRotateVcenterPasswordHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public PrivateCloudsRotateVcenterPasswordHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsUpdateHeaders.cs new file mode 100644 index 0000000000000..670b05889cae2 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/PrivateCloudsUpdateHeaders.cs @@ -0,0 +1,64 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Update operation. + /// + public partial class PrivateCloudsUpdateHeaders + { + /// + /// Initializes a new instance of the PrivateCloudsUpdateHeaders class. + /// + public PrivateCloudsUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateCloudsUpdateHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public PrivateCloudsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ProxyResource.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ProxyResource.cs index 2309696789282..966fee7d435da 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ProxyResource.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ProxyResource.cs @@ -13,8 +13,12 @@ namespace Microsoft.Azure.Management.Avs.Models using System.Linq; /// - /// The resource model definition for a ARM proxy resource + /// Proxy Resource /// + /// + /// The resource model definition for a Azure Resource Manager proxy + /// resource. It will not have tags and a location + /// public partial class ProxyResource : Resource { /// @@ -28,11 +32,16 @@ public ProxyResource() /// /// Initializes a new instance of the ProxyResource class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) - : base(id, name, type) + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + public ProxyResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, systemData) { CustomInit(); } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/QuotaEnabled.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/QuotaEnabled.cs index 17daf74d5428a..d432b7aaf06f6 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/QuotaEnabled.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/QuotaEnabled.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class QuotaEnabled { + /// + /// is enabled + /// public const string Enabled = "Enabled"; + /// + /// is disabled + /// public const string Disabled = "Disabled"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Resource.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Resource.cs index 6cfa0a311dfbe..f548e493d3db6 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Resource.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Resource.cs @@ -16,8 +16,12 @@ namespace Microsoft.Azure.Management.Avs.Models using System.Linq; /// - /// The core properties of ARM resources + /// Resource /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// public partial class Resource : IResource { /// @@ -31,14 +35,20 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - public Resource(string id = default(string), string name = default(string), string type = default(string)) + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + public Resource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) { Id = id; Name = name; Type = type; + SystemData = systemData; CustomInit(); } @@ -48,22 +58,32 @@ public Resource() partial void CustomInit(); /// - /// Gets resource ID. + /// Gets fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Gets resource name. + /// Gets the name of the resource /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// - /// Gets resource type. + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Gets azure Resource Manager metadata containing createdBy and + /// modifiedBy information. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceIdentityType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceIdentityType.cs index 00b4cc55be76d..0db80fc00cf0d 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceIdentityType.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceIdentityType.cs @@ -10,13 +10,45 @@ namespace Microsoft.Azure.Management.Avs.Models { + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ResourceIdentityType. /// - public static class ResourceIdentityType + [JsonConverter(typeof(StringEnumConverter))] + public enum ResourceIdentityType { - public const string SystemAssigned = "SystemAssigned"; - public const string None = "None"; + [EnumMember(Value = "SystemAssigned")] + SystemAssigned + } + internal static class ResourceIdentityTypeEnumExtension + { + internal static string ToSerializedValue(this ResourceIdentityType? value) + { + return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ResourceIdentityType value) + { + switch( value ) + { + case ResourceIdentityType.SystemAssigned: + return "SystemAssigned"; + } + return null; + } + + internal static ResourceIdentityType? ParseResourceIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return ResourceIdentityType.SystemAssigned; + } + return null; + } } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs new file mode 100644 index 0000000000000..c360a8aee826a --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs @@ -0,0 +1,141 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource model definition containing the full set of allowed + /// properties for a resource. Except properties bag, there cannot be a top + /// level property outside of this set. + /// + public partial class ResourceModelWithAllowedPropertySet : IResource + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySet class. + /// + public ResourceModelWithAllowedPropertySet() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySet class. + /// + /// The fully qualified resource ID of the + /// resource that manages this resource. Indicates if this resource is + /// managed by another Azure resource. If this is present, complete + /// mode deployment will not delete the resource if it is removed from + /// the template since it is managed by another resource. + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type. E.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. + public ResourceModelWithAllowedPropertySet(string managedBy = default(string), string kind = default(string), string etag = default(string), ResourceModelWithAllowedPropertySetIdentity identity = default(ResourceModelWithAllowedPropertySetIdentity), ResourceModelWithAllowedPropertySetSku sku = default(ResourceModelWithAllowedPropertySetSku), ResourceModelWithAllowedPropertySetPlan plan = default(ResourceModelWithAllowedPropertySetPlan)) + { + ManagedBy = managedBy; + Kind = kind; + Etag = etag; + Identity = identity; + Sku = sku; + Plan = plan; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the fully qualified resource ID of the resource that + /// manages this resource. Indicates if this resource is managed by + /// another Azure resource. If this is present, complete mode + /// deployment will not delete the resource if it is removed from the + /// template since it is managed by another resource. + /// + [JsonProperty(PropertyName = "managedBy")] + public string ManagedBy { get; set; } + + /// + /// Gets or sets metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type. E.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; set; } + + /// + /// Gets the etag field is *not* required. If it is provided in the + /// response body, it must also be provided as a header per the normal + /// etag convention. Entity tags are used for comparing two or more + /// entities from the same requested resource. HTTP/1.1 uses entity + /// tags in the etag (section 14.19), If-Match (section 14.24), + /// If-None-Match (section 14.26), and If-Range (section 14.27) header + /// fields. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "identity")] + public ResourceModelWithAllowedPropertySetIdentity Identity { get; set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public ResourceModelWithAllowedPropertySetSku Sku { get; set; } + + /// + /// + [JsonProperty(PropertyName = "plan")] + public ResourceModelWithAllowedPropertySetPlan Plan { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Kind != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Kind, "^[-\\w\\._,\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "Kind", "^[-\\w\\._,\\(\\)]+$"); + } + } + if (Sku != null) + { + Sku.Validate(); + } + if (Plan != null) + { + Plan.Validate(); + } + } + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs new file mode 100644 index 0000000000000..f0c1adeef4eea --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs @@ -0,0 +1,48 @@ +// +// 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.Avs.Models +{ + using System.Linq; + + public partial class ResourceModelWithAllowedPropertySetIdentity : Identity + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetIdentity class. + /// + public ResourceModelWithAllowedPropertySetIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetIdentity class. + /// + /// The principal ID of resource identity. + /// The value must be an UUID. + /// The tenant ID of resource. The value must be + /// an UUID. + /// The identity type. Possible values include: + /// 'SystemAssigned' + public ResourceModelWithAllowedPropertySetIdentity(System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?), ResourceIdentityType? type = default(ResourceIdentityType?)) + : base(principalId, tenantId, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs new file mode 100644 index 0000000000000..f610509da3ed4 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs @@ -0,0 +1,63 @@ +// +// 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.Avs.Models +{ + using System.Linq; + + public partial class ResourceModelWithAllowedPropertySetPlan : Plan + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetPlan class. + /// + public ResourceModelWithAllowedPropertySetPlan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetPlan class. + /// + /// A user defined name of the 3rd Party Artifact + /// that is being procured. + /// The publisher of the 3rd Party Artifact + /// that is being bought. E.g. NewRelic + /// The 3rd Party artifact that is being + /// procured. E.g. NewRelic. Product maps to the OfferID specified for + /// the artifact at the time of Data Market onboarding. + /// A publisher provided promotion code as + /// provisioned in Data Market for the said product/artifact. + /// The version of the desired + /// product/artifact. + public ResourceModelWithAllowedPropertySetPlan(string name, string publisher, string product, string promotionCode = default(string), string version = default(string)) + : base(name, publisher, product, promotionCode, version) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs new file mode 100644 index 0000000000000..cb8270640a217 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs @@ -0,0 +1,64 @@ +// +// 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.Avs.Models +{ + using System.Linq; + + public partial class ResourceModelWithAllowedPropertySetSku : Sku + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetSku class. + /// + public ResourceModelWithAllowedPropertySetSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetSku class. + /// + /// The name of the SKU. E.g. P3. It is typically a + /// letter+number code + /// Possible values include: 'Free', 'Basic', + /// 'Standard', 'Premium' + /// The SKU size. When the name field is the + /// combination of tier and some other value, this would be the + /// standalone code. + /// If the service has different generations of + /// hardware, for the same SKU, then that can be captured here. + /// If the SKU supports scale out/in then the + /// capacity integer should be included. If scale out/in is not + /// possible for the resource this may be omitted. + public ResourceModelWithAllowedPropertySetSku(string name, SkuTier? tier = default(SkuTier?), string size = default(string), string family = default(string), int? capacity = default(int?)) + : base(name, tier, size, family, capacity) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptCmdlet.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptCmdlet.cs index 507954d8bb52c..4054dff2823e4 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptCmdlet.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptCmdlet.cs @@ -34,18 +34,31 @@ public ScriptCmdlet() /// /// Initializes a new instance of the ScriptCmdlet class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled' /// Description of the scripts /// functionality /// Recommended time limit for execution + /// Specifies whether a script cmdlet is + /// intended to be invoked only through automation or visible to + /// customers. Possible values include: 'Automation', 'Any' /// Parameters the script will accept - public ScriptCmdlet(string id = default(string), string name = default(string), string type = default(string), string description = default(string), string timeout = default(string), IList parameters = default(IList)) - : base(id, name, type) + public ScriptCmdlet(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string description = default(string), string timeout = default(string), string audience = default(string), IList parameters = default(IList)) + : base(id, name, type, systemData) { + ProvisioningState = provisioningState; Description = description; Timeout = timeout; + Audience = audience; Parameters = parameters; CustomInit(); } @@ -55,6 +68,13 @@ public ScriptCmdlet() /// partial void CustomInit(); + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + /// /// Gets description of the scripts functionality /// @@ -67,6 +87,14 @@ public ScriptCmdlet() [JsonProperty(PropertyName = "properties.timeout")] public string Timeout { get; private set; } + /// + /// Gets specifies whether a script cmdlet is intended to be invoked + /// only through automation or visible to customers. Possible values + /// include: 'Automation', 'Any' + /// + [JsonProperty(PropertyName = "properties.audience")] + public string Audience { get; private set; } + /// /// Gets parameters the script will accept /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptCmdletAudience.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptCmdletAudience.cs new file mode 100644 index 0000000000000..c3f1167f366d9 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptCmdletAudience.cs @@ -0,0 +1,28 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for ScriptCmdletAudience. + /// + public static class ScriptCmdletAudience + { + /// + /// is automation + /// + public const string Automation = "Automation"; + /// + /// is any + /// + public const string Any = "Any"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptCmdletProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptCmdletProvisioningState.cs new file mode 100644 index 0000000000000..5c9960f13a323 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptCmdletProvisioningState.cs @@ -0,0 +1,32 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for ScriptCmdletProvisioningState. + /// + public static class ScriptCmdletProvisioningState + { + /// + /// Resource has been created. + /// + public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// + public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecution.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecution.cs index 6a1d5d68c5517..cbc82b4eb8941 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecution.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecution.cs @@ -35,17 +35,23 @@ public ScriptExecution() /// Initializes a new instance of the ScriptExecution class. /// /// Time limit for execution - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// A reference to the script cmdlet /// resource if user is running a AVS script /// Parameters the script will accept /// Parameters that will be hidden/not - /// visible to ARM, such as passwords and credentials + /// visible to ARM, such as passwords and + /// credentials /// Error message if the script was able to - /// run, but if the script itself had errors or powershell threw an - /// exception + /// run, but if the script itself had + /// errors or powershell threw an exception /// Time to live for the resource. If not /// provided, will be available for 60 days /// Time the script execution was @@ -55,8 +61,8 @@ public ScriptExecution() /// Time the script execution was /// finished /// The state of the script execution - /// resource. Possible values include: 'Pending', 'Running', - /// 'Succeeded', 'Failed', 'Cancelling', 'Cancelled', + /// resource. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled', 'Pending', 'Running', 'Cancelling', 'Cancelled', /// 'Deleting' /// Standard output stream from the powershell /// execution @@ -67,8 +73,8 @@ public ScriptExecution() /// powershell execution /// Standard error output stream from the /// powershell execution - public ScriptExecution(string timeout, string id = default(string), string name = default(string), string type = default(string), string scriptCmdletId = default(string), IList parameters = default(IList), IList hiddenParameters = default(IList), string failureReason = default(string), string retention = default(string), System.DateTime? submittedAt = default(System.DateTime?), System.DateTime? startedAt = default(System.DateTime?), System.DateTime? finishedAt = default(System.DateTime?), string provisioningState = default(string), IList output = default(IList), IDictionary namedOutputs = default(IDictionary), IList information = default(IList), IList warnings = default(IList), IList errors = default(IList)) - : base(id, name, type) + public ScriptExecution(string timeout, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string scriptCmdletId = default(string), IList parameters = default(IList), IList hiddenParameters = default(IList), string failureReason = default(string), string retention = default(string), System.DateTime? submittedAt = default(System.DateTime?), System.DateTime? startedAt = default(System.DateTime?), System.DateTime? finishedAt = default(System.DateTime?), string provisioningState = default(string), IList output = default(IList), IDictionary namedOutputs = default(IDictionary), IList information = default(IList), IList warnings = default(IList), IList errors = default(IList)) + : base(id, name, type, systemData) { ScriptCmdletId = scriptCmdletId; Parameters = parameters; @@ -108,14 +114,16 @@ public ScriptExecution() /// /// Gets or sets parameters that will be hidden/not visible to ARM, - /// such as passwords and credentials + /// such as passwords and + /// credentials /// [JsonProperty(PropertyName = "properties.hiddenParameters")] public IList HiddenParameters { get; set; } /// /// Gets or sets error message if the script was able to run, but if - /// the script itself had errors or powershell threw an exception + /// the script itself had + /// errors or powershell threw an exception /// [JsonProperty(PropertyName = "properties.failureReason")] public string FailureReason { get; set; } @@ -153,8 +161,8 @@ public ScriptExecution() /// /// Gets the state of the script execution resource. Possible values - /// include: 'Pending', 'Running', 'Succeeded', 'Failed', 'Cancelling', - /// 'Cancelled', 'Deleting' + /// include: 'Succeeded', 'Failed', 'Canceled', 'Pending', 'Running', + /// 'Cancelling', 'Cancelled', 'Deleting' /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionParameterType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionParameterType.cs new file mode 100644 index 0000000000000..e8e974c2142a0 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionParameterType.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.Avs.Models +{ + + /// + /// Defines values for ScriptExecutionParameterType. + /// + public static class ScriptExecutionParameterType + { + public const string Value = "Value"; + public const string SecureValue = "SecureValue"; + public const string Credential = "Credential"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionProvisioningState.cs index 661d81d62b3db..30128f1b30455 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionProvisioningState.cs @@ -16,12 +16,37 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class ScriptExecutionProvisioningState { - public const string Pending = "Pending"; - public const string Running = "Running"; + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is pending + /// + public const string Pending = "Pending"; + /// + /// is running + /// + public const string Running = "Running"; + /// + /// is cancelling + /// public const string Cancelling = "Cancelling"; + /// + /// is cancelled + /// public const string Cancelled = "Cancelled"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionsCreateOrUpdateHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionsCreateOrUpdateHeaders.cs new file mode 100644 index 0000000000000..e0feaaace71b6 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionsCreateOrUpdateHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class ScriptExecutionsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the + /// ScriptExecutionsCreateOrUpdateHeaders class. + /// + public ScriptExecutionsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ScriptExecutionsCreateOrUpdateHeaders class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public ScriptExecutionsCreateOrUpdateHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionsDeleteHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionsDeleteHeaders.cs new file mode 100644 index 0000000000000..716b1df2d3565 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptExecutionsDeleteHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class ScriptExecutionsDeleteHeaders + { + /// + /// Initializes a new instance of the ScriptExecutionsDeleteHeaders + /// class. + /// + public ScriptExecutionsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScriptExecutionsDeleteHeaders + /// class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public ScriptExecutionsDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptOutputStreamType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptOutputStreamType.cs index aeb81fd77649b..64d3ce39b1301 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptOutputStreamType.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptOutputStreamType.cs @@ -16,9 +16,21 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class ScriptOutputStreamType { + /// + /// is information + /// public const string Information = "Information"; + /// + /// is warning + /// public const string Warning = "Warning"; + /// + /// is output + /// public const string Output = "Output"; + /// + /// is error + /// public const string Error = "Error"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptPackage.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptPackage.cs index a4009e17cc4ed..9b2369dfb9589 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptPackage.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptPackage.cs @@ -32,17 +32,31 @@ public ScriptPackage() /// /// Initializes a new instance of the ScriptPackage class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled' /// User friendly description of the /// package /// Module version - public ScriptPackage(string id = default(string), string name = default(string), string type = default(string), string description = default(string), string version = default(string)) - : base(id, name, type) + /// Company that created and supports the + /// package + /// Link to support by the package vendor + public ScriptPackage(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string description = default(string), string version = default(string), string company = default(string), string uri = default(string)) + : base(id, name, type, systemData) { + ProvisioningState = provisioningState; Description = description; Version = version; + Company = company; + Uri = uri; CustomInit(); } @@ -51,6 +65,13 @@ public ScriptPackage() /// partial void CustomInit(); + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + /// /// Gets user friendly description of the package /// @@ -63,5 +84,17 @@ public ScriptPackage() [JsonProperty(PropertyName = "properties.version")] public string Version { get; private set; } + /// + /// Gets company that created and supports the package + /// + [JsonProperty(PropertyName = "properties.company")] + public string Company { get; private set; } + + /// + /// Gets link to support by the package vendor + /// + [JsonProperty(PropertyName = "properties.uri")] + public string Uri { get; private set; } + } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptPackageProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptPackageProvisioningState.cs new file mode 100644 index 0000000000000..c563f0258a50b --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptPackageProvisioningState.cs @@ -0,0 +1,32 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for ScriptPackageProvisioningState. + /// + public static class ScriptPackageProvisioningState + { + /// + /// Resource has been created. + /// + public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// + public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptParameter.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptParameter.cs index 3bffcd6052387..dd1ebbbcba98e 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptParameter.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptParameter.cs @@ -30,16 +30,17 @@ public ScriptParameter() /// Initializes a new instance of the ScriptParameter class. /// /// The type of parameter the script is expecting. - /// psCredential is a PSCredentialObject. Possible values include: - /// 'String', 'SecureString', 'Credential', 'Int', 'Bool', - /// 'Float' + /// psCredential is a + /// PSCredentialObject. Possible values include: 'String', + /// 'SecureString', 'Credential', 'Int', 'Bool', 'Float' /// The parameter name that the script will expect a /// parameter value for /// User friendly description of the /// parameter /// Should this parameter be visible to arm - /// and passed in the parameters argument when executing. Possible - /// values include: 'Visible', 'Hidden' + /// and passed in the parameters argument + /// when executing. Possible values include: 'Visible', + /// 'Hidden' /// Is this parameter required or optional. /// Possible values include: 'Optional', 'Required' public ScriptParameter(string type = default(string), string name = default(string), string description = default(string), string visibility = default(string), string optional = default(string)) @@ -59,7 +60,8 @@ public ScriptParameter() /// /// Gets the type of parameter the script is expecting. psCredential is - /// a PSCredentialObject. Possible values include: 'String', + /// a + /// PSCredentialObject. Possible values include: 'String', /// 'SecureString', 'Credential', 'Int', 'Bool', 'Float' /// [JsonProperty(PropertyName = "type")] @@ -80,8 +82,8 @@ public ScriptParameter() /// /// Gets should this parameter be visible to arm and passed in the - /// parameters argument when executing. Possible values include: - /// 'Visible', 'Hidden' + /// parameters argument + /// when executing. Possible values include: 'Visible', 'Hidden' /// [JsonProperty(PropertyName = "visibility")] public string Visibility { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptParameterTypes.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptParameterTypes.cs index 6288be24c6db6..d3a450ead62d1 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptParameterTypes.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ScriptParameterTypes.cs @@ -16,11 +16,29 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class ScriptParameterTypes { + /// + /// is string + /// public const string String = "String"; + /// + /// is secure string + /// public const string SecureString = "SecureString"; + /// + /// is credential + /// public const string Credential = "Credential"; + /// + /// is int + /// public const string Int = "Int"; + /// + /// is bool + /// public const string Bool = "Bool"; + /// + /// is float + /// public const string Float = "Float"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SegmentStatusEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SegmentStatusEnum.cs index 6db7fd8dc8102..f7338397478a2 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SegmentStatusEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SegmentStatusEnum.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class SegmentStatusEnum { + /// + /// is success + /// public const string SUCCESS = "SUCCESS"; + /// + /// is failure + /// public const string FAILURE = "FAILURE"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ServiceSpecification.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ServiceSpecification.cs deleted file mode 100644 index 51953509b4a6f..0000000000000 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/ServiceSpecification.cs +++ /dev/null @@ -1,63 +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.Avs.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Service specification payload - /// - public partial class ServiceSpecification - { - /// - /// Initializes a new instance of the ServiceSpecification class. - /// - public ServiceSpecification() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ServiceSpecification class. - /// - /// Specifications of the Log for Azure - /// Monitoring - /// Specifications of the Metrics - /// for Azure Monitoring - public ServiceSpecification(IList logSpecifications = default(IList), IList metricSpecifications = default(IList)) - { - LogSpecifications = logSpecifications; - MetricSpecifications = metricSpecifications; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets specifications of the Log for Azure Monitoring - /// - [JsonProperty(PropertyName = "logSpecifications")] - public IList LogSpecifications { get; set; } - - /// - /// Gets or sets specifications of the Metrics for Azure Monitoring - /// - [JsonProperty(PropertyName = "metricSpecifications")] - public IList MetricSpecifications { get; set; } - - } -} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Sku.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Sku.cs index 99481802bbd76..2b6c1a9fc7dce 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Sku.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/Sku.cs @@ -30,10 +30,25 @@ public Sku() /// /// Initializes a new instance of the Sku class. /// - /// The name of the SKU. - public Sku(string name) + /// The name of the SKU. E.g. P3. It is typically a + /// letter+number code + /// Possible values include: 'Free', 'Basic', + /// 'Standard', 'Premium' + /// The SKU size. When the name field is the + /// combination of tier and some other value, this would be the + /// standalone code. + /// If the service has different generations of + /// hardware, for the same SKU, then that can be captured here. + /// If the SKU supports scale out/in then the + /// capacity integer should be included. If scale out/in is not + /// possible for the resource this may be omitted. + public Sku(string name, SkuTier? tier = default(SkuTier?), string size = default(string), string family = default(string), int? capacity = default(int?)) { Name = name; + Tier = tier; + Size = size; + Family = family; + Capacity = capacity; CustomInit(); } @@ -43,11 +58,41 @@ public Sku(string name) partial void CustomInit(); /// - /// Gets or sets the name of the SKU. + /// Gets or sets the name of the SKU. E.g. P3. It is typically a + /// letter+number code /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } + /// + /// Gets or sets possible values include: 'Free', 'Basic', 'Standard', + /// 'Premium' + /// + [JsonProperty(PropertyName = "tier")] + public SkuTier? Tier { get; set; } + + /// + /// Gets or sets the SKU size. When the name field is the combination + /// of tier and some other value, this would be the standalone code. + /// + [JsonProperty(PropertyName = "size")] + public string Size { get; set; } + + /// + /// Gets or sets if the service has different generations of hardware, + /// for the same SKU, then that can be captured here. + /// + [JsonProperty(PropertyName = "family")] + public string Family { get; set; } + + /// + /// Gets or sets if the SKU supports scale out/in then the capacity + /// integer should be included. If scale out/in is not possible for the + /// resource this may be omitted. + /// + [JsonProperty(PropertyName = "capacity")] + public int? Capacity { get; set; } + /// /// Validate the object. /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SkuTier.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SkuTier.cs new file mode 100644 index 0000000000000..5243d3e3b5150 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SkuTier.cs @@ -0,0 +1,72 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SkuTier. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum SkuTier + { + [EnumMember(Value = "Free")] + Free, + [EnumMember(Value = "Basic")] + Basic, + [EnumMember(Value = "Standard")] + Standard, + [EnumMember(Value = "Premium")] + Premium + } + internal static class SkuTierEnumExtension + { + internal static string ToSerializedValue(this SkuTier? value) + { + return value == null ? null : ((SkuTier)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SkuTier value) + { + switch( value ) + { + case SkuTier.Free: + return "Free"; + case SkuTier.Basic: + return "Basic"; + case SkuTier.Standard: + return "Standard"; + case SkuTier.Premium: + return "Premium"; + } + return null; + } + + internal static SkuTier? ParseSkuTier(this string value) + { + switch( value ) + { + case "Free": + return SkuTier.Free; + case "Basic": + return SkuTier.Basic; + case "Standard": + return SkuTier.Standard; + case "Premium": + return SkuTier.Premium; + } + return null; + } + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SslEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SslEnum.cs index 9b9bd13fb65f3..41f6ea055c17b 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SslEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SslEnum.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class SslEnum { + /// + /// is enabled + /// public const string Enabled = "Enabled"; + /// + /// is disabled + /// public const string Disabled = "Disabled"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SystemAssignedServiceIdentity.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SystemAssignedServiceIdentity.cs new file mode 100644 index 0000000000000..91b6d2df23689 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SystemAssignedServiceIdentity.cs @@ -0,0 +1,90 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Managed service identity (either system assigned, or none) + /// + public partial class SystemAssignedServiceIdentity + { + /// + /// Initializes a new instance of the SystemAssignedServiceIdentity + /// class. + /// + public SystemAssignedServiceIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemAssignedServiceIdentity + /// class. + /// + /// Possible values include: 'None', + /// 'SystemAssigned' + /// The service principal ID of the system + /// assigned identity. This property will only be provided for a system + /// assigned identity. + /// The tenant ID of the system assigned + /// identity. This property will only be provided for a system assigned + /// identity. + public SystemAssignedServiceIdentity(string type, System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the service principal ID of the system assigned identity. This + /// property will only be provided for a system assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public System.Guid? PrincipalId { get; private set; } + + /// + /// Gets the tenant ID of the system assigned identity. This property + /// will only be provided for a system assigned identity. + /// + [JsonProperty(PropertyName = "tenantId")] + public System.Guid? TenantId { get; private set; } + + /// + /// Gets or sets possible values include: 'None', 'SystemAssigned' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + } + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SystemAssignedServiceIdentityType.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SystemAssignedServiceIdentityType.cs new file mode 100644 index 0000000000000..7370e3522e506 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SystemAssignedServiceIdentityType.cs @@ -0,0 +1,22 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for SystemAssignedServiceIdentityType. + /// + public static class SystemAssignedServiceIdentityType + { + public const string None = "None"; + public const string SystemAssigned = "SystemAssigned"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SystemData.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SystemData.cs new file mode 100644 index 0000000000000..a78da7ba59748 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource last + /// modification (UTC) + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/TrackedResource.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/TrackedResource.cs index ceab1c9c3e56c..17dcf73e2df12 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/TrackedResource.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/TrackedResource.cs @@ -10,14 +10,19 @@ namespace Microsoft.Azure.Management.Avs.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// The resource model definition for a ARM tracked top level resource + /// Tracked Resource /// + /// + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' + /// public partial class TrackedResource : Resource { /// @@ -31,16 +36,22 @@ public TrackedResource() /// /// Initializes a new instance of the TrackedResource class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location - /// Resource tags - public TrackedResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary)) - : base(id, name, type) + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// Resource tags. + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary)) + : base(id, name, type, systemData) { - Location = location; Tags = tags; + Location = location; CustomInit(); } @@ -50,16 +61,29 @@ public TrackedResource() partial void CustomInit(); /// - /// Gets or sets resource location + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the geo-location where the resource lives /// [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// - /// Gets or sets resource tags + /// Validate the object. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/TrialStatus.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/TrialStatus.cs index cb1dbdd2d8fa6..f257c74ad14c7 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/TrialStatus.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/TrialStatus.cs @@ -16,8 +16,17 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class TrialStatus { + /// + /// is available + /// public const string TrialAvailable = "TrialAvailable"; + /// + /// is used + /// public const string TrialUsed = "TrialUsed"; + /// + /// is disabled + /// public const string TrialDisabled = "TrialDisabled"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMGroupStatusEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMGroupStatusEnum.cs index 27a0299db2f0e..4ff3d7cd67b75 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMGroupStatusEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMGroupStatusEnum.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class VMGroupStatusEnum { + /// + /// is success + /// public const string SUCCESS = "SUCCESS"; + /// + /// is failure + /// public const string FAILURE = "FAILURE"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMTypeEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMTypeEnum.cs index 758ae70f1f6e0..0bda69b7d9b56 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMTypeEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VMTypeEnum.cs @@ -16,8 +16,17 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class VMTypeEnum { + /// + /// is regular + /// public const string REGULAR = "REGULAR"; + /// + /// is edge + /// public const string EDGE = "EDGE"; + /// + /// is service + /// public const string SERVICE = "SERVICE"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachine.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachine.cs index 1459a2563d0f6..b21c64826cc55 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachine.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachine.cs @@ -32,19 +32,29 @@ public VirtualMachine() /// /// Initializes a new instance of the VirtualMachine class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled' /// Display name of the VM. /// Virtual machine managed object reference /// id /// Path to virtual machine's folder starting /// from datacenter virtual machine folder - /// Possible values include: 'Enabled', - /// 'Disabled' - public VirtualMachine(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string moRefId = default(string), string folderPath = default(string), string restrictMovement = default(string)) - : base(id, name, type) + /// Whether VM DRS-driven movement is + /// restricted (enabled) or not (disabled). Possible values include: + /// 'Enabled', 'Disabled' + public VirtualMachine(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string displayName = default(string), string moRefId = default(string), string folderPath = default(string), string restrictMovement = default(string)) + : base(id, name, type, systemData) { + ProvisioningState = provisioningState; DisplayName = displayName; MoRefId = moRefId; FolderPath = folderPath; @@ -57,6 +67,13 @@ public VirtualMachine() /// partial void CustomInit(); + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + /// /// Gets display name of the VM. /// @@ -77,7 +94,8 @@ public VirtualMachine() public string FolderPath { get; private set; } /// - /// Gets possible values include: 'Enabled', 'Disabled' + /// Gets whether VM DRS-driven movement is restricted (enabled) or not + /// (disabled). Possible values include: 'Enabled', 'Disabled' /// [JsonProperty(PropertyName = "properties.restrictMovement")] public string RestrictMovement { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineProvisioningState.cs new file mode 100644 index 0000000000000..cccc89d061369 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineProvisioningState.cs @@ -0,0 +1,32 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for VirtualMachineProvisioningState. + /// + public static class VirtualMachineProvisioningState + { + /// + /// Resource has been created. + /// + public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// + public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovement.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovement.cs index 641ff49e8de41..d5ebc836c70a6 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovement.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovement.cs @@ -31,8 +31,9 @@ public VirtualMachineRestrictMovement() /// Initializes a new instance of the VirtualMachineRestrictMovement /// class. /// - /// Possible values include: 'Enabled', - /// 'Disabled' + /// Whether VM DRS-driven movement is + /// restricted (enabled) or not (disabled). Possible values include: + /// 'Enabled', 'Disabled' public VirtualMachineRestrictMovement(string restrictMovement = default(string)) { RestrictMovement = restrictMovement; @@ -45,7 +46,8 @@ public VirtualMachineRestrictMovement() partial void CustomInit(); /// - /// Gets or sets possible values include: 'Enabled', 'Disabled' + /// Gets or sets whether VM DRS-driven movement is restricted (enabled) + /// or not (disabled). Possible values include: 'Enabled', 'Disabled' /// [JsonProperty(PropertyName = "restrictMovement")] public string RestrictMovement { get; set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovementState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovementState.cs index f2d85e9b9756c..12b6c5470f260 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovementState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachineRestrictMovementState.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class VirtualMachineRestrictMovementState { + /// + /// is enabled + /// public const string Enabled = "Enabled"; + /// + /// is disabled + /// public const string Disabled = "Disabled"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachinesRestrictMovementHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachinesRestrictMovementHeaders.cs new file mode 100644 index 0000000000000..2462a2f863186 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VirtualMachinesRestrictMovementHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for RestrictMovement operation. + /// + public partial class VirtualMachinesRestrictMovementHeaders + { + /// + /// Initializes a new instance of the + /// VirtualMachinesRestrictMovementHeaders class. + /// + public VirtualMachinesRestrictMovementHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// VirtualMachinesRestrictMovementHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public VirtualMachinesRestrictMovementHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VisibilityParameterEnum.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VisibilityParameterEnum.cs index c4ac4b7bdeca8..2085d4d78b917 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VisibilityParameterEnum.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VisibilityParameterEnum.cs @@ -16,7 +16,13 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class VisibilityParameterEnum { + /// + /// is visible + /// public const string Visible = "Visible"; + /// + /// is hidden + /// public const string Hidden = "Hidden"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmHostPlacementPolicyProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmHostPlacementPolicyProperties.cs index bc174c1c3367b..ebde950f183d6 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmHostPlacementPolicyProperties.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmHostPlacementPolicyProperties.cs @@ -44,14 +44,22 @@ public VmHostPlacementPolicyProperties() /// Display name of the placement /// policy /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', - /// 'Updating' - public VmHostPlacementPolicyProperties(IList vmMembers, IList hostMembers, string affinityType, string state = default(string), string displayName = default(string), string provisioningState = default(string)) + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' + /// vm-host placement policy affinity + /// strength (should/must). Possible values include: 'Should', + /// 'Must' + /// placement policy azure hybrid + /// benefit opt-in type. Possible values include: 'SqlHost', + /// 'None' + public VmHostPlacementPolicyProperties(IList vmMembers, IList hostMembers, string affinityType, string state = default(string), string displayName = default(string), string provisioningState = default(string), string affinityStrength = default(string), string azureHybridBenefitType = default(string)) : base(state, displayName, provisioningState) { VmMembers = vmMembers; HostMembers = hostMembers; AffinityType = affinityType; + AffinityStrength = affinityStrength; + AzureHybridBenefitType = azureHybridBenefitType; CustomInit(); } @@ -79,6 +87,20 @@ public VmHostPlacementPolicyProperties() [JsonProperty(PropertyName = "affinityType")] public string AffinityType { get; set; } + /// + /// Gets or sets vm-host placement policy affinity strength + /// (should/must). Possible values include: 'Should', 'Must' + /// + [JsonProperty(PropertyName = "affinityStrength")] + public string AffinityStrength { get; set; } + + /// + /// Gets or sets placement policy azure hybrid benefit opt-in type. + /// Possible values include: 'SqlHost', 'None' + /// + [JsonProperty(PropertyName = "azureHybridBenefitType")] + public string AzureHybridBenefitType { get; set; } + /// /// Validate the object. /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmVmPlacementPolicyProperties.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmVmPlacementPolicyProperties.cs index 145bbaaf0756e..ff6a5f1aafd4b 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmVmPlacementPolicyProperties.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/VmVmPlacementPolicyProperties.cs @@ -43,8 +43,8 @@ public VmVmPlacementPolicyProperties() /// Display name of the placement /// policy /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', - /// 'Updating' + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' public VmVmPlacementPolicyProperties(IList vmMembers, string affinityType, string state = default(string), string displayName = default(string), string provisioningState = default(string)) : base(state, displayName, provisioningState) { diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetwork.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetwork.cs new file mode 100644 index 0000000000000..e137cb9f6867d --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetwork.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.Avs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Workload Network + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkloadNetwork : ProxyResource + { + /// + /// Initializes a new instance of the WorkloadNetwork class. + /// + public WorkloadNetwork() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadNetwork class. + /// + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled', 'Building', 'Deleting', 'Updating' + public WorkloadNetwork(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string)) + : base(id, name, type, systemData) + { + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled', 'Building', 'Deleting', + /// 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcp.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcp.cs index ba3f6e664ab33..1dfaf58d72c5a 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcp.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcp.cs @@ -29,12 +29,18 @@ public WorkloadNetworkDhcp() /// /// Initializes a new instance of the WorkloadNetworkDhcp class. /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// DHCP properties. - public WorkloadNetworkDhcp(string id = default(string), string name = default(string), string type = default(string), WorkloadNetworkDhcpEntity properties = default(WorkloadNetworkDhcpEntity)) - : base(id, name, type) + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The resource-specific properties for this + /// resource. + public WorkloadNetworkDhcp(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), WorkloadNetworkDhcpEntity properties = default(WorkloadNetworkDhcpEntity)) + : base(id, name, type, systemData) { Properties = properties; CustomInit(); @@ -46,7 +52,7 @@ public WorkloadNetworkDhcp() partial void CustomInit(); /// - /// Gets or sets DHCP properties. + /// Gets or sets the resource-specific properties for this resource. /// [JsonProperty(PropertyName = "properties")] public WorkloadNetworkDhcpEntity Properties { get; set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpEntity.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpEntity.cs index 01a6e98fb1370..d2543dbfa4b5a 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpEntity.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpEntity.cs @@ -17,7 +17,8 @@ namespace Microsoft.Azure.Management.Avs.Models /// /// Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay - /// to inherit from + /// to + /// inherit from /// public partial class WorkloadNetworkDhcpEntity { @@ -35,8 +36,8 @@ public WorkloadNetworkDhcpEntity() /// Display name of the DHCP entity. /// NSX Segments consuming DHCP. /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', - /// 'Updating' + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' /// NSX revision number. public WorkloadNetworkDhcpEntity(string displayName = default(string), IList segments = default(IList), string provisioningState = default(string), long? revision = default(long?)) { @@ -66,7 +67,7 @@ public WorkloadNetworkDhcpEntity() /// /// Gets the provisioning state. Possible values include: 'Succeeded', - /// 'Failed', 'Building', 'Deleting', 'Updating' + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' /// [JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpEntityUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpEntityUpdate.cs new file mode 100644 index 0000000000000..cea7a46e572b3 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpEntityUpdate.cs @@ -0,0 +1,63 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay + /// to + /// inherit from + /// + public partial class WorkloadNetworkDhcpEntityUpdate + { + /// + /// Initializes a new instance of the WorkloadNetworkDhcpEntityUpdate + /// class. + /// + public WorkloadNetworkDhcpEntityUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadNetworkDhcpEntityUpdate + /// class. + /// + /// Display name of the DHCP entity. + /// NSX revision number. + public WorkloadNetworkDhcpEntityUpdate(string displayName = default(string), long? revision = default(long?)) + { + DisplayName = displayName; + Revision = revision; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets display name of the DHCP entity. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets NSX revision number. + /// + [JsonProperty(PropertyName = "revision")] + public long? Revision { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpProvisioningState.cs index e59d525f1b9d9..42e331417ced3 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpProvisioningState.cs @@ -16,10 +16,29 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class WorkloadNetworkDhcpProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is building + /// public const string Building = "Building"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpRelay.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpRelay.cs index 474f7707bc726..f5eafdd268c5f 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpRelay.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpRelay.cs @@ -36,8 +36,8 @@ public WorkloadNetworkDhcpRelay() /// Display name of the DHCP entity. /// NSX Segments consuming DHCP. /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', - /// 'Updating' + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' /// NSX revision number. /// DHCP Relay Addresses. Max 3. public WorkloadNetworkDhcpRelay(string displayName = default(string), IList segments = default(IList), string provisioningState = default(string), long? revision = default(long?), IList serverAddresses = default(IList)) diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpRelayUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpRelayUpdate.cs new file mode 100644 index 0000000000000..f6891643248e1 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpRelayUpdate.cs @@ -0,0 +1,80 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// NSX DHCP Relay + /// + [Newtonsoft.Json.JsonObject("RELAY")] + public partial class WorkloadNetworkDhcpRelayUpdate : WorkloadNetworkDhcpEntityUpdate + { + /// + /// Initializes a new instance of the WorkloadNetworkDhcpRelayUpdate + /// class. + /// + public WorkloadNetworkDhcpRelayUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadNetworkDhcpRelayUpdate + /// class. + /// + /// Display name of the DHCP entity. + /// NSX revision number. + /// DHCP Relay Addresses. Max 3. + public WorkloadNetworkDhcpRelayUpdate(string displayName = default(string), long? revision = default(long?), IList serverAddresses = default(IList)) + : base(displayName, revision) + { + ServerAddresses = serverAddresses; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets DHCP Relay Addresses. Max 3. + /// + [JsonProperty(PropertyName = "serverAddresses")] + public IList ServerAddresses { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ServerAddresses != null) + { + if (ServerAddresses.Count > 3) + { + throw new ValidationException(ValidationRules.MaxItems, "ServerAddresses", 3); + } + if (ServerAddresses.Count < 1) + { + throw new ValidationException(ValidationRules.MinItems, "ServerAddresses", 1); + } + } + } + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpServer.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpServer.cs index 8789ca861cdf7..d91e92b44fa27 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpServer.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpServer.cs @@ -35,8 +35,8 @@ public WorkloadNetworkDhcpServer() /// Display name of the DHCP entity. /// NSX Segments consuming DHCP. /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', - /// 'Updating' + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' /// NSX revision number. /// DHCP Server Address. /// DHCP Server Lease Time. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpServerUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpServerUpdate.cs new file mode 100644 index 0000000000000..dce66f88319a6 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpServerUpdate.cs @@ -0,0 +1,65 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// NSX DHCP Server + /// + [Newtonsoft.Json.JsonObject("SERVER")] + public partial class WorkloadNetworkDhcpServerUpdate : WorkloadNetworkDhcpEntityUpdate + { + /// + /// Initializes a new instance of the WorkloadNetworkDhcpServerUpdate + /// class. + /// + public WorkloadNetworkDhcpServerUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadNetworkDhcpServerUpdate + /// class. + /// + /// Display name of the DHCP entity. + /// NSX revision number. + /// DHCP Server Address. + /// DHCP Server Lease Time. + public WorkloadNetworkDhcpServerUpdate(string displayName = default(string), long? revision = default(long?), string serverAddress = default(string), long? leaseTime = default(long?)) + : base(displayName, revision) + { + ServerAddress = serverAddress; + LeaseTime = leaseTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets DHCP Server Address. + /// + [JsonProperty(PropertyName = "serverAddress")] + public string ServerAddress { get; set; } + + /// + /// Gets or sets DHCP Server Lease Time. + /// + [JsonProperty(PropertyName = "leaseTime")] + public long? LeaseTime { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpUpdate.cs new file mode 100644 index 0000000000000..610c5da9564b8 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDhcpUpdate.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// NSX DHCP update + /// + public partial class WorkloadNetworkDhcpUpdate + { + /// + /// Initializes a new instance of the WorkloadNetworkDhcpUpdate class. + /// + public WorkloadNetworkDhcpUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadNetworkDhcpUpdate class. + /// + /// The updatable properties of a DHCP + /// update + public WorkloadNetworkDhcpUpdate(WorkloadNetworkDhcpEntityUpdate properties = default(WorkloadNetworkDhcpEntityUpdate)) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the updatable properties of a DHCP update + /// + [JsonProperty(PropertyName = "properties")] + public WorkloadNetworkDhcpEntityUpdate Properties { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsService.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsService.cs index f7b72940ff464..7b431cc29ccc1 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsService.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsService.cs @@ -34,9 +34,14 @@ public WorkloadNetworkDnsService() /// /// Initializes a new instance of the WorkloadNetworkDnsService class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Display name of the DNS Service. /// DNS service IP of the DNS /// Service. @@ -48,11 +53,11 @@ public WorkloadNetworkDnsService() /// DNS Service status. Possible values include: /// 'SUCCESS', 'FAILURE' /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', - /// 'Updating' + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' /// NSX revision number. - public WorkloadNetworkDnsService(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string dnsServiceIp = default(string), string defaultDnsZone = default(string), IList fqdnZones = default(IList), string logLevel = default(string), string status = default(string), string provisioningState = default(string), long? revision = default(long?)) - : base(id, name, type) + public WorkloadNetworkDnsService(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string displayName = default(string), string dnsServiceIp = default(string), string defaultDnsZone = default(string), IList fqdnZones = default(IList), string logLevel = default(string), string status = default(string), string provisioningState = default(string), long? revision = default(long?)) + : base(id, name, type, systemData) { DisplayName = displayName; DnsServiceIp = dnsServiceIp; @@ -110,7 +115,7 @@ public WorkloadNetworkDnsService() /// /// Gets the provisioning state. Possible values include: 'Succeeded', - /// 'Failed', 'Building', 'Deleting', 'Updating' + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsServiceProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsServiceProvisioningState.cs index ee847a80a88bb..3629d8f51cfd9 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsServiceProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsServiceProvisioningState.cs @@ -16,10 +16,29 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class WorkloadNetworkDnsServiceProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is building + /// public const string Building = "Building"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsServiceUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsServiceUpdate.cs new file mode 100644 index 0000000000000..4c17e871988a3 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsServiceUpdate.cs @@ -0,0 +1,123 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// NSX DNS Service update + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkloadNetworkDnsServiceUpdate + { + /// + /// Initializes a new instance of the WorkloadNetworkDnsServiceUpdate + /// class. + /// + public WorkloadNetworkDnsServiceUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadNetworkDnsServiceUpdate + /// class. + /// + /// Display name of the DNS Service. + /// DNS service IP of the DNS + /// Service. + /// Default DNS zone of the DNS + /// Service. + /// FQDN zones of the DNS Service. + /// DNS Service log level. Possible values + /// include: 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'FATAL' + /// DNS Service status. Possible values include: + /// 'SUCCESS', 'FAILURE' + /// The provisioning state. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' + /// NSX revision number. + public WorkloadNetworkDnsServiceUpdate(string displayName = default(string), string dnsServiceIp = default(string), string defaultDnsZone = default(string), IList fqdnZones = default(IList), string logLevel = default(string), string status = default(string), string provisioningState = default(string), long? revision = default(long?)) + { + DisplayName = displayName; + DnsServiceIp = dnsServiceIp; + DefaultDnsZone = defaultDnsZone; + FqdnZones = fqdnZones; + LogLevel = logLevel; + Status = status; + ProvisioningState = provisioningState; + Revision = revision; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets display name of the DNS Service. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets DNS service IP of the DNS Service. + /// + [JsonProperty(PropertyName = "properties.dnsServiceIp")] + public string DnsServiceIp { get; set; } + + /// + /// Gets or sets default DNS zone of the DNS Service. + /// + [JsonProperty(PropertyName = "properties.defaultDnsZone")] + public string DefaultDnsZone { get; set; } + + /// + /// Gets or sets FQDN zones of the DNS Service. + /// + [JsonProperty(PropertyName = "properties.fqdnZones")] + public IList FqdnZones { get; set; } + + /// + /// Gets or sets DNS Service log level. Possible values include: + /// 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'FATAL' + /// + [JsonProperty(PropertyName = "properties.logLevel")] + public string LogLevel { get; set; } + + /// + /// Gets DNS Service status. Possible values include: 'SUCCESS', + /// 'FAILURE' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets the provisioning state. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets NSX revision number. + /// + [JsonProperty(PropertyName = "properties.revision")] + public long? Revision { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsZone.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsZone.cs index 63b7d3d95dfa9..41b58fc49eaa5 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsZone.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsZone.cs @@ -34,9 +34,14 @@ public WorkloadNetworkDnsZone() /// /// Initializes a new instance of the WorkloadNetworkDnsZone class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Display name of the DNS Zone. /// Domain names of the DNS Zone. /// DNS Server IP array of the DNS @@ -45,11 +50,11 @@ public WorkloadNetworkDnsZone() /// Number of DNS Services using the DNS /// zone. /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', - /// 'Updating' + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' /// NSX revision number. - public WorkloadNetworkDnsZone(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), IList domain = default(IList), IList dnsServerIps = default(IList), string sourceIp = default(string), long? dnsServices = default(long?), string provisioningState = default(string), long? revision = default(long?)) - : base(id, name, type) + public WorkloadNetworkDnsZone(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string displayName = default(string), IList domain = default(IList), IList dnsServerIps = default(IList), string sourceIp = default(string), int? dnsServices = default(int?), string provisioningState = default(string), long? revision = default(long?)) + : base(id, name, type, systemData) { DisplayName = displayName; Domain = domain; @@ -94,11 +99,11 @@ public WorkloadNetworkDnsZone() /// Gets or sets number of DNS Services using the DNS zone. /// [JsonProperty(PropertyName = "properties.dnsServices")] - public long? DnsServices { get; set; } + public int? DnsServices { get; set; } /// /// Gets the provisioning state. Possible values include: 'Succeeded', - /// 'Failed', 'Building', 'Deleting', 'Updating' + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsZoneProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsZoneProvisioningState.cs index ab4a5e681da0a..11a22ac820744 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsZoneProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsZoneProvisioningState.cs @@ -16,10 +16,29 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class WorkloadNetworkDnsZoneProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is building + /// public const string Building = "Building"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsZoneUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsZoneUpdate.cs new file mode 100644 index 0000000000000..66bb4b826fb81 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkDnsZoneUpdate.cs @@ -0,0 +1,111 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// NSX DNS Zone update + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkloadNetworkDnsZoneUpdate + { + /// + /// Initializes a new instance of the WorkloadNetworkDnsZoneUpdate + /// class. + /// + public WorkloadNetworkDnsZoneUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadNetworkDnsZoneUpdate + /// class. + /// + /// Display name of the DNS Zone. + /// Domain names of the DNS Zone. + /// DNS Server IP array of the DNS + /// Zone. + /// Source IP of the DNS Zone. + /// Number of DNS Services using the DNS + /// zone. + /// The provisioning state. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' + /// NSX revision number. + public WorkloadNetworkDnsZoneUpdate(string displayName = default(string), IList domain = default(IList), IList dnsServerIps = default(IList), string sourceIp = default(string), int? dnsServices = default(int?), string provisioningState = default(string), long? revision = default(long?)) + { + DisplayName = displayName; + Domain = domain; + DnsServerIps = dnsServerIps; + SourceIp = sourceIp; + DnsServices = dnsServices; + ProvisioningState = provisioningState; + Revision = revision; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets display name of the DNS Zone. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets domain names of the DNS Zone. + /// + [JsonProperty(PropertyName = "properties.domain")] + public IList Domain { get; set; } + + /// + /// Gets or sets DNS Server IP array of the DNS Zone. + /// + [JsonProperty(PropertyName = "properties.dnsServerIps")] + public IList DnsServerIps { get; set; } + + /// + /// Gets or sets source IP of the DNS Zone. + /// + [JsonProperty(PropertyName = "properties.sourceIp")] + public string SourceIp { get; set; } + + /// + /// Gets or sets number of DNS Services using the DNS zone. + /// + [JsonProperty(PropertyName = "properties.dnsServices")] + public int? DnsServices { get; set; } + + /// + /// Gets the provisioning state. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets NSX revision number. + /// + [JsonProperty(PropertyName = "properties.revision")] + public long? Revision { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkGateway.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkGateway.cs index 479d1664d4465..deefb37d27045 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkGateway.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkGateway.cs @@ -32,14 +32,23 @@ public WorkloadNetworkGateway() /// /// Initializes a new instance of the WorkloadNetworkGateway class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled', 'Building', 'Deleting', 'Updating' /// Display name of the DHCP entity. /// NSX Gateway Path. - public WorkloadNetworkGateway(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string path = default(string)) - : base(id, name, type) + public WorkloadNetworkGateway(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string displayName = default(string), string path = default(string)) + : base(id, name, type, systemData) { + ProvisioningState = provisioningState; DisplayName = displayName; Path = path; CustomInit(); @@ -50,6 +59,14 @@ public WorkloadNetworkGateway() /// partial void CustomInit(); + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled', 'Building', 'Deleting', + /// 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + /// /// Gets or sets display name of the DHCP entity. /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroring.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroring.cs index cd66a9d91106a..ff532c5dd0a4c 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroring.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroring.cs @@ -34,9 +34,14 @@ public WorkloadNetworkPortMirroring() /// Initializes a new instance of the WorkloadNetworkPortMirroring /// class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Display name of the port mirroring /// profile. /// Direction of port mirroring profile. @@ -47,11 +52,11 @@ public WorkloadNetworkPortMirroring() /// Port Mirroring Status. Possible values /// include: 'SUCCESS', 'FAILURE' /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', - /// 'Updating' + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' /// NSX revision number. - public WorkloadNetworkPortMirroring(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string direction = default(string), string source = default(string), string destination = default(string), string status = default(string), string provisioningState = default(string), long? revision = default(long?)) - : base(id, name, type) + public WorkloadNetworkPortMirroring(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string displayName = default(string), string direction = default(string), string source = default(string), string destination = default(string), string status = default(string), string provisioningState = default(string), long? revision = default(long?)) + : base(id, name, type, systemData) { DisplayName = displayName; Direction = direction; @@ -102,7 +107,7 @@ public WorkloadNetworkPortMirroring() /// /// Gets the provisioning state. Possible values include: 'Succeeded', - /// 'Failed', 'Building', 'Deleting', 'Updating' + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroringProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroringProvisioningState.cs index 4375fc5b321bb..b1915e7eb2984 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroringProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroringProvisioningState.cs @@ -16,10 +16,29 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class WorkloadNetworkPortMirroringProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is building + /// public const string Building = "Building"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroringUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroringUpdate.cs new file mode 100644 index 0000000000000..67791465a60da --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPortMirroringUpdate.cs @@ -0,0 +1,113 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// NSX Port Mirroring update + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkloadNetworkPortMirroringUpdate + { + /// + /// Initializes a new instance of the + /// WorkloadNetworkPortMirroringUpdate class. + /// + public WorkloadNetworkPortMirroringUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworkPortMirroringUpdate class. + /// + /// Display name of the port mirroring + /// profile. + /// Direction of port mirroring profile. + /// Possible values include: 'INGRESS', 'EGRESS', + /// 'BIDIRECTIONAL' + /// Source VM Group. + /// Destination VM Group. + /// Port Mirroring Status. Possible values + /// include: 'SUCCESS', 'FAILURE' + /// The provisioning state. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' + /// NSX revision number. + public WorkloadNetworkPortMirroringUpdate(string displayName = default(string), string direction = default(string), string source = default(string), string destination = default(string), string status = default(string), string provisioningState = default(string), long? revision = default(long?)) + { + DisplayName = displayName; + Direction = direction; + Source = source; + Destination = destination; + Status = status; + ProvisioningState = provisioningState; + Revision = revision; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets display name of the port mirroring profile. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets direction of port mirroring profile. Possible values + /// include: 'INGRESS', 'EGRESS', 'BIDIRECTIONAL' + /// + [JsonProperty(PropertyName = "properties.direction")] + public string Direction { get; set; } + + /// + /// Gets or sets source VM Group. + /// + [JsonProperty(PropertyName = "properties.source")] + public string Source { get; set; } + + /// + /// Gets or sets destination VM Group. + /// + [JsonProperty(PropertyName = "properties.destination")] + public string Destination { get; set; } + + /// + /// Gets port Mirroring Status. Possible values include: 'SUCCESS', + /// 'FAILURE' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets the provisioning state. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets NSX revision number. + /// + [JsonProperty(PropertyName = "properties.revision")] + public long? Revision { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkProvisioningState.cs new file mode 100644 index 0000000000000..82b0080961028 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkProvisioningState.cs @@ -0,0 +1,44 @@ +// +// 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.Avs.Models +{ + + /// + /// Defines values for WorkloadNetworkProvisioningState. + /// + public static class WorkloadNetworkProvisioningState + { + /// + /// Resource has been created. + /// + public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// + public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is building + /// + public const string Building = "Building"; + /// + /// is deleting + /// + public const string Deleting = "Deleting"; + /// + /// is updating + /// + public const string Updating = "Updating"; + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPublicIP.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPublicIP.cs index 423f2ddb1b3ca..b60162167d104 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPublicIP.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPublicIP.cs @@ -32,9 +32,14 @@ public WorkloadNetworkPublicIP() /// /// Initializes a new instance of the WorkloadNetworkPublicIP class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Display name of the Public IP /// Block. /// Number of Public IPs @@ -42,10 +47,10 @@ public WorkloadNetworkPublicIP() /// CIDR Block of the Public IP /// Block. /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', - /// 'Updating' - public WorkloadNetworkPublicIP(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), long? numberOfPublicIPs = default(long?), string publicIPBlock = default(string), string provisioningState = default(string)) - : base(id, name, type) + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' + public WorkloadNetworkPublicIP(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string displayName = default(string), long? numberOfPublicIPs = default(long?), string publicIPBlock = default(string), string provisioningState = default(string)) + : base(id, name, type, systemData) { DisplayName = displayName; NumberOfPublicIPs = numberOfPublicIPs; @@ -79,7 +84,7 @@ public WorkloadNetworkPublicIP() /// /// Gets the provisioning state. Possible values include: 'Succeeded', - /// 'Failed', 'Building', 'Deleting', 'Updating' + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPublicIPProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPublicIPProvisioningState.cs index 74e020a2d6018..22c88ec6a3a6a 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPublicIPProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkPublicIPProvisioningState.cs @@ -16,10 +16,29 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class WorkloadNetworkPublicIPProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is building + /// public const string Building = "Building"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegment.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegment.cs index 3d61e730f4121..fe4977d954e5a 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegment.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegment.cs @@ -34,9 +34,14 @@ public WorkloadNetworkSegment() /// /// Initializes a new instance of the WorkloadNetworkSegment class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Display name of the segment. /// Gateway which to connect segment /// to. @@ -46,11 +51,11 @@ public WorkloadNetworkSegment() /// Segment status. Possible values include: /// 'SUCCESS', 'FAILURE' /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', - /// 'Updating' + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' /// NSX revision number. - public WorkloadNetworkSegment(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string connectedGateway = default(string), WorkloadNetworkSegmentSubnet subnet = default(WorkloadNetworkSegmentSubnet), IList portVif = default(IList), string status = default(string), string provisioningState = default(string), long? revision = default(long?)) - : base(id, name, type) + public WorkloadNetworkSegment(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string displayName = default(string), string connectedGateway = default(string), WorkloadNetworkSegmentSubnet subnet = default(WorkloadNetworkSegmentSubnet), IList portVif = default(IList), string status = default(string), string provisioningState = default(string), long? revision = default(long?)) + : base(id, name, type, systemData) { DisplayName = displayName; ConnectedGateway = connectedGateway; @@ -99,7 +104,7 @@ public WorkloadNetworkSegment() /// /// Gets the provisioning state. Possible values include: 'Succeeded', - /// 'Failed', 'Building', 'Deleting', 'Updating' + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegmentProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegmentProvisioningState.cs index a2940a28f10b7..7b3dfbbde653f 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegmentProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegmentProvisioningState.cs @@ -16,10 +16,29 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class WorkloadNetworkSegmentProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is building + /// public const string Building = "Building"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegmentUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegmentUpdate.cs new file mode 100644 index 0000000000000..20037aa6a238f --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkSegmentUpdate.cs @@ -0,0 +1,112 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// NSX Segment update + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkloadNetworkSegmentUpdate + { + /// + /// Initializes a new instance of the WorkloadNetworkSegmentUpdate + /// class. + /// + public WorkloadNetworkSegmentUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadNetworkSegmentUpdate + /// class. + /// + /// Display name of the segment. + /// Gateway which to connect segment + /// to. + /// Subnet which to connect segment to. + /// Port Vif which segment is associated + /// with. + /// Segment status. Possible values include: + /// 'SUCCESS', 'FAILURE' + /// The provisioning state. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' + /// NSX revision number. + public WorkloadNetworkSegmentUpdate(string displayName = default(string), string connectedGateway = default(string), WorkloadNetworkSegmentSubnet subnet = default(WorkloadNetworkSegmentSubnet), IList portVif = default(IList), string status = default(string), string provisioningState = default(string), long? revision = default(long?)) + { + DisplayName = displayName; + ConnectedGateway = connectedGateway; + Subnet = subnet; + PortVif = portVif; + Status = status; + ProvisioningState = provisioningState; + Revision = revision; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets display name of the segment. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets gateway which to connect segment to. + /// + [JsonProperty(PropertyName = "properties.connectedGateway")] + public string ConnectedGateway { get; set; } + + /// + /// Gets or sets subnet which to connect segment to. + /// + [JsonProperty(PropertyName = "properties.subnet")] + public WorkloadNetworkSegmentSubnet Subnet { get; set; } + + /// + /// Gets port Vif which segment is associated with. + /// + [JsonProperty(PropertyName = "properties.portVif")] + public IList PortVif { get; private set; } + + /// + /// Gets segment status. Possible values include: 'SUCCESS', 'FAILURE' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets the provisioning state. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets NSX revision number. + /// + [JsonProperty(PropertyName = "properties.revision")] + public long? Revision { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroup.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroup.cs index bfd3bf72e3500..809513e8e74c9 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroup.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroup.cs @@ -34,20 +34,25 @@ public WorkloadNetworkVMGroup() /// /// Initializes a new instance of the WorkloadNetworkVMGroup class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Display name of the VM group. /// Virtual machine members of this /// group. /// VM Group status. Possible values include: /// 'SUCCESS', 'FAILURE' /// The provisioning state. Possible - /// values include: 'Succeeded', 'Failed', 'Building', 'Deleting', - /// 'Updating' + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' /// NSX revision number. - public WorkloadNetworkVMGroup(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), IList members = default(IList), string status = default(string), string provisioningState = default(string), long? revision = default(long?)) - : base(id, name, type) + public WorkloadNetworkVMGroup(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string displayName = default(string), IList members = default(IList), string status = default(string), string provisioningState = default(string), long? revision = default(long?)) + : base(id, name, type, systemData) { DisplayName = displayName; Members = members; @@ -82,7 +87,7 @@ public WorkloadNetworkVMGroup() /// /// Gets the provisioning state. Possible values include: 'Succeeded', - /// 'Failed', 'Building', 'Deleting', 'Updating' + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroupProvisioningState.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroupProvisioningState.cs index 2f09a3c99922c..263b969e8266c 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroupProvisioningState.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroupProvisioningState.cs @@ -16,10 +16,29 @@ namespace Microsoft.Azure.Management.Avs.Models /// public static class WorkloadNetworkVMGroupProvisioningState { + /// + /// Resource has been created. + /// public const string Succeeded = "Succeeded"; + /// + /// Resource creation failed. + /// public const string Failed = "Failed"; + /// + /// Resource creation was canceled. + /// + public const string Canceled = "Canceled"; + /// + /// is building + /// public const string Building = "Building"; + /// + /// is deleting + /// public const string Deleting = "Deleting"; + /// + /// is updating + /// public const string Updating = "Updating"; } } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroupUpdate.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroupUpdate.cs new file mode 100644 index 0000000000000..787824ad691ae --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVMGroupUpdate.cs @@ -0,0 +1,95 @@ +// +// 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.Avs.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// NSX VM Group update + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkloadNetworkVMGroupUpdate + { + /// + /// Initializes a new instance of the WorkloadNetworkVMGroupUpdate + /// class. + /// + public WorkloadNetworkVMGroupUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadNetworkVMGroupUpdate + /// class. + /// + /// Display name of the VM group. + /// Virtual machine members of this + /// group. + /// VM Group status. Possible values include: + /// 'SUCCESS', 'FAILURE' + /// The provisioning state. Possible + /// values include: 'Succeeded', 'Failed', 'Canceled', 'Building', + /// 'Deleting', 'Updating' + /// NSX revision number. + public WorkloadNetworkVMGroupUpdate(string displayName = default(string), IList members = default(IList), string status = default(string), string provisioningState = default(string), long? revision = default(long?)) + { + DisplayName = displayName; + Members = members; + Status = status; + ProvisioningState = provisioningState; + Revision = revision; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets display name of the VM group. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets virtual machine members of this group. + /// + [JsonProperty(PropertyName = "properties.members")] + public IList Members { get; set; } + + /// + /// Gets VM Group status. Possible values include: 'SUCCESS', 'FAILURE' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets the provisioning state. Possible values include: 'Succeeded', + /// 'Failed', 'Canceled', 'Building', 'Deleting', 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets NSX revision number. + /// + [JsonProperty(PropertyName = "properties.revision")] + public long? Revision { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVirtualMachine.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVirtualMachine.cs index c7f3912951897..7a84b57974a9e 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVirtualMachine.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworkVirtualMachine.cs @@ -34,15 +34,24 @@ public WorkloadNetworkVirtualMachine() /// Initializes a new instance of the WorkloadNetworkVirtualMachine /// class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Failed', + /// 'Canceled', 'Building', 'Deleting', 'Updating' /// Display name of the VM. /// Virtual machine type. Possible values include: /// 'REGULAR', 'EDGE', 'SERVICE' - public WorkloadNetworkVirtualMachine(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string vmType = default(string)) - : base(id, name, type) + public WorkloadNetworkVirtualMachine(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string displayName = default(string), string vmType = default(string)) + : base(id, name, type, systemData) { + ProvisioningState = provisioningState; DisplayName = displayName; VmType = vmType; CustomInit(); @@ -53,6 +62,14 @@ public WorkloadNetworkVirtualMachine() /// partial void CustomInit(); + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Failed', 'Canceled', 'Building', 'Deleting', + /// 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + /// /// Gets or sets display name of the VM. /// diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateDhcpHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateDhcpHeaders.cs new file mode 100644 index 0000000000000..2e80c41c49f07 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateDhcpHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateDhcp operation. + /// + public partial class WorkloadNetworksCreateDhcpHeaders + { + /// + /// Initializes a new instance of the WorkloadNetworksCreateDhcpHeaders + /// class. + /// + public WorkloadNetworksCreateDhcpHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadNetworksCreateDhcpHeaders + /// class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksCreateDhcpHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateDnsServiceHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateDnsServiceHeaders.cs new file mode 100644 index 0000000000000..1cc3a87ede472 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateDnsServiceHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateDnsService operation. + /// + public partial class WorkloadNetworksCreateDnsServiceHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksCreateDnsServiceHeaders class. + /// + public WorkloadNetworksCreateDnsServiceHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksCreateDnsServiceHeaders class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksCreateDnsServiceHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateDnsZoneHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateDnsZoneHeaders.cs new file mode 100644 index 0000000000000..2e5326e995935 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateDnsZoneHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateDnsZone operation. + /// + public partial class WorkloadNetworksCreateDnsZoneHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksCreateDnsZoneHeaders class. + /// + public WorkloadNetworksCreateDnsZoneHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksCreateDnsZoneHeaders class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksCreateDnsZoneHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreatePortMirroringHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreatePortMirroringHeaders.cs new file mode 100644 index 0000000000000..72d79919a0978 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreatePortMirroringHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreatePortMirroring operation. + /// + public partial class WorkloadNetworksCreatePortMirroringHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksCreatePortMirroringHeaders class. + /// + public WorkloadNetworksCreatePortMirroringHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksCreatePortMirroringHeaders class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksCreatePortMirroringHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreatePublicIPHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreatePublicIPHeaders.cs new file mode 100644 index 0000000000000..5517acbb30466 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreatePublicIPHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreatePublicIP operation. + /// + public partial class WorkloadNetworksCreatePublicIPHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksCreatePublicIPHeaders class. + /// + public WorkloadNetworksCreatePublicIPHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksCreatePublicIPHeaders class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksCreatePublicIPHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateSegmentsHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateSegmentsHeaders.cs new file mode 100644 index 0000000000000..ef7324687e477 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateSegmentsHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateSegments operation. + /// + public partial class WorkloadNetworksCreateSegmentsHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksCreateSegmentsHeaders class. + /// + public WorkloadNetworksCreateSegmentsHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksCreateSegmentsHeaders class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksCreateSegmentsHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateVMGroupHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateVMGroupHeaders.cs new file mode 100644 index 0000000000000..cf8ef81396667 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksCreateVMGroupHeaders.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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateVMGroup operation. + /// + public partial class WorkloadNetworksCreateVMGroupHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksCreateVMGroupHeaders class. + /// + public WorkloadNetworksCreateVMGroupHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksCreateVMGroupHeaders class. + /// + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksCreateVMGroupHeaders(int? retryAfter = default(int?)) + { + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteDhcpHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteDhcpHeaders.cs new file mode 100644 index 0000000000000..dec0b8d91676f --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteDhcpHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for DeleteDhcp operation. + /// + public partial class WorkloadNetworksDeleteDhcpHeaders + { + /// + /// Initializes a new instance of the WorkloadNetworksDeleteDhcpHeaders + /// class. + /// + public WorkloadNetworksDeleteDhcpHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadNetworksDeleteDhcpHeaders + /// class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksDeleteDhcpHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteDnsServiceHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteDnsServiceHeaders.cs new file mode 100644 index 0000000000000..62123e7ef821e --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteDnsServiceHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for DeleteDnsService operation. + /// + public partial class WorkloadNetworksDeleteDnsServiceHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksDeleteDnsServiceHeaders class. + /// + public WorkloadNetworksDeleteDnsServiceHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksDeleteDnsServiceHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksDeleteDnsServiceHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteDnsZoneHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteDnsZoneHeaders.cs new file mode 100644 index 0000000000000..1572266a26893 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteDnsZoneHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for DeleteDnsZone operation. + /// + public partial class WorkloadNetworksDeleteDnsZoneHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksDeleteDnsZoneHeaders class. + /// + public WorkloadNetworksDeleteDnsZoneHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksDeleteDnsZoneHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksDeleteDnsZoneHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeletePortMirroringHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeletePortMirroringHeaders.cs new file mode 100644 index 0000000000000..1ffd17fff9979 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeletePortMirroringHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for DeletePortMirroring operation. + /// + public partial class WorkloadNetworksDeletePortMirroringHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksDeletePortMirroringHeaders class. + /// + public WorkloadNetworksDeletePortMirroringHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksDeletePortMirroringHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksDeletePortMirroringHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeletePublicIPHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeletePublicIPHeaders.cs new file mode 100644 index 0000000000000..46f2e4d93eb42 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeletePublicIPHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for DeletePublicIP operation. + /// + public partial class WorkloadNetworksDeletePublicIPHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksDeletePublicIPHeaders class. + /// + public WorkloadNetworksDeletePublicIPHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksDeletePublicIPHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksDeletePublicIPHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteSegmentHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteSegmentHeaders.cs new file mode 100644 index 0000000000000..744eb264aa985 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteSegmentHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for DeleteSegment operation. + /// + public partial class WorkloadNetworksDeleteSegmentHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksDeleteSegmentHeaders class. + /// + public WorkloadNetworksDeleteSegmentHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksDeleteSegmentHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksDeleteSegmentHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteVMGroupHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteVMGroupHeaders.cs new file mode 100644 index 0000000000000..07a897ea2c493 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksDeleteVMGroupHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for DeleteVMGroup operation. + /// + public partial class WorkloadNetworksDeleteVMGroupHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksDeleteVMGroupHeaders class. + /// + public WorkloadNetworksDeleteVMGroupHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksDeleteVMGroupHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksDeleteVMGroupHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateDhcpHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateDhcpHeaders.cs new file mode 100644 index 0000000000000..63c831b5b6525 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateDhcpHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for UpdateDhcp operation. + /// + public partial class WorkloadNetworksUpdateDhcpHeaders + { + /// + /// Initializes a new instance of the WorkloadNetworksUpdateDhcpHeaders + /// class. + /// + public WorkloadNetworksUpdateDhcpHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkloadNetworksUpdateDhcpHeaders + /// class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksUpdateDhcpHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateDnsServiceHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateDnsServiceHeaders.cs new file mode 100644 index 0000000000000..1d4939cc983c5 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateDnsServiceHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for UpdateDnsService operation. + /// + public partial class WorkloadNetworksUpdateDnsServiceHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksUpdateDnsServiceHeaders class. + /// + public WorkloadNetworksUpdateDnsServiceHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksUpdateDnsServiceHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksUpdateDnsServiceHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateDnsZoneHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateDnsZoneHeaders.cs new file mode 100644 index 0000000000000..a96e55b0eaa4a --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateDnsZoneHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for UpdateDnsZone operation. + /// + public partial class WorkloadNetworksUpdateDnsZoneHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksUpdateDnsZoneHeaders class. + /// + public WorkloadNetworksUpdateDnsZoneHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksUpdateDnsZoneHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksUpdateDnsZoneHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdatePortMirroringHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdatePortMirroringHeaders.cs new file mode 100644 index 0000000000000..709ac129ef00e --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdatePortMirroringHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for UpdatePortMirroring operation. + /// + public partial class WorkloadNetworksUpdatePortMirroringHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksUpdatePortMirroringHeaders class. + /// + public WorkloadNetworksUpdatePortMirroringHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksUpdatePortMirroringHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksUpdatePortMirroringHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateSegmentsHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateSegmentsHeaders.cs new file mode 100644 index 0000000000000..d2109c623f2b7 --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateSegmentsHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for UpdateSegments operation. + /// + public partial class WorkloadNetworksUpdateSegmentsHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksUpdateSegmentsHeaders class. + /// + public WorkloadNetworksUpdateSegmentsHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksUpdateSegmentsHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksUpdateSegmentsHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateVMGroupHeaders.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateVMGroupHeaders.cs new file mode 100644 index 0000000000000..998ae408df8cc --- /dev/null +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Models/WorkloadNetworksUpdateVMGroupHeaders.cs @@ -0,0 +1,66 @@ +// +// 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.Avs.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for UpdateVMGroup operation. + /// + public partial class WorkloadNetworksUpdateVMGroupHeaders + { + /// + /// Initializes a new instance of the + /// WorkloadNetworksUpdateVMGroupHeaders class. + /// + public WorkloadNetworksUpdateVMGroupHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkloadNetworksUpdateVMGroupHeaders class. + /// + /// The Location header contains the URL where + /// the status of the long running operation can be checked. + /// The Retry-After header can indicate how + /// long the client should wait before polling the operation + /// status. + public WorkloadNetworksUpdateVMGroupHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Location header contains the URL where the status + /// of the long running operation can be checked. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets the Retry-After header can indicate how long the + /// client should wait before polling the operation status. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Operations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Operations.cs index 0e5db0646cb04..52ac8d36afb3d 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Operations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/Operations.cs @@ -51,7 +51,7 @@ internal Operations(AvsClient client) public AvsClient Client { get; private set; } /// - /// Lists all of the available operations + /// List the operations for the provider /// /// /// Headers that will be added to request. @@ -59,7 +59,7 @@ internal Operations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -165,14 +165,13 @@ internal Operations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -182,10 +181,6 @@ internal Operations(AvsClient client) } 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); @@ -231,7 +226,7 @@ internal Operations(AvsClient client) } /// - /// Lists all of the available operations + /// List the operations for the provider /// /// /// The NextLink from the previous successful call to List operation. @@ -242,7 +237,7 @@ internal Operations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -338,14 +333,13 @@ internal Operations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -355,10 +349,6 @@ internal Operations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/OperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/OperationsExtensions.cs index 37645d1c25617..d5b5801cd3c3e 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/OperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/OperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class OperationsExtensions { /// - /// Lists all of the available operations + /// List the operations for the provider /// /// /// The operations group for this extension method. @@ -33,7 +33,7 @@ public static IPage List(this IOperations operations) } /// - /// Lists all of the available operations + /// List the operations for the provider /// /// /// The operations group for this extension method. @@ -50,7 +50,7 @@ public static IPage List(this IOperations operations) } /// - /// Lists all of the available operations + /// List the operations for the provider /// /// /// The operations group for this extension method. @@ -64,7 +64,7 @@ public static IPage ListNext(this IOperations operations, string next } /// - /// Lists all of the available operations + /// List the operations for the provider /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperations.cs index 850378376b12f..e6e376e45f46b 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperations.cs @@ -51,7 +51,7 @@ internal PlacementPoliciesOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List placement policies in a private cloud cluster + /// List PlacementPolicy resources by Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -60,7 +60,7 @@ internal PlacementPoliciesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// Headers that will be added to request. @@ -68,7 +68,7 @@ internal PlacementPoliciesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -85,15 +85,15 @@ internal PlacementPoliciesOperations(AvsClient client) /// public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -115,19 +115,22 @@ internal PlacementPoliciesOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (clusterName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (clusterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - if (Client.ApiVersion != null) + if (clusterName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); } } // Tracing @@ -146,7 +149,7 @@ internal PlacementPoliciesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -215,14 +218,13 @@ internal PlacementPoliciesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -232,10 +234,6 @@ internal PlacementPoliciesOperations(AvsClient client) } 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); @@ -281,7 +279,7 @@ internal PlacementPoliciesOperations(AvsClient client) } /// - /// Get a placement policy by name in a private cloud cluster + /// Get a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -290,11 +288,10 @@ internal PlacementPoliciesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// /// Headers that will be added to request. @@ -302,7 +299,7 @@ internal PlacementPoliciesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -319,15 +316,15 @@ internal PlacementPoliciesOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -349,23 +346,33 @@ internal PlacementPoliciesOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } if (clusterName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - if (placementPolicyName == null) + if (clusterName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (placementPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyName"); } - if (Client.ApiVersion != null) + if (placementPolicyName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(placementPolicyName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "placementPolicyName", "^[-\\w\\._]+$"); } } // Tracing @@ -385,7 +392,7 @@ internal PlacementPoliciesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -455,14 +462,13 @@ internal PlacementPoliciesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -472,10 +478,6 @@ internal PlacementPoliciesOperations(AvsClient client) } 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); @@ -521,7 +523,7 @@ internal PlacementPoliciesOperations(AvsClient client) } /// - /// Create or update a placement policy in a private cloud cluster + /// Create a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -530,14 +532,13 @@ internal PlacementPoliciesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// - /// A placement policy in the private cloud cluster + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -545,15 +546,15 @@ internal PlacementPoliciesOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicy, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicy, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Update a placement policy in a private cloud cluster + /// Update a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -562,14 +563,13 @@ internal PlacementPoliciesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// - /// The placement policy properties that may be updated + /// The placement policy properties to be updated. /// /// /// The headers that will be added to request. @@ -577,15 +577,15 @@ internal PlacementPoliciesOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicyUpdate, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, placementPolicyUpdate, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a placement policy in a private cloud cluster + /// Delete a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -594,11 +594,10 @@ internal PlacementPoliciesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// /// The headers that will be added to request. @@ -606,15 +605,15 @@ internal PlacementPoliciesOperations(AvsClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update a placement policy in a private cloud cluster + /// Create a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -623,14 +622,13 @@ internal PlacementPoliciesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// - /// A placement policy in the private cloud cluster + /// Resource create parameters. /// /// /// Headers that will be added to request. @@ -638,7 +636,7 @@ internal PlacementPoliciesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -653,17 +651,17 @@ internal PlacementPoliciesOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -685,29 +683,39 @@ internal PlacementPoliciesOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (clusterName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (placementPolicyName == null) + if (clusterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - if (placementPolicy == null) + if (clusterName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicy"); + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (placementPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyName"); } - if (Client.ApiVersion != null) + if (placementPolicyName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(placementPolicyName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "placementPolicyName", "^[-\\w\\._]+$"); } } + if (placementPolicy == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicy"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -726,7 +734,7 @@ internal PlacementPoliciesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -802,14 +810,13 @@ internal PlacementPoliciesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -819,10 +826,6 @@ internal PlacementPoliciesOperations(AvsClient client) } 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); @@ -835,7 +838,7 @@ internal PlacementPoliciesOperations(AvsClient 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")) @@ -878,6 +881,19 @@ internal PlacementPoliciesOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -886,7 +902,7 @@ internal PlacementPoliciesOperations(AvsClient client) } /// - /// Update a placement policy in a private cloud cluster + /// Update a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -895,14 +911,13 @@ internal PlacementPoliciesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// - /// The placement policy properties that may be updated + /// The placement policy properties to be updated. /// /// /// Headers that will be added to request. @@ -910,7 +925,7 @@ internal PlacementPoliciesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -925,17 +940,17 @@ internal PlacementPoliciesOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -957,29 +972,39 @@ internal PlacementPoliciesOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (clusterName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (placementPolicyName == null) + if (clusterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - if (placementPolicyUpdate == null) + if (clusterName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyUpdate"); + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (placementPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyName"); } - if (Client.ApiVersion != null) + if (placementPolicyName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(placementPolicyName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "placementPolicyName", "^[-\\w\\._]+$"); } } + if (placementPolicyUpdate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyUpdate"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -998,7 +1023,7 @@ internal PlacementPoliciesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -1074,14 +1099,13 @@ internal PlacementPoliciesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1091,10 +1115,6 @@ internal PlacementPoliciesOperations(AvsClient client) } 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); @@ -1107,7 +1127,7 @@ internal PlacementPoliciesOperations(AvsClient 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")) @@ -1150,6 +1170,19 @@ internal PlacementPoliciesOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1158,7 +1191,7 @@ internal PlacementPoliciesOperations(AvsClient client) } /// - /// Delete a placement policy in a private cloud cluster + /// Delete a PlacementPolicy /// /// /// The name of the resource group. The name is case insensitive. @@ -1167,11 +1200,10 @@ internal PlacementPoliciesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// /// Headers that will be added to request. @@ -1179,7 +1211,7 @@ internal PlacementPoliciesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1191,17 +1223,17 @@ internal PlacementPoliciesOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -1223,23 +1255,33 @@ internal PlacementPoliciesOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } if (clusterName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - if (placementPolicyName == null) + if (clusterName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (placementPolicyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "placementPolicyName"); } - if (Client.ApiVersion != null) + if (placementPolicyName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(placementPolicyName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "placementPolicyName", "^[-\\w\\._]+$"); } } // Tracing @@ -1259,7 +1301,7 @@ internal PlacementPoliciesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -1329,14 +1371,13 @@ internal PlacementPoliciesOperations(AvsClient client) 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)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1346,10 +1387,6 @@ internal PlacementPoliciesOperations(AvsClient client) } 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); @@ -1362,13 +1399,26 @@ internal PlacementPoliciesOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1377,7 +1427,7 @@ internal PlacementPoliciesOperations(AvsClient client) } /// - /// List placement policies in a private cloud cluster + /// List PlacementPolicy resources by Cluster /// /// /// The NextLink from the previous successful call to List operation. @@ -1388,7 +1438,7 @@ internal PlacementPoliciesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1484,14 +1534,13 @@ internal PlacementPoliciesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1501,10 +1550,6 @@ internal PlacementPoliciesOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperationsExtensions.cs index 8c1e9de871060..bf2fd5e2bcaaf 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PlacementPoliciesOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class PlacementPoliciesOperationsExtensions { /// - /// List placement policies in a private cloud cluster + /// List PlacementPolicy resources by Cluster /// /// /// The operations group for this extension method. @@ -34,7 +34,7 @@ public static partial class PlacementPoliciesOperationsExtensions /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// public static IPage List(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName) { @@ -42,7 +42,7 @@ public static IPage List(this IPlacementPoliciesOperations oper } /// - /// List placement policies in a private cloud cluster + /// List PlacementPolicy resources by Cluster /// /// /// The operations group for this extension method. @@ -54,7 +54,7 @@ public static IPage List(this IPlacementPoliciesOperations oper /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The cancellation token. @@ -68,7 +68,7 @@ public static IPage List(this IPlacementPoliciesOperations oper } /// - /// Get a placement policy by name in a private cloud cluster + /// Get a PlacementPolicy /// /// /// The operations group for this extension method. @@ -80,11 +80,10 @@ public static IPage List(this IPlacementPoliciesOperations oper /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// public static PlacementPolicy Get(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName) { @@ -92,7 +91,7 @@ public static PlacementPolicy Get(this IPlacementPoliciesOperations operations, } /// - /// Get a placement policy by name in a private cloud cluster + /// Get a PlacementPolicy /// /// /// The operations group for this extension method. @@ -104,11 +103,10 @@ public static PlacementPolicy Get(this IPlacementPoliciesOperations operations, /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// /// The cancellation token. @@ -122,7 +120,7 @@ public static PlacementPolicy Get(this IPlacementPoliciesOperations operations, } /// - /// Create or update a placement policy in a private cloud cluster + /// Create a PlacementPolicy /// /// /// The operations group for this extension method. @@ -134,14 +132,13 @@ public static PlacementPolicy Get(this IPlacementPoliciesOperations operations, /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// - /// A placement policy in the private cloud cluster + /// Resource create parameters. /// public static PlacementPolicy CreateOrUpdate(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy) { @@ -149,7 +146,7 @@ public static PlacementPolicy CreateOrUpdate(this IPlacementPoliciesOperations o } /// - /// Create or update a placement policy in a private cloud cluster + /// Create a PlacementPolicy /// /// /// The operations group for this extension method. @@ -161,14 +158,13 @@ public static PlacementPolicy CreateOrUpdate(this IPlacementPoliciesOperations o /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// - /// A placement policy in the private cloud cluster + /// Resource create parameters. /// /// /// The cancellation token. @@ -182,7 +178,7 @@ public static PlacementPolicy CreateOrUpdate(this IPlacementPoliciesOperations o } /// - /// Update a placement policy in a private cloud cluster + /// Update a PlacementPolicy /// /// /// The operations group for this extension method. @@ -194,14 +190,13 @@ public static PlacementPolicy CreateOrUpdate(this IPlacementPoliciesOperations o /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// - /// The placement policy properties that may be updated + /// The placement policy properties to be updated. /// public static PlacementPolicy Update(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate) { @@ -209,7 +204,7 @@ public static PlacementPolicy Update(this IPlacementPoliciesOperations operation } /// - /// Update a placement policy in a private cloud cluster + /// Update a PlacementPolicy /// /// /// The operations group for this extension method. @@ -221,14 +216,13 @@ public static PlacementPolicy Update(this IPlacementPoliciesOperations operation /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// - /// The placement policy properties that may be updated + /// The placement policy properties to be updated. /// /// /// The cancellation token. @@ -242,7 +236,7 @@ public static PlacementPolicy Update(this IPlacementPoliciesOperations operation } /// - /// Delete a placement policy in a private cloud cluster + /// Delete a PlacementPolicy /// /// /// The operations group for this extension method. @@ -254,19 +248,18 @@ public static PlacementPolicy Update(this IPlacementPoliciesOperations operation /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// - public static void Delete(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName) + public static PlacementPoliciesDeleteHeaders Delete(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName) { - operations.DeleteAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName).GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName).GetAwaiter().GetResult(); } /// - /// Delete a placement policy in a private cloud cluster + /// Delete a PlacementPolicy /// /// /// The operations group for this extension method. @@ -278,22 +271,24 @@ public static void Delete(this IPlacementPoliciesOperations operations, string r /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create or update a placement policy in a private cloud cluster + /// Create a PlacementPolicy /// /// /// The operations group for this extension method. @@ -305,14 +300,13 @@ public static void Delete(this IPlacementPoliciesOperations operations, string r /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// - /// A placement policy in the private cloud cluster + /// Resource create parameters. /// public static PlacementPolicy BeginCreateOrUpdate(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicy placementPolicy) { @@ -320,7 +314,7 @@ public static PlacementPolicy BeginCreateOrUpdate(this IPlacementPoliciesOperati } /// - /// Create or update a placement policy in a private cloud cluster + /// Create a PlacementPolicy /// /// /// The operations group for this extension method. @@ -332,14 +326,13 @@ public static PlacementPolicy BeginCreateOrUpdate(this IPlacementPoliciesOperati /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// - /// A placement policy in the private cloud cluster + /// Resource create parameters. /// /// /// The cancellation token. @@ -353,7 +346,7 @@ public static PlacementPolicy BeginCreateOrUpdate(this IPlacementPoliciesOperati } /// - /// Update a placement policy in a private cloud cluster + /// Update a PlacementPolicy /// /// /// The operations group for this extension method. @@ -365,14 +358,13 @@ public static PlacementPolicy BeginCreateOrUpdate(this IPlacementPoliciesOperati /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// - /// The placement policy properties that may be updated + /// The placement policy properties to be updated. /// public static PlacementPolicy BeginUpdate(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate) { @@ -380,7 +372,7 @@ public static PlacementPolicy BeginUpdate(this IPlacementPoliciesOperations oper } /// - /// Update a placement policy in a private cloud cluster + /// Update a PlacementPolicy /// /// /// The operations group for this extension method. @@ -392,14 +384,13 @@ public static PlacementPolicy BeginUpdate(this IPlacementPoliciesOperations oper /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// - /// The placement policy properties that may be updated + /// The placement policy properties to be updated. /// /// /// The cancellation token. @@ -413,7 +404,7 @@ public static PlacementPolicy BeginUpdate(this IPlacementPoliciesOperations oper } /// - /// Delete a placement policy in a private cloud cluster + /// Delete a PlacementPolicy /// /// /// The operations group for this extension method. @@ -425,19 +416,18 @@ public static PlacementPolicy BeginUpdate(this IPlacementPoliciesOperations oper /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// - public static void BeginDelete(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName) + public static PlacementPoliciesDeleteHeaders BeginDelete(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName) { - operations.BeginDeleteAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName).GetAwaiter().GetResult(); + return operations.BeginDeleteAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName).GetAwaiter().GetResult(); } /// - /// Delete a placement policy in a private cloud cluster + /// Delete a PlacementPolicy /// /// /// The operations group for this extension method. @@ -449,22 +439,24 @@ public static void BeginDelete(this IPlacementPoliciesOperations operations, str /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement - /// policy + /// Name of the placement policy. /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IPlacementPoliciesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, placementPolicyName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List placement policies in a private cloud cluster + /// List PlacementPolicy resources by Cluster /// /// /// The operations group for this extension method. @@ -478,7 +470,7 @@ public static IPage ListNext(this IPlacementPoliciesOperations } /// - /// List placement policies in a private cloud cluster + /// List PlacementPolicy resources by Cluster /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PrivateCloudsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PrivateCloudsOperations.cs index cac3f577fafbe..923dde3cc790e 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PrivateCloudsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PrivateCloudsOperations.cs @@ -51,18 +51,15 @@ internal PrivateCloudsOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List private clouds in a resource group + /// List PrivateCloud resources by subscription ID /// - /// - /// The name of the resource group. The name is case insensitive. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,34 +74,8 @@ internal PrivateCloudsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.SubscriptionId != null) - { - if (Client.SubscriptionId.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -123,15 +94,13 @@ internal PrivateCloudsOperations(AvsClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInSubscription", 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.AVS/privateClouds").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -197,14 +166,13 @@ internal PrivateCloudsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -214,10 +182,6 @@ internal PrivateCloudsOperations(AvsClient client) } 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); @@ -263,15 +227,18 @@ internal PrivateCloudsOperations(AvsClient client) } /// - /// List private clouds in a subscription + /// List PrivateCloud resources by resource group /// + /// + /// The name of the resource group. The name is case insensitive. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -286,28 +253,32 @@ internal PrivateCloudsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } - if (Client.ApiVersion == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ApiVersion != null) + if (resourceGroupName != null) { - if (Client.ApiVersion.Length < 1) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } // Tracing @@ -317,13 +288,15 @@ internal PrivateCloudsOperations(AvsClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInSubscription", 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}/providers/Microsoft.AVS/privateClouds").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -389,14 +362,13 @@ internal PrivateCloudsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -406,10 +378,6 @@ internal PrivateCloudsOperations(AvsClient client) } 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); @@ -455,7 +423,7 @@ internal PrivateCloudsOperations(AvsClient client) } /// - /// Get a private cloud + /// Get a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -469,7 +437,7 @@ internal PrivateCloudsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -486,15 +454,15 @@ internal PrivateCloudsOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -516,15 +484,11 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -542,7 +506,7 @@ internal PrivateCloudsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -610,14 +574,13 @@ internal PrivateCloudsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -627,10 +590,6 @@ internal PrivateCloudsOperations(AvsClient client) } 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); @@ -676,7 +635,7 @@ internal PrivateCloudsOperations(AvsClient client) } /// - /// Create or update a private cloud + /// Create a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -685,7 +644,7 @@ internal PrivateCloudsOperations(AvsClient client) /// Name of the private cloud /// /// - /// The private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -693,15 +652,15 @@ internal PrivateCloudsOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloud privateCloud, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloud privateCloud, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, privateCloud, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, privateCloud, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Update a private cloud + /// Update a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -710,7 +669,7 @@ internal PrivateCloudsOperations(AvsClient client) /// Name of the private cloud /// /// - /// The private cloud properties to be updated + /// The private cloud properties to be updated. /// /// /// The headers that will be added to request. @@ -718,59 +677,15 @@ internal PrivateCloudsOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloudUpdate privateCloudUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloudUpdate privateCloudUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, privateCloudUpdate, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, privateCloudUpdate, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a private cloud - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the private cloud - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Rotate the vCenter password - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the private cloud - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task RotateVcenterPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRotateVcenterPasswordWithHttpMessagesAsync(resourceGroupName, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Rotate the NSX-T Manager password + /// Delete a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -784,10 +699,10 @@ internal PrivateCloudsOperations(AvsClient client) /// /// The cancellation token. /// - public async Task RotateNsxtPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginRotateNsxtPasswordWithHttpMessagesAsync(resourceGroupName, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -806,7 +721,7 @@ internal PrivateCloudsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -823,15 +738,15 @@ internal PrivateCloudsOperations(AvsClient client) /// public async Task> ListAdminCredentialsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -853,15 +768,11 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -879,7 +790,7 @@ internal PrivateCloudsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -947,14 +858,13 @@ internal PrivateCloudsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -964,10 +874,6 @@ internal PrivateCloudsOperations(AvsClient client) } 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); @@ -1013,7 +919,51 @@ internal PrivateCloudsOperations(AvsClient client) } /// - /// Create or update a private cloud + /// Rotate the NSX-T Manager password + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> RotateNsxtPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginRotateNsxtPasswordWithHttpMessagesAsync(resourceGroupName, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Rotate the vCenter password + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> RotateVcenterPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginRotateVcenterPasswordWithHttpMessagesAsync(resourceGroupName, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -1022,7 +972,7 @@ internal PrivateCloudsOperations(AvsClient client) /// Name of the private cloud /// /// - /// The private cloud + /// Resource create parameters. /// /// /// Headers that will be added to request. @@ -1030,7 +980,7 @@ internal PrivateCloudsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1045,17 +995,17 @@ internal PrivateCloudsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloud privateCloud, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloud privateCloud, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -1077,6 +1027,13 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } if (privateCloud == null) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloud"); @@ -1085,17 +1042,6 @@ internal PrivateCloudsOperations(AvsClient client) { privateCloud.Validate(); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1112,7 +1058,7 @@ internal PrivateCloudsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -1186,14 +1132,13 @@ internal PrivateCloudsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1203,10 +1148,6 @@ internal PrivateCloudsOperations(AvsClient client) } 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); @@ -1219,7 +1160,7 @@ internal PrivateCloudsOperations(AvsClient 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")) @@ -1262,6 +1203,19 @@ internal PrivateCloudsOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1270,7 +1224,7 @@ internal PrivateCloudsOperations(AvsClient client) } /// - /// Update a private cloud + /// Update a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -1279,7 +1233,7 @@ internal PrivateCloudsOperations(AvsClient client) /// Name of the private cloud /// /// - /// The private cloud properties to be updated + /// The private cloud properties to be updated. /// /// /// Headers that will be added to request. @@ -1287,7 +1241,7 @@ internal PrivateCloudsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1302,17 +1256,17 @@ internal PrivateCloudsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloudUpdate privateCloudUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, PrivateCloudUpdate privateCloudUpdate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -1334,21 +1288,17 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (privateCloudUpdate == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudUpdate"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } + if (privateCloudUpdate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudUpdate"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1365,7 +1315,7 @@ internal PrivateCloudsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -1439,14 +1389,13 @@ internal PrivateCloudsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1456,10 +1405,6 @@ internal PrivateCloudsOperations(AvsClient client) } 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); @@ -1472,7 +1417,7 @@ internal PrivateCloudsOperations(AvsClient 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")) @@ -1515,6 +1460,19 @@ internal PrivateCloudsOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1523,7 +1481,7 @@ internal PrivateCloudsOperations(AvsClient client) } /// - /// Delete a private cloud + /// Delete a PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -1537,7 +1495,7 @@ internal PrivateCloudsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1549,17 +1507,17 @@ internal PrivateCloudsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -1581,15 +1539,11 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -1607,7 +1561,7 @@ internal PrivateCloudsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -1675,14 +1629,13 @@ internal PrivateCloudsOperations(AvsClient client) 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)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1692,10 +1645,6 @@ internal PrivateCloudsOperations(AvsClient client) } 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); @@ -1708,13 +1657,26 @@ internal PrivateCloudsOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1723,7 +1685,7 @@ internal PrivateCloudsOperations(AvsClient client) } /// - /// Rotate the vCenter password + /// Rotate the NSX-T Manager password /// /// /// The name of the resource group. The name is case insensitive. @@ -1737,7 +1699,7 @@ internal PrivateCloudsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1749,17 +1711,17 @@ internal PrivateCloudsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRotateVcenterPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginRotateNsxtPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -1781,15 +1743,11 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -1802,12 +1760,12 @@ internal PrivateCloudsOperations(AvsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRotateVcenterPassword", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRotateNsxtPassword", 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.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -1875,14 +1833,13 @@ internal PrivateCloudsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1892,10 +1849,6 @@ internal PrivateCloudsOperations(AvsClient client) } 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); @@ -1908,13 +1861,26 @@ internal PrivateCloudsOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1923,7 +1889,7 @@ internal PrivateCloudsOperations(AvsClient client) } /// - /// Rotate the NSX-T Manager password + /// Rotate the vCenter password /// /// /// The name of the resource group. The name is case insensitive. @@ -1937,7 +1903,7 @@ internal PrivateCloudsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1949,17 +1915,17 @@ internal PrivateCloudsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRotateNsxtPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginRotateVcenterPasswordWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -1981,15 +1947,11 @@ internal PrivateCloudsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -2002,12 +1964,12 @@ internal PrivateCloudsOperations(AvsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRotateNsxtPassword", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRotateVcenterPassword", 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.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -2075,14 +2037,13 @@ internal PrivateCloudsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2092,10 +2053,6 @@ internal PrivateCloudsOperations(AvsClient client) } 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); @@ -2108,13 +2065,26 @@ internal PrivateCloudsOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -2123,7 +2093,7 @@ internal PrivateCloudsOperations(AvsClient client) } /// - /// List private clouds in a resource group + /// List PrivateCloud resources by subscription ID /// /// /// The NextLink from the previous successful call to List operation. @@ -2134,7 +2104,7 @@ internal PrivateCloudsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2149,7 +2119,7 @@ internal PrivateCloudsOperations(AvsClient 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>> ListInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2164,7 +2134,7 @@ internal PrivateCloudsOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInSubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2230,14 +2200,13 @@ internal PrivateCloudsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2247,10 +2216,6 @@ internal PrivateCloudsOperations(AvsClient client) } 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); @@ -2296,7 +2261,7 @@ internal PrivateCloudsOperations(AvsClient client) } /// - /// List private clouds in a subscription + /// List PrivateCloud resources by resource group /// /// /// The NextLink from the previous successful call to List operation. @@ -2307,7 +2272,7 @@ internal PrivateCloudsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2322,7 +2287,7 @@ internal PrivateCloudsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2337,7 +2302,7 @@ internal PrivateCloudsOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInSubscriptionNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2403,14 +2368,13 @@ internal PrivateCloudsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2420,10 +2384,6 @@ internal PrivateCloudsOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PrivateCloudsOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PrivateCloudsOperationsExtensions.cs index f925dac2d2fd1..039000bf814f0 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PrivateCloudsOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/PrivateCloudsOperationsExtensions.cs @@ -22,69 +22,69 @@ namespace Microsoft.Azure.Management.Avs public static partial class PrivateCloudsOperationsExtensions { /// - /// List private clouds in a resource group + /// List PrivateCloud resources by subscription ID /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage List(this IPrivateCloudsOperations operations, string resourceGroupName) + public static IPage ListInSubscription(this IPrivateCloudsOperations operations) { - return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + return operations.ListInSubscriptionAsync().GetAwaiter().GetResult(); } /// - /// List private clouds in a resource group + /// List PrivateCloud resources by subscription ID /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. - /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IPrivateCloudsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListInSubscriptionAsync(this IPrivateCloudsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListInSubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List private clouds in a subscription + /// List PrivateCloud resources by resource group /// /// /// The operations group for this extension method. /// - public static IPage ListInSubscription(this IPrivateCloudsOperations operations) + /// + /// The name of the resource group. The name is case insensitive. + /// + public static IPage List(this IPrivateCloudsOperations operations, string resourceGroupName) { - return operations.ListInSubscriptionAsync().GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); } /// - /// List private clouds in a subscription + /// List PrivateCloud resources by resource group /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. The name is case insensitive. + /// /// /// The cancellation token. /// - public static async Task> ListInSubscriptionAsync(this IPrivateCloudsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IPrivateCloudsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListInSubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get a private cloud + /// Get a PrivateCloud /// /// /// The operations group for this extension method. @@ -101,7 +101,7 @@ public static PrivateCloud Get(this IPrivateCloudsOperations operations, string } /// - /// Get a private cloud + /// Get a PrivateCloud /// /// /// The operations group for this extension method. @@ -124,7 +124,7 @@ public static PrivateCloud Get(this IPrivateCloudsOperations operations, string } /// - /// Create or update a private cloud + /// Create a PrivateCloud /// /// /// The operations group for this extension method. @@ -136,7 +136,7 @@ public static PrivateCloud Get(this IPrivateCloudsOperations operations, string /// Name of the private cloud /// /// - /// The private cloud + /// Resource create parameters. /// public static PrivateCloud CreateOrUpdate(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, PrivateCloud privateCloud) { @@ -144,7 +144,7 @@ public static PrivateCloud CreateOrUpdate(this IPrivateCloudsOperations operatio } /// - /// Create or update a private cloud + /// Create a PrivateCloud /// /// /// The operations group for this extension method. @@ -156,7 +156,7 @@ public static PrivateCloud CreateOrUpdate(this IPrivateCloudsOperations operatio /// Name of the private cloud /// /// - /// The private cloud + /// Resource create parameters. /// /// /// The cancellation token. @@ -170,7 +170,7 @@ public static PrivateCloud CreateOrUpdate(this IPrivateCloudsOperations operatio } /// - /// Update a private cloud + /// Update a PrivateCloud /// /// /// The operations group for this extension method. @@ -182,7 +182,7 @@ public static PrivateCloud CreateOrUpdate(this IPrivateCloudsOperations operatio /// Name of the private cloud /// /// - /// The private cloud properties to be updated + /// The private cloud properties to be updated. /// public static PrivateCloud Update(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, PrivateCloudUpdate privateCloudUpdate) { @@ -190,7 +190,7 @@ public static PrivateCloud Update(this IPrivateCloudsOperations operations, stri } /// - /// Update a private cloud + /// Update a PrivateCloud /// /// /// The operations group for this extension method. @@ -202,7 +202,7 @@ public static PrivateCloud Update(this IPrivateCloudsOperations operations, stri /// Name of the private cloud /// /// - /// The private cloud properties to be updated + /// The private cloud properties to be updated. /// /// /// The cancellation token. @@ -216,7 +216,7 @@ public static PrivateCloud Update(this IPrivateCloudsOperations operations, stri } /// - /// Delete a private cloud + /// Delete a PrivateCloud /// /// /// The operations group for this extension method. @@ -227,13 +227,13 @@ public static PrivateCloud Update(this IPrivateCloudsOperations operations, stri /// /// Name of the private cloud /// - public static void Delete(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) + public static PrivateCloudsDeleteHeaders Delete(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) { - operations.DeleteAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// Delete a private cloud + /// Delete a PrivateCloud /// /// /// The operations group for this extension method. @@ -247,13 +247,16 @@ public static void Delete(this IPrivateCloudsOperations operations, string resou /// /// The cancellation token. /// - public static async Task DeleteAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Rotate the vCenter password + /// List the admin credentials for the private cloud /// /// /// The operations group for this extension method. @@ -264,13 +267,13 @@ public static void Delete(this IPrivateCloudsOperations operations, string resou /// /// Name of the private cloud /// - public static void RotateVcenterPassword(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) + public static AdminCredentials ListAdminCredentials(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) { - operations.RotateVcenterPasswordAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.ListAdminCredentialsAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// Rotate the vCenter password + /// List the admin credentials for the private cloud /// /// /// The operations group for this extension method. @@ -284,9 +287,12 @@ public static void RotateVcenterPassword(this IPrivateCloudsOperations operation /// /// The cancellation token. /// - public static async Task RotateVcenterPasswordAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListAdminCredentialsAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.RotateVcenterPasswordWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListAdminCredentialsWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// @@ -301,9 +307,9 @@ public static void RotateVcenterPassword(this IPrivateCloudsOperations operation /// /// Name of the private cloud /// - public static void RotateNsxtPassword(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) + public static PrivateCloudsRotateNsxtPasswordHeaders RotateNsxtPassword(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) { - operations.RotateNsxtPasswordAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.RotateNsxtPasswordAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// @@ -321,13 +327,16 @@ public static void RotateNsxtPassword(this IPrivateCloudsOperations operations, /// /// The cancellation token. /// - public static async Task RotateNsxtPasswordAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RotateNsxtPasswordAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.RotateNsxtPasswordWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.RotateNsxtPasswordWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List the admin credentials for the private cloud + /// Rotate the vCenter password /// /// /// The operations group for this extension method. @@ -338,13 +347,13 @@ public static void RotateNsxtPassword(this IPrivateCloudsOperations operations, /// /// Name of the private cloud /// - public static AdminCredentials ListAdminCredentials(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) + public static PrivateCloudsRotateVcenterPasswordHeaders RotateVcenterPassword(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) { - return operations.ListAdminCredentialsAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.RotateVcenterPasswordAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// List the admin credentials for the private cloud + /// Rotate the vCenter password /// /// /// The operations group for this extension method. @@ -358,16 +367,16 @@ public static AdminCredentials ListAdminCredentials(this IPrivateCloudsOperation /// /// The cancellation token. /// - public static async Task ListAdminCredentialsAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RotateVcenterPasswordAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAdminCredentialsWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RotateVcenterPasswordWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Create or update a private cloud + /// Create a PrivateCloud /// /// /// The operations group for this extension method. @@ -379,7 +388,7 @@ public static AdminCredentials ListAdminCredentials(this IPrivateCloudsOperation /// Name of the private cloud /// /// - /// The private cloud + /// Resource create parameters. /// public static PrivateCloud BeginCreateOrUpdate(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, PrivateCloud privateCloud) { @@ -387,7 +396,7 @@ public static PrivateCloud BeginCreateOrUpdate(this IPrivateCloudsOperations ope } /// - /// Create or update a private cloud + /// Create a PrivateCloud /// /// /// The operations group for this extension method. @@ -399,7 +408,7 @@ public static PrivateCloud BeginCreateOrUpdate(this IPrivateCloudsOperations ope /// Name of the private cloud /// /// - /// The private cloud + /// Resource create parameters. /// /// /// The cancellation token. @@ -413,7 +422,7 @@ public static PrivateCloud BeginCreateOrUpdate(this IPrivateCloudsOperations ope } /// - /// Update a private cloud + /// Update a PrivateCloud /// /// /// The operations group for this extension method. @@ -425,7 +434,7 @@ public static PrivateCloud BeginCreateOrUpdate(this IPrivateCloudsOperations ope /// Name of the private cloud /// /// - /// The private cloud properties to be updated + /// The private cloud properties to be updated. /// public static PrivateCloud BeginUpdate(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, PrivateCloudUpdate privateCloudUpdate) { @@ -433,7 +442,7 @@ public static PrivateCloud BeginUpdate(this IPrivateCloudsOperations operations, } /// - /// Update a private cloud + /// Update a PrivateCloud /// /// /// The operations group for this extension method. @@ -445,7 +454,7 @@ public static PrivateCloud BeginUpdate(this IPrivateCloudsOperations operations, /// Name of the private cloud /// /// - /// The private cloud properties to be updated + /// The private cloud properties to be updated. /// /// /// The cancellation token. @@ -459,7 +468,7 @@ public static PrivateCloud BeginUpdate(this IPrivateCloudsOperations operations, } /// - /// Delete a private cloud + /// Delete a PrivateCloud /// /// /// The operations group for this extension method. @@ -470,13 +479,13 @@ public static PrivateCloud BeginUpdate(this IPrivateCloudsOperations operations, /// /// Name of the private cloud /// - public static void BeginDelete(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) + public static PrivateCloudsDeleteHeaders BeginDelete(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) { - operations.BeginDeleteAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.BeginDeleteAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// Delete a private cloud + /// Delete a PrivateCloud /// /// /// The operations group for this extension method. @@ -490,13 +499,16 @@ public static void BeginDelete(this IPrivateCloudsOperations operations, string /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Rotate the vCenter password + /// Rotate the NSX-T Manager password /// /// /// The operations group for this extension method. @@ -507,13 +519,13 @@ public static void BeginDelete(this IPrivateCloudsOperations operations, string /// /// Name of the private cloud /// - public static void BeginRotateVcenterPassword(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) + public static PrivateCloudsRotateNsxtPasswordHeaders BeginRotateNsxtPassword(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) { - operations.BeginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.BeginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// Rotate the vCenter password + /// Rotate the NSX-T Manager password /// /// /// The operations group for this extension method. @@ -527,13 +539,16 @@ public static void BeginRotateVcenterPassword(this IPrivateCloudsOperations oper /// /// The cancellation token. /// - public static async Task BeginRotateVcenterPasswordAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginRotateNsxtPasswordAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginRotateVcenterPasswordWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginRotateNsxtPasswordWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Rotate the NSX-T Manager password + /// Rotate the vCenter password /// /// /// The operations group for this extension method. @@ -544,13 +559,13 @@ public static void BeginRotateVcenterPassword(this IPrivateCloudsOperations oper /// /// Name of the private cloud /// - public static void BeginRotateNsxtPassword(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) + public static PrivateCloudsRotateVcenterPasswordHeaders BeginRotateVcenterPassword(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName) { - operations.BeginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.BeginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// Rotate the NSX-T Manager password + /// Rotate the vCenter password /// /// /// The operations group for this extension method. @@ -564,13 +579,16 @@ public static void BeginRotateNsxtPassword(this IPrivateCloudsOperations operati /// /// The cancellation token. /// - public static async Task BeginRotateNsxtPasswordAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginRotateVcenterPasswordAsync(this IPrivateCloudsOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginRotateNsxtPasswordWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginRotateVcenterPasswordWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List private clouds in a resource group + /// List PrivateCloud resources by subscription ID /// /// /// The operations group for this extension method. @@ -578,13 +596,13 @@ public static void BeginRotateNsxtPassword(this IPrivateCloudsOperations operati /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IPrivateCloudsOperations operations, string nextPageLink) + public static IPage ListInSubscriptionNext(this IPrivateCloudsOperations operations, string nextPageLink) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListInSubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List private clouds in a resource group + /// List PrivateCloud resources by subscription ID /// /// /// The operations group for this extension method. @@ -595,16 +613,16 @@ public static IPage ListNext(this IPrivateCloudsOperations operati /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IPrivateCloudsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListInSubscriptionNextAsync(this IPrivateCloudsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListInSubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List private clouds in a subscription + /// List PrivateCloud resources by resource group /// /// /// The operations group for this extension method. @@ -612,13 +630,13 @@ public static IPage ListNext(this IPrivateCloudsOperations operati /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListInSubscriptionNext(this IPrivateCloudsOperations operations, string nextPageLink) + public static IPage ListNext(this IPrivateCloudsOperations operations, string nextPageLink) { - return operations.ListInSubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List private clouds in a subscription + /// List PrivateCloud resources by resource group /// /// /// The operations group for this extension method. @@ -629,9 +647,9 @@ public static IPage ListInSubscriptionNext(this IPrivateCloudsOper /// /// The cancellation token. /// - public static async Task> ListInSubscriptionNextAsync(this IPrivateCloudsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IPrivateCloudsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListInSubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperations.cs index d1e685408afa4..ab3ffdc6b9815 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperations.cs @@ -51,8 +51,7 @@ internal ScriptCmdletsOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List script cmdlet resources available for a private cloud to create a - /// script execution resource on a private cloud + /// List ScriptCmdlet resources by ScriptPackage /// /// /// The name of the resource group. The name is case insensitive. @@ -61,7 +60,7 @@ internal ScriptCmdletsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the script package in the private cloud + /// Name of the script package. /// /// /// Headers that will be added to request. @@ -69,7 +68,7 @@ internal ScriptCmdletsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -86,15 +85,15 @@ internal ScriptCmdletsOperations(AvsClient client) /// public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptPackageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -116,21 +115,24 @@ internal ScriptCmdletsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } if (scriptPackageName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scriptPackageName"); } + if (scriptPackageName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(scriptPackageName, "^[-\\w\\._@]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "scriptPackageName", "^[-\\w\\._@]+$"); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -147,7 +149,7 @@ internal ScriptCmdletsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{scriptPackageName}", System.Uri.EscapeDataString(scriptPackageName)); @@ -216,14 +218,13 @@ internal ScriptCmdletsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -233,10 +234,6 @@ internal ScriptCmdletsOperations(AvsClient client) } 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); @@ -282,8 +279,7 @@ internal ScriptCmdletsOperations(AvsClient client) } /// - /// Return information about a script cmdlet resource in a specific package on - /// a private cloud + /// Get a ScriptCmdlet /// /// /// The name of the resource group. The name is case insensitive. @@ -292,11 +288,10 @@ internal ScriptCmdletsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the script package in the private cloud + /// Name of the script package. /// /// - /// Name of the script cmdlet resource in the script package in the private - /// cloud + /// Name of the script cmdlet. /// /// /// Headers that will be added to request. @@ -304,7 +299,7 @@ internal ScriptCmdletsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -321,15 +316,15 @@ internal ScriptCmdletsOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptPackageName, string scriptCmdletName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -351,23 +346,33 @@ internal ScriptCmdletsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } if (scriptPackageName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scriptPackageName"); } - if (scriptCmdletName == null) + if (scriptPackageName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scriptCmdletName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(scriptPackageName, "^[-\\w\\._@]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "scriptPackageName", "^[-\\w\\._@]+$"); + } } - if (Client.ApiVersion == null) + if (scriptCmdletName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "scriptCmdletName"); } - if (Client.ApiVersion != null) + if (scriptCmdletName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(scriptCmdletName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "scriptCmdletName", "^[-\\w\\._]+$"); } } // Tracing @@ -387,7 +392,7 @@ internal ScriptCmdletsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{scriptPackageName}", System.Uri.EscapeDataString(scriptPackageName)); @@ -457,14 +462,13 @@ internal ScriptCmdletsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -474,10 +478,6 @@ internal ScriptCmdletsOperations(AvsClient client) } 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); @@ -523,8 +523,7 @@ internal ScriptCmdletsOperations(AvsClient client) } /// - /// List script cmdlet resources available for a private cloud to create a - /// script execution resource on a private cloud + /// List ScriptCmdlet resources by ScriptPackage /// /// /// The NextLink from the previous successful call to List operation. @@ -535,7 +534,7 @@ internal ScriptCmdletsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -631,14 +630,13 @@ internal ScriptCmdletsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -648,10 +646,6 @@ internal ScriptCmdletsOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperationsExtensions.cs index b6b206dd6bc7f..b4505f0ca6a4e 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptCmdletsOperationsExtensions.cs @@ -22,8 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class ScriptCmdletsOperationsExtensions { /// - /// List script cmdlet resources available for a private cloud to create a - /// script execution resource on a private cloud + /// List ScriptCmdlet resources by ScriptPackage /// /// /// The operations group for this extension method. @@ -35,7 +34,7 @@ public static partial class ScriptCmdletsOperationsExtensions /// Name of the private cloud /// /// - /// Name of the script package in the private cloud + /// Name of the script package. /// public static IPage List(this IScriptCmdletsOperations operations, string resourceGroupName, string privateCloudName, string scriptPackageName) { @@ -43,8 +42,7 @@ public static IPage List(this IScriptCmdletsOperations operations, } /// - /// List script cmdlet resources available for a private cloud to create a - /// script execution resource on a private cloud + /// List ScriptCmdlet resources by ScriptPackage /// /// /// The operations group for this extension method. @@ -56,7 +54,7 @@ public static IPage List(this IScriptCmdletsOperations operations, /// Name of the private cloud /// /// - /// Name of the script package in the private cloud + /// Name of the script package. /// /// /// The cancellation token. @@ -70,8 +68,7 @@ public static IPage List(this IScriptCmdletsOperations operations, } /// - /// Return information about a script cmdlet resource in a specific package on - /// a private cloud + /// Get a ScriptCmdlet /// /// /// The operations group for this extension method. @@ -83,11 +80,10 @@ public static IPage List(this IScriptCmdletsOperations operations, /// Name of the private cloud /// /// - /// Name of the script package in the private cloud + /// Name of the script package. /// /// - /// Name of the script cmdlet resource in the script package in the private - /// cloud + /// Name of the script cmdlet. /// public static ScriptCmdlet Get(this IScriptCmdletsOperations operations, string resourceGroupName, string privateCloudName, string scriptPackageName, string scriptCmdletName) { @@ -95,8 +91,7 @@ public static ScriptCmdlet Get(this IScriptCmdletsOperations operations, string } /// - /// Return information about a script cmdlet resource in a specific package on - /// a private cloud + /// Get a ScriptCmdlet /// /// /// The operations group for this extension method. @@ -108,11 +103,10 @@ public static ScriptCmdlet Get(this IScriptCmdletsOperations operations, string /// Name of the private cloud /// /// - /// Name of the script package in the private cloud + /// Name of the script package. /// /// - /// Name of the script cmdlet resource in the script package in the private - /// cloud + /// Name of the script cmdlet. /// /// /// The cancellation token. @@ -126,8 +120,7 @@ public static ScriptCmdlet Get(this IScriptCmdletsOperations operations, string } /// - /// List script cmdlet resources available for a private cloud to create a - /// script execution resource on a private cloud + /// List ScriptCmdlet resources by ScriptPackage /// /// /// The operations group for this extension method. @@ -141,8 +134,7 @@ public static IPage ListNext(this IScriptCmdletsOperations operati } /// - /// List script cmdlet resources available for a private cloud to create a - /// script execution resource on a private cloud + /// List ScriptCmdlet resources by ScriptPackage /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperations.cs index b912a99c24355..5977d1d170522 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperations.cs @@ -51,7 +51,7 @@ internal ScriptExecutionsOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List script executions in a private cloud + /// List ScriptExecution resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -65,7 +65,7 @@ internal ScriptExecutionsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,15 +82,15 @@ internal ScriptExecutionsOperations(AvsClient client) /// public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -112,15 +112,11 @@ internal ScriptExecutionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -138,7 +134,7 @@ internal ScriptExecutionsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -206,14 +202,13 @@ internal ScriptExecutionsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -223,10 +218,6 @@ internal ScriptExecutionsOperations(AvsClient client) } 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); @@ -272,7 +263,7 @@ internal ScriptExecutionsOperations(AvsClient client) } /// - /// Get an script execution by name in a private cloud + /// Get a ScriptExecution /// /// /// The name of the resource group. The name is case insensitive. @@ -281,7 +272,7 @@ internal ScriptExecutionsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// Headers that will be added to request. @@ -289,7 +280,7 @@ internal ScriptExecutionsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -306,15 +297,15 @@ internal ScriptExecutionsOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -336,19 +327,22 @@ internal ScriptExecutionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (scriptExecutionName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scriptExecutionName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (scriptExecutionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "scriptExecutionName"); } - if (Client.ApiVersion != null) + if (scriptExecutionName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(scriptExecutionName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "scriptExecutionName", "^[-\\w\\._]+$"); } } // Tracing @@ -367,7 +361,7 @@ internal ScriptExecutionsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{scriptExecutionName}", System.Uri.EscapeDataString(scriptExecutionName)); @@ -436,14 +430,13 @@ internal ScriptExecutionsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -453,10 +446,6 @@ internal ScriptExecutionsOperations(AvsClient client) } 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); @@ -502,19 +491,19 @@ internal ScriptExecutionsOperations(AvsClient client) } /// - /// Create or update a script execution in a private cloud + /// Create a ScriptExecution /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// - /// A script running in the private cloud + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -522,15 +511,15 @@ internal ScriptExecutionsOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, ScriptExecution scriptExecution, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, ScriptExecution scriptExecution, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Cancel a ScriptExecution in a private cloud + /// Delete a ScriptExecution /// /// /// The name of the resource group. The name is case insensitive. @@ -539,7 +528,7 @@ internal ScriptExecutionsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// The headers that will be added to request. @@ -547,10 +536,10 @@ internal ScriptExecutionsOperations(AvsClient client) /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, scriptExecutionName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, scriptExecutionName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -564,11 +553,11 @@ internal ScriptExecutionsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// Name of the desired output stream to return. If not provided, will return - /// all. An empty array will return nothing + /// all. An empty array will return nothing. /// /// /// Headers that will be added to request. @@ -576,7 +565,7 @@ internal ScriptExecutionsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -593,15 +582,15 @@ internal ScriptExecutionsOperations(AvsClient client) /// public async Task> GetExecutionLogsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, IList scriptOutputStreamType = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -623,19 +612,22 @@ internal ScriptExecutionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (scriptExecutionName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scriptExecutionName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (scriptExecutionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "scriptExecutionName"); } - if (Client.ApiVersion != null) + if (scriptExecutionName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(scriptExecutionName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "scriptExecutionName", "^[-\\w\\._]+$"); } } // Tracing @@ -655,7 +647,7 @@ internal ScriptExecutionsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}/getExecutionLogs").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{scriptExecutionName}", System.Uri.EscapeDataString(scriptExecutionName)); @@ -730,14 +722,13 @@ internal ScriptExecutionsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -747,10 +738,6 @@ internal ScriptExecutionsOperations(AvsClient client) } 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); @@ -796,19 +783,19 @@ internal ScriptExecutionsOperations(AvsClient client) } /// - /// Create or update a script execution in a private cloud + /// Create a ScriptExecution /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// - /// A script running in the private cloud + /// Resource create parameters. /// /// /// Headers that will be added to request. @@ -816,7 +803,7 @@ internal ScriptExecutionsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -831,17 +818,17 @@ internal ScriptExecutionsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, ScriptExecution scriptExecution, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, ScriptExecution scriptExecution, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -863,10 +850,24 @@ internal ScriptExecutionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } if (scriptExecutionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scriptExecutionName"); } + if (scriptExecutionName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(scriptExecutionName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "scriptExecutionName", "^[-\\w\\._]+$"); + } + } if (scriptExecution == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scriptExecution"); @@ -875,17 +876,6 @@ internal ScriptExecutionsOperations(AvsClient client) { scriptExecution.Validate(); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -903,7 +893,7 @@ internal ScriptExecutionsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{scriptExecutionName}", System.Uri.EscapeDataString(scriptExecutionName)); @@ -978,14 +968,13 @@ internal ScriptExecutionsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -995,10 +984,6 @@ internal ScriptExecutionsOperations(AvsClient client) } 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); @@ -1011,7 +996,7 @@ internal ScriptExecutionsOperations(AvsClient 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")) @@ -1054,6 +1039,19 @@ internal ScriptExecutionsOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1062,7 +1060,7 @@ internal ScriptExecutionsOperations(AvsClient client) } /// - /// Cancel a ScriptExecution in a private cloud + /// Delete a ScriptExecution /// /// /// The name of the resource group. The name is case insensitive. @@ -1071,7 +1069,7 @@ internal ScriptExecutionsOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// Headers that will be added to request. @@ -1079,7 +1077,7 @@ internal ScriptExecutionsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1091,17 +1089,17 @@ internal ScriptExecutionsOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptExecutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -1123,19 +1121,22 @@ internal ScriptExecutionsOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (scriptExecutionName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scriptExecutionName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (scriptExecutionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "scriptExecutionName"); } - if (Client.ApiVersion != null) + if (scriptExecutionName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(scriptExecutionName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "scriptExecutionName", "^[-\\w\\._]+$"); } } // Tracing @@ -1154,7 +1155,7 @@ internal ScriptExecutionsOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{scriptExecutionName}", System.Uri.EscapeDataString(scriptExecutionName)); @@ -1223,14 +1224,13 @@ internal ScriptExecutionsOperations(AvsClient client) 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)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1240,10 +1240,6 @@ internal ScriptExecutionsOperations(AvsClient client) } 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); @@ -1256,13 +1252,26 @@ internal ScriptExecutionsOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1271,7 +1280,7 @@ internal ScriptExecutionsOperations(AvsClient client) } /// - /// List script executions in a private cloud + /// List ScriptExecution resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -1282,7 +1291,7 @@ internal ScriptExecutionsOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1378,14 +1387,13 @@ internal ScriptExecutionsOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1395,10 +1403,6 @@ internal ScriptExecutionsOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperationsExtensions.cs index 74423d569e23d..a597d3d8b3ecb 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptExecutionsOperationsExtensions.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class ScriptExecutionsOperationsExtensions { /// - /// List script executions in a private cloud + /// List ScriptExecution resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -41,7 +41,7 @@ public static IPage List(this IScriptExecutionsOperations opera } /// - /// List script executions in a private cloud + /// List ScriptExecution resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -64,7 +64,7 @@ public static IPage List(this IScriptExecutionsOperations opera } /// - /// Get an script execution by name in a private cloud + /// Get a ScriptExecution /// /// /// The operations group for this extension method. @@ -76,7 +76,7 @@ public static IPage List(this IScriptExecutionsOperations opera /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// public static ScriptExecution Get(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName) { @@ -84,7 +84,7 @@ public static ScriptExecution Get(this IScriptExecutionsOperations operations, s } /// - /// Get an script execution by name in a private cloud + /// Get a ScriptExecution /// /// /// The operations group for this extension method. @@ -96,7 +96,7 @@ public static ScriptExecution Get(this IScriptExecutionsOperations operations, s /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// The cancellation token. @@ -110,7 +110,7 @@ public static ScriptExecution Get(this IScriptExecutionsOperations operations, s } /// - /// Create or update a script execution in a private cloud + /// Create a ScriptExecution /// /// /// The operations group for this extension method. @@ -119,13 +119,13 @@ public static ScriptExecution Get(this IScriptExecutionsOperations operations, s /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// - /// A script running in the private cloud + /// Resource create parameters. /// public static ScriptExecution CreateOrUpdate(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName, ScriptExecution scriptExecution) { @@ -133,7 +133,7 @@ public static ScriptExecution CreateOrUpdate(this IScriptExecutionsOperations op } /// - /// Create or update a script execution in a private cloud + /// Create a ScriptExecution /// /// /// The operations group for this extension method. @@ -142,13 +142,13 @@ public static ScriptExecution CreateOrUpdate(this IScriptExecutionsOperations op /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// - /// A script running in the private cloud + /// Resource create parameters. /// /// /// The cancellation token. @@ -162,7 +162,7 @@ public static ScriptExecution CreateOrUpdate(this IScriptExecutionsOperations op } /// - /// Cancel a ScriptExecution in a private cloud + /// Delete a ScriptExecution /// /// /// The operations group for this extension method. @@ -174,15 +174,15 @@ public static ScriptExecution CreateOrUpdate(this IScriptExecutionsOperations op /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// - public static void Delete(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName) + public static ScriptExecutionsDeleteHeaders Delete(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName) { - operations.DeleteAsync(resourceGroupName, privateCloudName, scriptExecutionName).GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, privateCloudName, scriptExecutionName).GetAwaiter().GetResult(); } /// - /// Cancel a ScriptExecution in a private cloud + /// Delete a ScriptExecution /// /// /// The operations group for this extension method. @@ -194,14 +194,17 @@ public static void Delete(this IScriptExecutionsOperations operations, string re /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, scriptExecutionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, scriptExecutionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// @@ -217,11 +220,11 @@ public static void Delete(this IScriptExecutionsOperations operations, string re /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// Name of the desired output stream to return. If not provided, will return - /// all. An empty array will return nothing + /// all. An empty array will return nothing. /// public static ScriptExecution GetExecutionLogs(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName, IList scriptOutputStreamType = default(IList)) { @@ -241,11 +244,11 @@ public static void Delete(this IScriptExecutionsOperations operations, string re /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// Name of the desired output stream to return. If not provided, will return - /// all. An empty array will return nothing + /// all. An empty array will return nothing. /// /// /// The cancellation token. @@ -259,7 +262,7 @@ public static void Delete(this IScriptExecutionsOperations operations, string re } /// - /// Create or update a script execution in a private cloud + /// Create a ScriptExecution /// /// /// The operations group for this extension method. @@ -268,13 +271,13 @@ public static void Delete(this IScriptExecutionsOperations operations, string re /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// - /// A script running in the private cloud + /// Resource create parameters. /// public static ScriptExecution BeginCreateOrUpdate(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName, ScriptExecution scriptExecution) { @@ -282,7 +285,7 @@ public static ScriptExecution BeginCreateOrUpdate(this IScriptExecutionsOperatio } /// - /// Create or update a script execution in a private cloud + /// Create a ScriptExecution /// /// /// The operations group for this extension method. @@ -291,13 +294,13 @@ public static ScriptExecution BeginCreateOrUpdate(this IScriptExecutionsOperatio /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the private cloud. + /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// - /// A script running in the private cloud + /// Resource create parameters. /// /// /// The cancellation token. @@ -311,7 +314,7 @@ public static ScriptExecution BeginCreateOrUpdate(this IScriptExecutionsOperatio } /// - /// Cancel a ScriptExecution in a private cloud + /// Delete a ScriptExecution /// /// /// The operations group for this extension method. @@ -323,15 +326,15 @@ public static ScriptExecution BeginCreateOrUpdate(this IScriptExecutionsOperatio /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// - public static void BeginDelete(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName) + public static ScriptExecutionsDeleteHeaders BeginDelete(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName) { - operations.BeginDeleteAsync(resourceGroupName, privateCloudName, scriptExecutionName).GetAwaiter().GetResult(); + return operations.BeginDeleteAsync(resourceGroupName, privateCloudName, scriptExecutionName).GetAwaiter().GetResult(); } /// - /// Cancel a ScriptExecution in a private cloud + /// Delete a ScriptExecution /// /// /// The operations group for this extension method. @@ -343,18 +346,21 @@ public static void BeginDelete(this IScriptExecutionsOperations operations, stri /// Name of the private cloud /// /// - /// Name of the user-invoked script execution resource + /// Name of the script cmdlet. /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IScriptExecutionsOperations operations, string resourceGroupName, string privateCloudName, string scriptExecutionName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, scriptExecutionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, privateCloudName, scriptExecutionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List script executions in a private cloud + /// List ScriptExecution resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -368,7 +374,7 @@ public static IPage ListNext(this IScriptExecutionsOperations o } /// - /// List script executions in a private cloud + /// List ScriptExecution resources by PrivateCloud /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperations.cs index 1773ab12499b9..716971cef9c62 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperations.cs @@ -51,7 +51,7 @@ internal ScriptPackagesOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List script packages available to run on the private cloud + /// List ScriptPackage resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -65,7 +65,7 @@ internal ScriptPackagesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,15 +82,15 @@ internal ScriptPackagesOperations(AvsClient client) /// public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -112,15 +112,11 @@ internal ScriptPackagesOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } // Tracing @@ -138,7 +134,7 @@ internal ScriptPackagesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -206,14 +202,13 @@ internal ScriptPackagesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -223,10 +218,6 @@ internal ScriptPackagesOperations(AvsClient client) } 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); @@ -272,7 +263,7 @@ internal ScriptPackagesOperations(AvsClient client) } /// - /// Get a script package available to run on a private cloud + /// Get a ScriptPackage /// /// /// The name of the resource group. The name is case insensitive. @@ -281,7 +272,7 @@ internal ScriptPackagesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the script package in the private cloud + /// Name of the script package. /// /// /// Headers that will be added to request. @@ -289,7 +280,7 @@ internal ScriptPackagesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -306,15 +297,15 @@ internal ScriptPackagesOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string scriptPackageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -336,19 +327,22 @@ internal ScriptPackagesOperations(AvsClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (scriptPackageName == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scriptPackageName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } - if (Client.ApiVersion == null) + if (scriptPackageName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "scriptPackageName"); } - if (Client.ApiVersion != null) + if (scriptPackageName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(scriptPackageName, "^[-\\w\\._@]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "scriptPackageName", "^[-\\w\\._@]+$"); } } // Tracing @@ -367,7 +361,7 @@ internal ScriptPackagesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{scriptPackageName}", System.Uri.EscapeDataString(scriptPackageName)); @@ -436,14 +430,13 @@ internal ScriptPackagesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -453,10 +446,6 @@ internal ScriptPackagesOperations(AvsClient client) } 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); @@ -502,7 +491,7 @@ internal ScriptPackagesOperations(AvsClient client) } /// - /// List script packages available to run on the private cloud + /// List ScriptPackage resources by PrivateCloud /// /// /// The NextLink from the previous successful call to List operation. @@ -513,7 +502,7 @@ internal ScriptPackagesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -609,14 +598,13 @@ internal ScriptPackagesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -626,10 +614,6 @@ internal ScriptPackagesOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperationsExtensions.cs index 80d91d2cd2741..69c98cfd7380f 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/ScriptPackagesOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class ScriptPackagesOperationsExtensions { /// - /// List script packages available to run on the private cloud + /// List ScriptPackage resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -39,7 +39,7 @@ public static IPage List(this IScriptPackagesOperations operation } /// - /// List script packages available to run on the private cloud + /// List ScriptPackage resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -62,7 +62,7 @@ public static IPage List(this IScriptPackagesOperations operation } /// - /// Get a script package available to run on a private cloud + /// Get a ScriptPackage /// /// /// The operations group for this extension method. @@ -74,7 +74,7 @@ public static IPage List(this IScriptPackagesOperations operation /// Name of the private cloud /// /// - /// Name of the script package in the private cloud + /// Name of the script package. /// public static ScriptPackage Get(this IScriptPackagesOperations operations, string resourceGroupName, string privateCloudName, string scriptPackageName) { @@ -82,7 +82,7 @@ public static ScriptPackage Get(this IScriptPackagesOperations operations, strin } /// - /// Get a script package available to run on a private cloud + /// Get a ScriptPackage /// /// /// The operations group for this extension method. @@ -94,7 +94,7 @@ public static ScriptPackage Get(this IScriptPackagesOperations operations, strin /// Name of the private cloud /// /// - /// Name of the script package in the private cloud + /// Name of the script package. /// /// /// The cancellation token. @@ -108,7 +108,7 @@ public static ScriptPackage Get(this IScriptPackagesOperations operations, strin } /// - /// List script packages available to run on the private cloud + /// List ScriptPackage resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -122,7 +122,7 @@ public static IPage ListNext(this IScriptPackagesOperations opera } /// - /// List script packages available to run on the private cloud + /// List ScriptPackage resources by PrivateCloud /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/SdkInfo_AzureVMwareSolutionAPI.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/SdkInfo_AzureVMwareSolutionAPI.cs index 317f0ac445b9c..1e9d3fd6db033 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/SdkInfo_AzureVMwareSolutionAPI.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/SdkInfo_AzureVMwareSolutionAPI.cs @@ -19,35 +19,25 @@ public static IEnumerable> ApiInfo_AzureVMwareSolu { return new Tuple[] { - new Tuple("AVS", "Addons", "2021-12-01"), - new Tuple("AVS", "Authorizations", "2021-12-01"), - new Tuple("AVS", "CloudLinks", "2021-12-01"), - new Tuple("AVS", "Clusters", "2021-12-01"), - new Tuple("AVS", "Datastores", "2021-12-01"), - new Tuple("AVS", "GlobalReachConnections", "2021-12-01"), - new Tuple("AVS", "HcxEnterpriseSites", "2021-12-01"), - new Tuple("AVS", "Locations", "2021-12-01"), - new Tuple("AVS", "Operations", "2021-12-01"), - new Tuple("AVS", "PlacementPolicies", "2021-12-01"), - new Tuple("AVS", "PrivateClouds", "2021-12-01"), - new Tuple("AVS", "ScriptCmdlets", "2021-12-01"), - new Tuple("AVS", "ScriptExecutions", "2021-12-01"), - new Tuple("AVS", "ScriptPackages", "2021-12-01"), - new Tuple("AVS", "VirtualMachines", "2021-12-01"), - new Tuple("AVS", "WorkloadNetworks", "2021-12-01"), + new Tuple("AVS", "Addons", "2023-09-01"), + new Tuple("AVS", "Authorizations", "2023-09-01"), + new Tuple("AVS", "CloudLinks", "2023-09-01"), + new Tuple("AVS", "Clusters", "2023-09-01"), + new Tuple("AVS", "Datastores", "2023-09-01"), + new Tuple("AVS", "GlobalReachConnections", "2023-09-01"), + new Tuple("AVS", "HcxEnterpriseSites", "2023-09-01"), + new Tuple("AVS", "IscsiPaths", "2023-09-01"), + new Tuple("AVS", "Locations", "2023-09-01"), + new Tuple("AVS", "Operations", "2023-09-01"), + new Tuple("AVS", "PlacementPolicies", "2023-09-01"), + new Tuple("AVS", "PrivateClouds", "2023-09-01"), + new Tuple("AVS", "ScriptCmdlets", "2023-09-01"), + new Tuple("AVS", "ScriptExecutions", "2023-09-01"), + new Tuple("AVS", "ScriptPackages", "2023-09-01"), + new Tuple("AVS", "VirtualMachines", "2023-09-01"), + new Tuple("AVS", "WorkloadNetworks", "2023-09-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@3.2.1"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/vmware/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Users\\cataggar\\io\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "main"; - public static readonly String GithubCommidId = "18479a01a549e9942ea38da8761919066aa87234"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperations.cs index 8f14cb90e4f24..5d31051732d29 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperations.cs @@ -51,7 +51,7 @@ internal VirtualMachinesOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List of virtual machines in a private cloud cluster + /// List VirtualMachine resources by Cluster /// /// /// The name of the resource group. The name is case insensitive. @@ -60,7 +60,7 @@ internal VirtualMachinesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// Headers that will be added to request. @@ -68,7 +68,7 @@ internal VirtualMachinesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -85,15 +85,15 @@ internal VirtualMachinesOperations(AvsClient client) /// public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -111,25 +111,28 @@ internal VirtualMachinesOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } if (clusterName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } + if (clusterName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -146,7 +149,7 @@ internal VirtualMachinesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -215,14 +218,13 @@ internal VirtualMachinesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -232,10 +234,6 @@ internal VirtualMachinesOperations(AvsClient client) } 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); @@ -281,7 +279,7 @@ internal VirtualMachinesOperations(AvsClient client) } /// - /// Get a virtual machine by id in a private cloud cluster + /// Get a VirtualMachine /// /// /// The name of the resource group. The name is case insensitive. @@ -290,10 +288,10 @@ internal VirtualMachinesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Virtual Machine identifier + /// ID of the virtual machine. /// /// /// Headers that will be added to request. @@ -301,7 +299,7 @@ internal VirtualMachinesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -318,15 +316,15 @@ internal VirtualMachinesOperations(AvsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -344,29 +342,39 @@ internal VirtualMachinesOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } if (clusterName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } + if (clusterName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); + } + } if (virtualMachineId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineId"); } + if (virtualMachineId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(virtualMachineId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "virtualMachineId", "^[-\\w\\._]+$"); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -384,7 +392,7 @@ internal VirtualMachinesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -454,14 +462,13 @@ internal VirtualMachinesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -471,10 +478,6 @@ internal VirtualMachinesOperations(AvsClient client) } 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); @@ -529,13 +532,13 @@ internal VirtualMachinesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Virtual Machine identifier + /// ID of the virtual machine. /// /// - /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// The body type of the operation request. /// /// /// The headers that will be added to request. @@ -543,10 +546,10 @@ internal VirtualMachinesOperations(AvsClient client) /// /// The cancellation token. /// - public async Task RestrictMovementWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RestrictMovementWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginRestrictMovementWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginRestrictMovementWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -560,13 +563,13 @@ internal VirtualMachinesOperations(AvsClient client) /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Virtual Machine identifier + /// ID of the virtual machine. /// /// - /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// The body type of the operation request. /// /// /// Headers that will be added to request. @@ -574,7 +577,7 @@ internal VirtualMachinesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -586,17 +589,17 @@ internal VirtualMachinesOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRestrictMovementWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginRestrictMovementWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -614,29 +617,39 @@ internal VirtualMachinesOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } if (clusterName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } + if (clusterName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[-\\w\\._]+$"); + } + } if (virtualMachineId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineId"); } + if (virtualMachineId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(virtualMachineId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "virtualMachineId", "^[-\\w\\._]+$"); + } + } if (restrictMovement == null) { throw new ValidationException(ValidationRules.CannotBeNull, "restrictMovement"); @@ -659,7 +672,7 @@ internal VirtualMachinesOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); @@ -735,14 +748,13 @@ internal VirtualMachinesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -752,10 +764,6 @@ internal VirtualMachinesOperations(AvsClient client) } 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); @@ -768,13 +776,26 @@ internal VirtualMachinesOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -783,7 +804,7 @@ internal VirtualMachinesOperations(AvsClient client) } /// - /// List of virtual machines in a private cloud cluster + /// List VirtualMachine resources by Cluster /// /// /// The NextLink from the previous successful call to List operation. @@ -794,7 +815,7 @@ internal VirtualMachinesOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -890,14 +911,13 @@ internal VirtualMachinesOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -907,10 +927,6 @@ internal VirtualMachinesOperations(AvsClient client) } 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); diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperationsExtensions.cs index 9cf4713d6563d..509d370a10b62 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/VirtualMachinesOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class VirtualMachinesOperationsExtensions { /// - /// List of virtual machines in a private cloud cluster + /// List VirtualMachine resources by Cluster /// /// /// The operations group for this extension method. @@ -34,7 +34,7 @@ public static partial class VirtualMachinesOperationsExtensions /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// public static IPage List(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName) { @@ -42,7 +42,7 @@ public static IPage List(this IVirtualMachinesOperations operati } /// - /// List of virtual machines in a private cloud cluster + /// List VirtualMachine resources by Cluster /// /// /// The operations group for this extension method. @@ -54,7 +54,7 @@ public static IPage List(this IVirtualMachinesOperations operati /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// /// The cancellation token. @@ -68,7 +68,7 @@ public static IPage List(this IVirtualMachinesOperations operati } /// - /// Get a virtual machine by id in a private cloud cluster + /// Get a VirtualMachine /// /// /// The operations group for this extension method. @@ -80,10 +80,10 @@ public static IPage List(this IVirtualMachinesOperations operati /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Virtual Machine identifier + /// ID of the virtual machine. /// public static VirtualMachine Get(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId) { @@ -91,7 +91,7 @@ public static VirtualMachine Get(this IVirtualMachinesOperations operations, str } /// - /// Get a virtual machine by id in a private cloud cluster + /// Get a VirtualMachine /// /// /// The operations group for this extension method. @@ -103,10 +103,10 @@ public static VirtualMachine Get(this IVirtualMachinesOperations operations, str /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Virtual Machine identifier + /// ID of the virtual machine. /// /// /// The cancellation token. @@ -132,17 +132,17 @@ public static VirtualMachine Get(this IVirtualMachinesOperations operations, str /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Virtual Machine identifier + /// ID of the virtual machine. /// /// - /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// The body type of the operation request. /// - public static void RestrictMovement(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement) + public static VirtualMachinesRestrictMovementHeaders RestrictMovement(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement) { - operations.RestrictMovementAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement).GetAwaiter().GetResult(); + return operations.RestrictMovementAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement).GetAwaiter().GetResult(); } /// @@ -158,20 +158,23 @@ public static void RestrictMovement(this IVirtualMachinesOperations operations, /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Virtual Machine identifier + /// ID of the virtual machine. /// /// - /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// The body type of the operation request. /// /// /// The cancellation token. /// - public static async Task RestrictMovementAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RestrictMovementAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.RestrictMovementWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.RestrictMovementWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// @@ -187,17 +190,17 @@ public static void RestrictMovement(this IVirtualMachinesOperations operations, /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Virtual Machine identifier + /// ID of the virtual machine. /// /// - /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// The body type of the operation request. /// - public static void BeginRestrictMovement(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement) + public static VirtualMachinesRestrictMovementHeaders BeginRestrictMovement(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement) { - operations.BeginRestrictMovementAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement).GetAwaiter().GetResult(); + return operations.BeginRestrictMovementAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement).GetAwaiter().GetResult(); } /// @@ -213,24 +216,27 @@ public static void BeginRestrictMovement(this IVirtualMachinesOperations operati /// Name of the private cloud /// /// - /// Name of the cluster in the private cloud + /// Name of the cluster /// /// - /// Virtual Machine identifier + /// ID of the virtual machine. /// /// - /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// The body type of the operation request. /// /// /// The cancellation token. /// - public static async Task BeginRestrictMovementAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginRestrictMovementAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, VirtualMachineRestrictMovement restrictMovement, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginRestrictMovementWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginRestrictMovementWithHttpMessagesAsync(resourceGroupName, privateCloudName, clusterName, virtualMachineId, restrictMovement, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List of virtual machines in a private cloud cluster + /// List VirtualMachine resources by Cluster /// /// /// The operations group for this extension method. @@ -244,7 +250,7 @@ public static IPage ListNext(this IVirtualMachinesOperations ope } /// - /// List of virtual machines in a private cloud cluster + /// List VirtualMachine resources by Cluster /// /// /// The operations group for this extension method. diff --git a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/WorkloadNetworksOperations.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/WorkloadNetworksOperations.cs index 0c3056e285c7d..a027b602e4295 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/WorkloadNetworksOperations.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/WorkloadNetworksOperations.cs @@ -51,7 +51,7 @@ internal WorkloadNetworksOperations(AvsClient client) public AvsClient Client { get; private set; } /// - /// List of segments in a private cloud workload network. + /// List WorkloadNetwork resources by PrivateCloud /// /// /// The name of the resource group. The name is case insensitive. @@ -65,7 +65,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -80,17 +80,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -108,21 +108,17 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -133,12 +129,12 @@ internal WorkloadNetworksOperations(AvsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSegments", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -206,14 +202,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -223,10 +218,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -239,7 +230,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -252,7 +243,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -272,7 +263,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Get a segment by id in a private cloud workload network. + /// Get a WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -280,16 +271,13 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -304,17 +292,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSegmentWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -332,24 +320,16 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } if (privateCloudName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (segmentId == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "segmentId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -360,17 +340,15 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("segmentId", segmentId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSegment", 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{segmentId}", System.Uri.EscapeDataString(segmentId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -436,14 +414,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -453,10 +430,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -469,7 +442,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -482,7 +455,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -502,88 +475,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create a segment by id in a private cloud workload network. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the private cloud - /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name - /// - /// - /// NSX Segment - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Create or update a segment by id in a private cloud workload network. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the private cloud - /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name - /// - /// - /// NSX Segment - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Delete a segment by id in a private cloud workload network. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the private cloud - /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteSegmentWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteSegmentWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// List dhcp in a private cloud workload network. + /// List WorkloadNetworkDhcp resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -597,7 +489,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -614,15 +506,15 @@ internal WorkloadNetworksOperations(AvsClient client) /// public async Task>> ListDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -640,21 +532,17 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -670,7 +558,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -738,14 +626,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -755,10 +642,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -804,13 +687,13 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Get dhcp by id in a private cloud workload network. + /// Get a WorkloadNetworkDhcp /// /// /// The name of the resource group. The name is case insensitive. /// /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// The ID of the DHCP configuration /// /// /// Name of the private cloud @@ -821,7 +704,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -838,15 +721,15 @@ internal WorkloadNetworksOperations(AvsClient client) /// public async Task> GetDhcpWithHttpMessagesAsync(string resourceGroupName, string dhcpId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -864,25 +747,28 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (dhcpId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "dhcpId"); } - if (Client.ApiVersion != null) + if (dhcpId != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(dhcpId, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "dhcpId", "^[-\\w\\._]+$"); } } - if (dhcpId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dhcpId"); - } if (privateCloudName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -899,7 +785,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{dhcpId}", System.Uri.EscapeDataString(dhcpId)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); @@ -968,14 +854,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -985,10 +870,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -1034,7 +915,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create dhcp by id in a private cloud workload network. + /// Create a WorkloadNetworkDhcp /// /// /// The name of the resource group. The name is case insensitive. @@ -1043,10 +924,10 @@ internal WorkloadNetworksOperations(AvsClient client) /// Name of the private cloud /// /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// The ID of the DHCP configuration /// /// - /// NSX DHCP + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -1054,15 +935,15 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> CreateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update dhcp by id in a private cloud workload network. + /// Update a WorkloadNetworkDhcp /// /// /// The name of the resource group. The name is case insensitive. @@ -1071,10 +952,10 @@ internal WorkloadNetworksOperations(AvsClient client) /// Name of the private cloud /// /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// The ID of the DHCP configuration /// /// - /// NSX DHCP + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -1082,15 +963,15 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> UpdateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcpUpdate workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginUpdateDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete dhcp by id in a private cloud workload network. + /// Delete a WorkloadNetworkDhcp /// /// /// The name of the resource group. The name is case insensitive. @@ -1099,7 +980,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// Name of the private cloud /// /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// The ID of the DHCP configuration /// /// /// The headers that will be added to request. @@ -1107,15 +988,15 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - public async Task DeleteDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeleteDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// List of gateways in a private cloud workload network. + /// List WorkloadNetworkDnsService resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -1129,7 +1010,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1144,17 +1025,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListGatewaysWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDnsServicesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -1172,21 +1053,17 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1197,12 +1074,12 @@ internal WorkloadNetworksOperations(AvsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListGateways", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDnsServices", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -1270,14 +1147,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1287,10 +1163,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -1303,7 +1175,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -1316,7 +1188,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -1336,7 +1208,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Get a gateway by id in a private cloud workload network. + /// Get a WorkloadNetworkDnsService /// /// /// The name of the resource group. The name is case insensitive. @@ -1344,8 +1216,8 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX Gateway identifier. Generally the same as the Gateway's display name + /// + /// ID of the DNS service. /// /// /// Headers that will be added to request. @@ -1353,7 +1225,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1368,17 +1240,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetGatewayWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string gatewayId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -1396,24 +1268,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (dnsServiceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "dnsServiceId"); } - if (gatewayId == null) + if (dnsServiceId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(dnsServiceId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "dnsServiceId", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1424,17 +1299,17 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("gatewayId", gatewayId); + tracingParameters.Add("dnsServiceId", dnsServiceId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetGateway", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDnsService", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{gatewayId}", System.Uri.EscapeDataString(gatewayId)); + _url = _url.Replace("{dnsServiceId}", System.Uri.EscapeDataString(dnsServiceId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1500,14 +1375,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1517,10 +1391,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -1533,7 +1403,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -1546,7 +1416,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -1566,7 +1436,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// List of port mirroring profiles in a private cloud workload network. + /// Create a WorkloadNetworkDnsService /// /// /// The name of the resource group. The name is case insensitive. @@ -1574,42 +1444,123 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// + /// + /// ID of the DNS service. + /// + /// + /// Resource create parameters. + /// /// - /// Headers that will be added to request. + /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListPortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.SubscriptionId != null) - { - if (Client.SubscriptionId.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) - { + // Send Request + AzureOperationResponse _response = await BeginCreateDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a WorkloadNetworkDnsService + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// ID of the DNS service. + /// + /// + /// The resource properties to be updated. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsServiceUpdate workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a WorkloadNetworkDnsService + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// ID of the DNS service. + /// + /// + /// Name of the private cloud + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteDnsServiceWithHttpMessagesAsync(string resourceGroupName, string dnsServiceId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteDnsServiceWithHttpMessagesAsync(resourceGroupName, dnsServiceId, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// List WorkloadNetworkDnsZone resources by WorkloadNetwork + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// 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>> ListDnsZonesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (resourceGroupName == null) + { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) @@ -1623,21 +1574,17 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1648,12 +1595,12 @@ internal WorkloadNetworksOperations(AvsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPortMirroring", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDnsZones", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -1721,14 +1668,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1738,10 +1684,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -1754,7 +1696,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -1767,7 +1709,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -1787,7 +1729,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Get a port mirroring profile by id in a private cloud workload network. + /// Get a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. @@ -1795,9 +1737,8 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// /// /// Headers that will be added to request. @@ -1805,7 +1746,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1820,17 +1761,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -1848,24 +1789,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (dnsZoneId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "dnsZoneId"); } - if (portMirroringId == null) + if (dnsZoneId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "portMirroringId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(dnsZoneId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "dnsZoneId", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1876,17 +1820,17 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("portMirroringId", portMirroringId); + tracingParameters.Add("dnsZoneId", dnsZoneId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPortMirroring", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetDnsZone", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{portMirroringId}", System.Uri.EscapeDataString(portMirroringId)); + _url = _url.Replace("{dnsZoneId}", System.Uri.EscapeDataString(dnsZoneId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1952,14 +1896,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1969,10 +1912,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -1985,7 +1924,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -1998,7 +1937,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -2018,7 +1957,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create a port mirroring profile by id in a private cloud workload network. + /// Create a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. @@ -2026,12 +1965,11 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -2039,16 +1977,15 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> CreatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreatePortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update a port mirroring profile by id in a private cloud workload - /// network. + /// Update a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. @@ -2056,12 +1993,11 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -2069,22 +2005,21 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> UpdatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZoneUpdate workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginUpdatePortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a port mirroring profile by id in a private cloud workload network. + /// Delete a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// /// /// Name of the private cloud @@ -2095,15 +2030,15 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - public async Task DeletePortMirroringWithHttpMessagesAsync(string resourceGroupName, string portMirroringId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteDnsZoneWithHttpMessagesAsync(string resourceGroupName, string dnsZoneId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeletePortMirroringWithHttpMessagesAsync(resourceGroupName, portMirroringId, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeleteDnsZoneWithHttpMessagesAsync(resourceGroupName, dnsZoneId, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// List of vm groups in a private cloud workload network. + /// List WorkloadNetworkGateway resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -2117,7 +2052,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2132,17 +2067,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVMGroupsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListGatewaysWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -2160,21 +2095,17 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2185,12 +2116,12 @@ internal WorkloadNetworksOperations(AvsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVMGroups", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListGateways", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -2258,14 +2189,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2275,10 +2205,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -2291,7 +2217,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -2304,7 +2230,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -2324,7 +2250,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Get a vm group by id in a private cloud workload network. + /// Get a WorkloadNetworkGateway /// /// /// The name of the resource group. The name is case insensitive. @@ -2332,8 +2258,8 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// + /// The ID of the NSX Gateway /// /// /// Headers that will be added to request. @@ -2341,7 +2267,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2356,17 +2282,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetGatewayWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string gatewayId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -2384,24 +2310,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (gatewayId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayId"); } - if (vmGroupId == null) + if (gatewayId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmGroupId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(gatewayId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "gatewayId", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -2412,17 +2341,17 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("vmGroupId", vmGroupId); + tracingParameters.Add("gatewayId", gatewayId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVMGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetGateway", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{vmGroupId}", System.Uri.EscapeDataString(vmGroupId)); + _url = _url.Replace("{gatewayId}", System.Uri.EscapeDataString(gatewayId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -2488,14 +2417,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2505,10 +2433,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -2521,7 +2445,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -2534,7 +2458,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -2554,7 +2478,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create a vm group by id in a private cloud workload network. + /// List WorkloadNetworkPortMirroring resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -2562,119 +2486,38 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// - /// - /// NSX VM Group - /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// 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>> ListPortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Create or update a vm group by id in a private cloud workload network. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the private cloud - /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// - /// - /// NSX VM Group - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Delete a vm group by id in a private cloud workload network. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// - /// - /// Name of the private cloud - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteVMGroupWithHttpMessagesAsync(string resourceGroupName, string vmGroupId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteVMGroupWithHttpMessagesAsync(resourceGroupName, vmGroupId, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// List of virtual machines in a private cloud workload network. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the private cloud - /// - /// - /// 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>> ListVirtualMachinesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -2692,21 +2535,17 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2717,12 +2556,12 @@ internal WorkloadNetworksOperations(AvsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachines", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPortMirroring", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -2790,14 +2629,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2807,10 +2645,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -2823,7 +2657,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -2836,7 +2670,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -2856,7 +2690,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Get a virtual machine by id in a private cloud workload network. + /// Get a WorkloadNetworkPortMirroring /// /// /// The name of the resource group. The name is case insensitive. @@ -2864,8 +2698,8 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// Virtual Machine identifier + /// + /// ID of the NSX port mirroring profile. /// /// /// Headers that will be added to request. @@ -2873,7 +2707,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2888,17 +2722,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetVirtualMachineWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string virtualMachineId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -2916,24 +2750,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (portMirroringId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "portMirroringId"); } - if (virtualMachineId == null) + if (portMirroringId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(portMirroringId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "portMirroringId", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -2944,17 +2781,17 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("virtualMachineId", virtualMachineId); + tracingParameters.Add("portMirroringId", portMirroringId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachine", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPortMirroring", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{virtualMachineId}", System.Uri.EscapeDataString(virtualMachineId)); + _url = _url.Replace("{portMirroringId}", System.Uri.EscapeDataString(portMirroringId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -3020,14 +2857,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3037,10 +2873,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -3053,7 +2885,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -3066,7 +2898,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -3086,7 +2918,88 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// List of DNS services in a private cloud workload network. + /// Create a WorkloadNetworkPortMirroring + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// ID of the NSX port mirroring profile. + /// + /// + /// Resource create parameters. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreatePortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a WorkloadNetworkPortMirroring + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// ID of the NSX port mirroring profile. + /// + /// + /// The resource properties to be updated. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroringUpdate workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdatePortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a WorkloadNetworkPortMirroring + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// ID of the NSX port mirroring profile. + /// + /// + /// Name of the private cloud + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeletePortMirroringWithHttpMessagesAsync(string resourceGroupName, string portMirroringId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeletePortMirroringWithHttpMessagesAsync(resourceGroupName, portMirroringId, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// List WorkloadNetworkPublicIP resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -3100,7 +3013,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -3115,17 +3028,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDnsServicesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPublicIPsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -3143,21 +3056,17 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3168,12 +3077,12 @@ internal WorkloadNetworksOperations(AvsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDnsServices", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublicIPs", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -3241,14 +3150,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3258,10 +3166,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -3274,7 +3178,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -3287,7 +3191,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -3307,7 +3211,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Get a DNS service by id in a private cloud workload network. + /// Get a WorkloadNetworkPublicIP /// /// /// The name of the resource group. The name is case insensitive. @@ -3315,9 +3219,8 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name + /// + /// ID of the DNS zone. /// /// /// Headers that will be added to request. @@ -3325,7 +3228,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -3340,17 +3243,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPublicIPWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string publicIPId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -3368,24 +3271,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (publicIPId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicIPId"); } - if (dnsServiceId == null) + if (publicIPId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dnsServiceId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(publicIPId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "publicIPId", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -3396,17 +3302,17 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("dnsServiceId", dnsServiceId); + tracingParameters.Add("publicIPId", publicIPId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDnsService", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPublicIP", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{dnsServiceId}", System.Uri.EscapeDataString(dnsServiceId)); + _url = _url.Replace("{publicIPId}", System.Uri.EscapeDataString(publicIPId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -3472,14 +3378,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3489,10 +3394,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -3505,7 +3406,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -3518,7 +3419,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -3538,36 +3439,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create a DNS service by id in a private cloud workload network. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the private cloud - /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name - /// - /// - /// NSX DNS Service - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Create or update a DNS service by id in a private cloud workload network. + /// Create a WorkloadNetworkPublicIP /// /// /// The name of the resource group. The name is case insensitive. @@ -3575,12 +3447,11 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name + /// + /// ID of the DNS zone. /// - /// - /// NSX DNS Service + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -3588,22 +3459,21 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> UpdateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreatePublicIPWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginUpdateDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreatePublicIPWithHttpMessagesAsync(resourceGroupName, privateCloudName, publicIPId, workloadNetworkPublicIP, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a DNS service by id in a private cloud workload network. + /// Delete a WorkloadNetworkPublicIP /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name + /// + /// ID of the DNS zone. /// /// /// Name of the private cloud @@ -3614,15 +3484,15 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - public async Task DeleteDnsServiceWithHttpMessagesAsync(string resourceGroupName, string dnsServiceId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeletePublicIPWithHttpMessagesAsync(string resourceGroupName, string publicIPId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteDnsServiceWithHttpMessagesAsync(resourceGroupName, dnsServiceId, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeletePublicIPWithHttpMessagesAsync(resourceGroupName, publicIPId, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// List of DNS zones in a private cloud workload network. + /// List WorkloadNetworkSegment resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -3636,7 +3506,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -3651,17 +3521,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDnsZonesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -3679,21 +3549,17 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3704,12 +3570,12 @@ internal WorkloadNetworksOperations(AvsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDnsZones", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSegments", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -3777,14 +3643,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3794,10 +3659,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -3810,7 +3671,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -3823,7 +3684,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -3843,7 +3704,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Get a DNS zone by id in a private cloud workload network. + /// Get a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. @@ -3851,8 +3712,8 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// + /// The ID of the NSX Segment /// /// /// Headers that will be added to request. @@ -3860,7 +3721,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -3875,17 +3736,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSegmentWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -3903,24 +3764,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (segmentId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "segmentId"); } - if (dnsZoneId == null) + if (segmentId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dnsZoneId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(segmentId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "segmentId", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -3931,17 +3795,17 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("dnsZoneId", dnsZoneId); + tracingParameters.Add("segmentId", segmentId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDnsZone", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSegment", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{dnsZoneId}", System.Uri.EscapeDataString(dnsZoneId)); + _url = _url.Replace("{segmentId}", System.Uri.EscapeDataString(segmentId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -4007,14 +3871,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -4024,10 +3887,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -4040,7 +3899,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -4053,7 +3912,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -4073,7 +3932,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create a DNS zone by id in a private cloud workload network. + /// Create a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. @@ -4081,11 +3940,11 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// + /// The ID of the NSX Segment /// - /// - /// NSX DNS Zone + /// + /// Resource create parameters. /// /// /// The headers that will be added to request. @@ -4093,15 +3952,15 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> CreateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update a DNS zone by id in a private cloud workload network. + /// Update a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. @@ -4109,11 +3968,11 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// + /// The ID of the NSX Segment /// - /// - /// NSX DNS Zone + /// + /// The resource properties to be updated. /// /// /// The headers that will be added to request. @@ -4121,40 +3980,40 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - public async Task> UpdateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegmentUpdate workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginUpdateDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a DNS zone by id in a private cloud workload network. + /// Delete a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// /// /// Name of the private cloud /// + /// + /// The ID of the NSX Segment + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteDnsZoneWithHttpMessagesAsync(string resourceGroupName, string dnsZoneId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteSegmentWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteDnsZoneWithHttpMessagesAsync(resourceGroupName, dnsZoneId, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationHeaderResponse _response = await BeginDeleteSegmentWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// List of Public IP Blocks in a private cloud workload network. + /// List WorkloadNetworkVirtualMachine resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -4168,7 +4027,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -4183,17 +4042,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublicIPsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVirtualMachinesWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -4211,21 +4070,17 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4236,12 +4091,12 @@ internal WorkloadNetworksOperations(AvsClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublicIPs", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachines", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); List _queryParameters = new List(); @@ -4309,14 +4164,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -4326,10 +4180,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -4342,7 +4192,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -4355,7 +4205,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -4375,7 +4225,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Get a Public IP Block by id in a private cloud workload network. + /// Get a WorkloadNetworkVirtualMachine /// /// /// The name of the resource group. The name is case insensitive. @@ -4383,9 +4233,8 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name + /// + /// ID of the virtual machine. /// /// /// Headers that will be added to request. @@ -4393,7 +4242,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -4408,17 +4257,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPublicIPWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string publicIPId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVirtualMachineWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string virtualMachineId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -4436,24 +4285,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (virtualMachineId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineId"); } - if (publicIPId == null) + if (virtualMachineId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIPId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(virtualMachineId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "virtualMachineId", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -4464,17 +4316,17 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("publicIPId", publicIPId); + tracingParameters.Add("virtualMachineId", virtualMachineId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPublicIP", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachine", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{publicIPId}", System.Uri.EscapeDataString(publicIPId)); + _url = _url.Replace("{virtualMachineId}", System.Uri.EscapeDataString(virtualMachineId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -4540,14 +4392,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -4557,10 +4408,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -4573,7 +4420,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -4586,7 +4433,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -4606,62 +4453,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create a Public IP Block by id in a private cloud workload network. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the private cloud - /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name - /// - /// - /// NSX Public IP Block - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreatePublicIPWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreatePublicIPWithHttpMessagesAsync(resourceGroupName, privateCloudName, publicIPId, workloadNetworkPublicIP, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Delete a Public IP Block by id in a private cloud workload network. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name - /// - /// - /// Name of the private cloud - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeletePublicIPWithHttpMessagesAsync(string resourceGroupName, string publicIPId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeletePublicIPWithHttpMessagesAsync(resourceGroupName, publicIPId, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Create a segment by id in a private cloud workload network. + /// List WorkloadNetworkVMGroup resources by WorkloadNetwork /// /// /// The name of the resource group. The name is case insensitive. @@ -4669,19 +4461,13 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name - /// - /// - /// NSX Segment - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -4696,17 +4482,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVMGroupsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -4724,28 +4510,16 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } if (privateCloudName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (segmentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "segmentId"); - } - if (workloadNetworkSegment == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkSegment"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -4756,18 +4530,15 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("segmentId", segmentId); - tracingParameters.Add("workloadNetworkSegment", workloadNetworkSegment); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateSegments", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVMGroups", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{segmentId}", System.Uri.EscapeDataString(segmentId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -4780,7 +4551,7 @@ internal WorkloadNetworksOperations(AvsClient 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) @@ -4811,12 +4582,6 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkSegment != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkSegment, 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) { @@ -4837,16 +4602,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -4856,10 +4620,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -4872,7 +4632,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -4885,25 +4645,7 @@ internal WorkloadNetworksOperations(AvsClient client) _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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -4923,7 +4665,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create or update a segment by id in a private cloud workload network. + /// Get a WorkloadNetworkVMGroup /// /// /// The name of the resource group. The name is case insensitive. @@ -4931,11 +4673,8 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name - /// - /// - /// NSX Segment + /// + /// ID of the VM group. /// /// /// Headers that will be added to request. @@ -4943,7 +4682,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -4958,17 +4697,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -4986,28 +4725,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } - if (segmentId == null) + if (vmGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "segmentId"); + throw new ValidationException(ValidationRules.CannotBeNull, "vmGroupId"); } - if (workloadNetworkSegment == null) + if (vmGroupId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkSegment"); + if (!System.Text.RegularExpressions.Regex.IsMatch(vmGroupId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "vmGroupId", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -5018,18 +4756,17 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("segmentId", segmentId); - tracingParameters.Add("workloadNetworkSegment", workloadNetworkSegment); + tracingParameters.Add("vmGroupId", vmGroupId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateSegments", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVMGroup", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{segmentId}", System.Uri.EscapeDataString(segmentId)); + _url = _url.Replace("{vmGroupId}", System.Uri.EscapeDataString(vmGroupId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -5042,7 +4779,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5073,12 +4810,6 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkSegment != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkSegment, 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) { @@ -5099,16 +4830,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -5118,10 +4848,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -5134,7 +4860,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -5147,7 +4873,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -5167,7 +4893,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Delete a segment by id in a private cloud workload network. + /// Create a WorkloadNetworkVMGroup /// /// /// The name of the resource group. The name is case insensitive. @@ -5175,8 +4901,92 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name + /// + /// ID of the VM group. + /// + /// + /// Resource create parameters. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a WorkloadNetworkVMGroup + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// ID of the VM group. + /// + /// + /// The resource properties to be updated. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroupUpdate workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a WorkloadNetworkVMGroup + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// ID of the VM group. + /// + /// + /// Name of the private cloud + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteVMGroupWithHttpMessagesAsync(string resourceGroupName, string vmGroupId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteVMGroupWithHttpMessagesAsync(resourceGroupName, vmGroupId, privateCloudName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create a WorkloadNetworkDhcp + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// The ID of the DHCP configuration + /// + /// + /// Resource create parameters. /// /// /// Headers that will be added to request. @@ -5184,9 +4994,12 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// 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 /// @@ -5196,17 +5009,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteSegmentWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -5224,24 +5037,31 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (dhcpId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "dhcpId"); } - if (segmentId == null) + if (dhcpId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "segmentId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(dhcpId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "dhcpId", "^[-\\w\\._]+$"); + } + } + if (workloadNetworkDhcp == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkDhcp"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -5252,17 +5072,18 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("segmentId", segmentId); + tracingParameters.Add("dhcpId", dhcpId); + tracingParameters.Add("workloadNetworkDhcp", workloadNetworkDhcp); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSegment", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateDhcp", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{segmentId}", System.Uri.EscapeDataString(segmentId)); + _url = _url.Replace("{dhcpId}", System.Uri.EscapeDataString(dhcpId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -5275,7 +5096,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5306,6 +5127,12 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; + if(workloadNetworkDhcp != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkDhcp, 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) { @@ -5326,16 +5153,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -5345,28 +5171,821 @@ internal WorkloadNetworksOperations(AvsClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + 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); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update a WorkloadNetworkDhcp + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// The ID of the DHCP configuration + /// + /// + /// The resource properties to be updated. + /// + /// + /// 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> BeginUpdateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcpUpdate workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } + if (dhcpId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dhcpId"); + } + if (dhcpId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(dhcpId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "dhcpId", "^[-\\w\\._]+$"); + } + } + if (workloadNetworkDhcp == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkDhcp"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("dhcpId", dhcpId); + tracingParameters.Add("workloadNetworkDhcp", workloadNetworkDhcp); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateDhcp", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{dhcpId}", System.Uri.EscapeDataString(dhcpId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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(workloadNetworkDhcp != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkDhcp, 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a WorkloadNetworkDhcp + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// The ID of the DHCP configuration + /// + /// + /// 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> BeginDeleteDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } + if (dhcpId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dhcpId"); + } + if (dhcpId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(dhcpId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "dhcpId", "^[-\\w\\._]+$"); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("dhcpId", dhcpId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteDhcp", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{dhcpId}", System.Uri.EscapeDataString(dhcpId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create a WorkloadNetworkDnsService + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// ID of the DNS service. + /// + /// + /// Resource create parameters. + /// + /// + /// 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> BeginCreateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateCloudName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + } + if (privateCloudName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } + } + if (dnsServiceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dnsServiceId"); + } + if (dnsServiceId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(dnsServiceId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "dnsServiceId", "^[-\\w\\._]+$"); + } + } + if (workloadNetworkDnsService == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkDnsService"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("dnsServiceId", dnsServiceId); + tracingParameters.Add("workloadNetworkDnsService", workloadNetworkDnsService); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateDnsService", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{dnsServiceId}", System.Uri.EscapeDataString(dnsServiceId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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(workloadNetworkDnsService != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkDnsService, 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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 { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - if (_shouldTrace) + catch (JsonException ex) { - ServiceClientTracing.Error(_invocationId, ex); + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException 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(); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -5376,7 +5995,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create dhcp by id in a private cloud workload network. + /// Update a WorkloadNetworkDnsService /// /// /// The name of the resource group. The name is case insensitive. @@ -5384,11 +6003,11 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// + /// ID of the DNS service. /// - /// - /// NSX DHCP + /// + /// The resource properties to be updated. /// /// /// Headers that will be added to request. @@ -5396,7 +6015,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -5411,17 +6030,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsServiceUpdate workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -5439,28 +6058,31 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (dnsServiceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "dnsServiceId"); } - if (dhcpId == null) + if (dnsServiceId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dhcpId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(dnsServiceId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "dnsServiceId", "^[-\\w\\._]+$"); + } } - if (workloadNetworkDhcp == null) + if (workloadNetworkDnsService == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkDhcp"); + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkDnsService"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -5471,18 +6093,18 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("dhcpId", dhcpId); - tracingParameters.Add("workloadNetworkDhcp", workloadNetworkDhcp); + tracingParameters.Add("dnsServiceId", dnsServiceId); + tracingParameters.Add("workloadNetworkDnsService", workloadNetworkDnsService); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateDhcp", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateDnsService", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{dhcpId}", System.Uri.EscapeDataString(dhcpId)); + _url = _url.Replace("{dnsServiceId}", System.Uri.EscapeDataString(dnsServiceId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -5495,7 +6117,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5526,9 +6148,9 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkDhcp != null) + if(workloadNetworkDnsService != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkDhcp, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkDnsService, 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"); } @@ -5552,16 +6174,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -5571,10 +6192,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -5587,7 +6204,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -5600,7 +6217,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -5612,23 +6229,18 @@ internal WorkloadNetworksOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 201) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -5638,32 +6250,26 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create or update dhcp by id in a private cloud workload network. + /// Delete a WorkloadNetworkDnsService /// /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS service. + /// /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// - /// - /// NSX DHCP - /// /// /// 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 /// @@ -5673,17 +6279,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteDnsServiceWithHttpMessagesAsync(string resourceGroupName, string dnsServiceId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -5701,28 +6307,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (dnsServiceId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "dnsServiceId"); } - if (Client.ApiVersion != null) + if (dnsServiceId != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(dnsServiceId, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "dnsServiceId", "^[-\\w\\._]+$"); } } if (privateCloudName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (dhcpId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dhcpId"); - } - if (workloadNetworkDhcp == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkDhcp"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -5732,19 +6337,18 @@ internal WorkloadNetworksOperations(AvsClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dnsServiceId", dnsServiceId); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("dhcpId", dhcpId); - tracingParameters.Add("workloadNetworkDhcp", workloadNetworkDhcp); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateDhcp", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteDnsService", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dnsServiceId}", System.Uri.EscapeDataString(dnsServiceId)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{dhcpId}", System.Uri.EscapeDataString(dhcpId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -5757,7 +6361,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -5788,12 +6392,6 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkDhcp != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkDhcp, 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) { @@ -5814,16 +6412,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -5833,10 +6430,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -5849,30 +6442,25 @@ internal WorkloadNetworksOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _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) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -5882,7 +6470,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Delete dhcp by id in a private cloud workload network. + /// Create a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. @@ -5890,8 +6478,11 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// + /// ID of the DNS zone. + /// + /// + /// Resource create parameters. /// /// /// Headers that will be added to request. @@ -5899,9 +6490,12 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// 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 /// @@ -5911,17 +6505,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteDhcpWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dhcpId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -5939,24 +6533,31 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (dnsZoneId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "dnsZoneId"); } - if (dhcpId == null) + if (dnsZoneId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dhcpId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(dnsZoneId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "dnsZoneId", "^[-\\w\\._]+$"); + } + } + if (workloadNetworkDnsZone == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkDnsZone"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -5967,17 +6568,18 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("dhcpId", dhcpId); + tracingParameters.Add("dnsZoneId", dnsZoneId); + tracingParameters.Add("workloadNetworkDnsZone", workloadNetworkDnsZone); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteDhcp", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateDnsZone", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{dhcpId}", System.Uri.EscapeDataString(dhcpId)); + _url = _url.Replace("{dnsZoneId}", System.Uri.EscapeDataString(dnsZoneId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -5990,7 +6592,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6021,6 +6623,12 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; + if(workloadNetworkDnsZone != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkDnsZone, 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) { @@ -6041,16 +6649,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -6060,28 +6667,73 @@ internal WorkloadNetworksOperations(AvsClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + 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 { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - if (_shouldTrace) + catch (JsonException ex) { - ServiceClientTracing.Error(_invocationId, ex); + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException 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(); + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -6091,7 +6743,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create a port mirroring profile by id in a private cloud workload network. + /// Update a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. @@ -6099,12 +6751,11 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// The resource properties to be updated. /// /// /// Headers that will be added to request. @@ -6112,7 +6763,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -6127,17 +6778,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZoneUpdate workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -6155,28 +6806,31 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (dnsZoneId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "dnsZoneId"); } - if (portMirroringId == null) + if (dnsZoneId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "portMirroringId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(dnsZoneId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "dnsZoneId", "^[-\\w\\._]+$"); + } } - if (workloadNetworkPortMirroring == null) + if (workloadNetworkDnsZone == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkPortMirroring"); + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkDnsZone"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -6187,18 +6841,18 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("portMirroringId", portMirroringId); - tracingParameters.Add("workloadNetworkPortMirroring", workloadNetworkPortMirroring); + tracingParameters.Add("dnsZoneId", dnsZoneId); + tracingParameters.Add("workloadNetworkDnsZone", workloadNetworkDnsZone); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreatePortMirroring", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateDnsZone", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{portMirroringId}", System.Uri.EscapeDataString(portMirroringId)); + _url = _url.Replace("{dnsZoneId}", System.Uri.EscapeDataString(dnsZoneId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -6211,7 +6865,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6242,9 +6896,9 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkPortMirroring != null) + if(workloadNetworkDnsZone != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkPortMirroring, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkDnsZone, 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"); } @@ -6268,16 +6922,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -6287,10 +6940,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -6303,7 +6952,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -6316,7 +6965,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -6328,23 +6977,18 @@ internal WorkloadNetworksOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 201) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -6354,34 +6998,26 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create or update a port mirroring profile by id in a private cloud workload - /// network. + /// Delete a WorkloadNetworkDnsZone /// /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS zone. + /// /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name - /// - /// - /// NSX port mirroring - /// /// /// 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 /// @@ -6391,17 +7027,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteDnsZoneWithHttpMessagesAsync(string resourceGroupName, string dnsZoneId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -6419,28 +7055,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (dnsZoneId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "dnsZoneId"); } - if (Client.ApiVersion != null) + if (dnsZoneId != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(dnsZoneId, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "dnsZoneId", "^[-\\w\\._]+$"); } } if (privateCloudName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (portMirroringId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "portMirroringId"); - } - if (workloadNetworkPortMirroring == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkPortMirroring"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -6450,19 +7085,18 @@ internal WorkloadNetworksOperations(AvsClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("dnsZoneId", dnsZoneId); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("portMirroringId", portMirroringId); - tracingParameters.Add("workloadNetworkPortMirroring", workloadNetworkPortMirroring); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdatePortMirroring", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteDnsZone", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{dnsZoneId}", System.Uri.EscapeDataString(dnsZoneId)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{portMirroringId}", System.Uri.EscapeDataString(portMirroringId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -6475,7 +7109,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6506,12 +7140,6 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkPortMirroring != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkPortMirroring, 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) { @@ -6532,16 +7160,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -6551,10 +7178,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -6567,30 +7190,25 @@ internal WorkloadNetworksOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _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) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -6600,27 +7218,32 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Delete a port mirroring profile by id in a private cloud workload network. + /// Create a WorkloadNetworkPortMirroring /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name - /// /// /// Name of the private cloud /// + /// + /// ID of the NSX port mirroring profile. + /// + /// + /// Resource create parameters. + /// /// /// 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 /// @@ -6630,17 +7253,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeletePortMirroringWithHttpMessagesAsync(string resourceGroupName, string portMirroringId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -6658,24 +7281,31 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } if (portMirroringId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "portMirroringId"); } - if (privateCloudName == null) + if (portMirroringId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(portMirroringId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "portMirroringId", "^[-\\w\\._]+$"); + } + } + if (workloadNetworkPortMirroring == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkPortMirroring"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -6685,18 +7315,19 @@ internal WorkloadNetworksOperations(AvsClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("portMirroringId", portMirroringId); tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("portMirroringId", portMirroringId); + tracingParameters.Add("workloadNetworkPortMirroring", workloadNetworkPortMirroring); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePortMirroring", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreatePortMirroring", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{portMirroringId}", System.Uri.EscapeDataString(portMirroringId)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{portMirroringId}", System.Uri.EscapeDataString(portMirroringId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -6709,7 +7340,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6740,6 +7371,12 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; + if(workloadNetworkPortMirroring != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkPortMirroring, 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) { @@ -6760,16 +7397,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -6779,10 +7415,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -6792,15 +7424,64 @@ internal WorkloadNetworksOperations(AvsClient client) { _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(); + 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); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -6810,7 +7491,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create a vm group by id in a private cloud workload network. + /// Update a WorkloadNetworkPortMirroring /// /// /// The name of the resource group. The name is case insensitive. @@ -6818,11 +7499,11 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// + /// ID of the NSX port mirroring profile. /// - /// - /// NSX VM Group + /// + /// The resource properties to be updated. /// /// /// Headers that will be added to request. @@ -6830,7 +7511,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -6845,17 +7526,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdatePortMirroringWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroringUpdate workloadNetworkPortMirroring, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -6873,28 +7554,31 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (portMirroringId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "portMirroringId"); } - if (vmGroupId == null) + if (portMirroringId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmGroupId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(portMirroringId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "portMirroringId", "^[-\\w\\._]+$"); + } } - if (workloadNetworkVMGroup == null) + if (workloadNetworkPortMirroring == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkVMGroup"); + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkPortMirroring"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -6905,18 +7589,18 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("vmGroupId", vmGroupId); - tracingParameters.Add("workloadNetworkVMGroup", workloadNetworkVMGroup); + tracingParameters.Add("portMirroringId", portMirroringId); + tracingParameters.Add("workloadNetworkPortMirroring", workloadNetworkPortMirroring); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateVMGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdatePortMirroring", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{vmGroupId}", System.Uri.EscapeDataString(vmGroupId)); + _url = _url.Replace("{portMirroringId}", System.Uri.EscapeDataString(portMirroringId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -6929,7 +7613,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -6960,9 +7644,9 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkVMGroup != null) + if(workloadNetworkPortMirroring != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkVMGroup, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkPortMirroring, 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"); } @@ -6986,16 +7670,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -7005,10 +7688,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -7021,7 +7700,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -7034,7 +7713,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -7046,23 +7725,18 @@ internal WorkloadNetworksOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 201) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -7072,32 +7746,26 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create or update a vm group by id in a private cloud workload network. + /// Delete a WorkloadNetworkPortMirroring /// /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the NSX port mirroring profile. + /// /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// - /// - /// NSX VM 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 /// @@ -7107,17 +7775,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeletePortMirroringWithHttpMessagesAsync(string resourceGroupName, string portMirroringId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -7135,28 +7803,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (portMirroringId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "portMirroringId"); } - if (Client.ApiVersion != null) + if (portMirroringId != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(portMirroringId, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "portMirroringId", "^[-\\w\\._]+$"); } } if (privateCloudName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (vmGroupId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vmGroupId"); - } - if (workloadNetworkVMGroup == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkVMGroup"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -7166,19 +7833,18 @@ internal WorkloadNetworksOperations(AvsClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("portMirroringId", portMirroringId); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("vmGroupId", vmGroupId); - tracingParameters.Add("workloadNetworkVMGroup", workloadNetworkVMGroup); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateVMGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePortMirroring", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{portMirroringId}", System.Uri.EscapeDataString(portMirroringId)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{vmGroupId}", System.Uri.EscapeDataString(vmGroupId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -7191,7 +7857,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7222,12 +7888,6 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkVMGroup != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkVMGroup, 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) { @@ -7248,16 +7908,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -7267,10 +7926,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -7283,30 +7938,25 @@ internal WorkloadNetworksOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _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) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -7316,26 +7966,32 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Delete a vm group by id in a private cloud workload network. + /// Create a WorkloadNetworkPublicIP /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// /// /// Name of the private cloud /// + /// + /// ID of the DNS zone. + /// + /// + /// Resource create parameters. + /// /// /// 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 /// @@ -7345,17 +8001,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteVMGroupWithHttpMessagesAsync(string resourceGroupName, string vmGroupId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreatePublicIPWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -7373,24 +8029,31 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (vmGroupId == null) + if (publicIPId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vmGroupId"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicIPId"); } - if (privateCloudName == null) + if (publicIPId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(publicIPId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "publicIPId", "^[-\\w\\._]+$"); + } + } + if (workloadNetworkPublicIP == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkPublicIP"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -7400,18 +8063,19 @@ internal WorkloadNetworksOperations(AvsClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("vmGroupId", vmGroupId); tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("publicIPId", publicIPId); + tracingParameters.Add("workloadNetworkPublicIP", workloadNetworkPublicIP); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteVMGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreatePublicIP", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{vmGroupId}", System.Uri.EscapeDataString(vmGroupId)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{publicIPId}", System.Uri.EscapeDataString(publicIPId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -7424,7 +8088,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7455,6 +8119,12 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; + if(workloadNetworkPublicIP != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkPublicIP, 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) { @@ -7475,16 +8145,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -7494,10 +8163,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -7507,15 +8172,64 @@ internal WorkloadNetworksOperations(AvsClient client) { _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(); + 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); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -7525,33 +8239,26 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create a DNS service by id in a private cloud workload network. + /// Delete a WorkloadNetworkPublicIP /// /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS zone. + /// /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name - /// - /// - /// NSX DNS 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 /// @@ -7561,17 +8268,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeletePublicIPWithHttpMessagesAsync(string resourceGroupName, string publicIPId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -7589,28 +8296,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (publicIPId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "publicIPId"); } - if (Client.ApiVersion != null) + if (publicIPId != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(publicIPId, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "publicIPId", "^[-\\w\\._]+$"); } } if (privateCloudName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (dnsServiceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dnsServiceId"); - } - if (workloadNetworkDnsService == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkDnsService"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -7620,19 +8326,18 @@ internal WorkloadNetworksOperations(AvsClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("publicIPId", publicIPId); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("dnsServiceId", dnsServiceId); - tracingParameters.Add("workloadNetworkDnsService", workloadNetworkDnsService); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateDnsService", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePublicIP", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIPId}", System.Uri.EscapeDataString(publicIPId)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{dnsServiceId}", System.Uri.EscapeDataString(dnsServiceId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -7645,7 +8350,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7676,12 +8381,6 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkDnsService != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkDnsService, 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) { @@ -7702,16 +8401,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -7721,10 +8419,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -7737,48 +8431,25 @@ internal WorkloadNetworksOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _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) + try { - _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.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } - // Deserialize Response - if ((int)_statusCode == 201) + catch (JsonException ex) { - _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) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -7788,7 +8459,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create or update a DNS service by id in a private cloud workload network. + /// Create a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. @@ -7796,12 +8467,11 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name + /// + /// The ID of the NSX Segment /// - /// - /// NSX DNS Service + /// + /// Resource create parameters. /// /// /// Headers that will be added to request. @@ -7809,7 +8479,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -7824,17 +8494,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateDnsServiceWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -7852,28 +8522,31 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (segmentId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "segmentId"); } - if (dnsServiceId == null) + if (segmentId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dnsServiceId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(segmentId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "segmentId", "^[-\\w\\._]+$"); + } } - if (workloadNetworkDnsService == null) + if (workloadNetworkSegment == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkDnsService"); + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkSegment"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -7884,18 +8557,18 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("dnsServiceId", dnsServiceId); - tracingParameters.Add("workloadNetworkDnsService", workloadNetworkDnsService); + tracingParameters.Add("segmentId", segmentId); + tracingParameters.Add("workloadNetworkSegment", workloadNetworkSegment); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateDnsService", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateSegments", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{dnsServiceId}", System.Uri.EscapeDataString(dnsServiceId)); + _url = _url.Replace("{segmentId}", System.Uri.EscapeDataString(segmentId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -7908,7 +8581,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -7939,9 +8612,9 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkDnsService != null) + if(workloadNetworkSegment != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkDnsService, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkSegment, 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"); } @@ -7965,16 +8638,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -7984,10 +8656,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -8000,7 +8668,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -8013,7 +8681,25 @@ internal WorkloadNetworksOperations(AvsClient 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) + { + _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) { @@ -8025,6 +8711,19 @@ internal WorkloadNetworksOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -8033,27 +8732,32 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Delete a DNS service by id in a private cloud workload network. + /// Update a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name - /// /// /// Name of the private cloud /// + /// + /// The ID of the NSX Segment + /// + /// + /// The resource properties to be updated. + /// /// /// 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 /// @@ -8063,17 +8767,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteDnsServiceWithHttpMessagesAsync(string resourceGroupName, string dnsServiceId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateSegmentsWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegmentUpdate workloadNetworkSegment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -8091,24 +8795,31 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (dnsServiceId == null) + if (segmentId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dnsServiceId"); + throw new ValidationException(ValidationRules.CannotBeNull, "segmentId"); } - if (privateCloudName == null) + if (segmentId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(segmentId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "segmentId", "^[-\\w\\._]+$"); + } + } + if (workloadNetworkSegment == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkSegment"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -8118,18 +8829,19 @@ internal WorkloadNetworksOperations(AvsClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("dnsServiceId", dnsServiceId); tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("segmentId", segmentId); + tracingParameters.Add("workloadNetworkSegment", workloadNetworkSegment); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteDnsService", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateSegments", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{dnsServiceId}", System.Uri.EscapeDataString(dnsServiceId)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{segmentId}", System.Uri.EscapeDataString(segmentId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -8142,7 +8854,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8173,6 +8885,12 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; + if(workloadNetworkSegment != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkSegment, 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) { @@ -8193,16 +8911,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -8212,10 +8929,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -8228,13 +8941,44 @@ internal WorkloadNetworksOperations(AvsClient 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); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -8243,7 +8987,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create a DNS zone by id in a private cloud workload network. + /// Delete a WorkloadNetworkSegment /// /// /// The name of the resource group. The name is case insensitive. @@ -8251,11 +8995,8 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// - /// - /// NSX DNS Zone + /// + /// The ID of the NSX Segment /// /// /// Headers that will be added to request. @@ -8263,12 +9004,9 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// 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 /// @@ -8278,17 +9016,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteSegmentWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string segmentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -8306,28 +9044,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); - } - if (dnsZoneId == null) + if (segmentId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dnsZoneId"); + throw new ValidationException(ValidationRules.CannotBeNull, "segmentId"); } - if (workloadNetworkDnsZone == null) + if (segmentId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkDnsZone"); + if (!System.Text.RegularExpressions.Regex.IsMatch(segmentId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "segmentId", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -8338,18 +9075,17 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("dnsZoneId", dnsZoneId); - tracingParameters.Add("workloadNetworkDnsZone", workloadNetworkDnsZone); + tracingParameters.Add("segmentId", segmentId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateDnsZone", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSegment", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{dnsZoneId}", System.Uri.EscapeDataString(dnsZoneId)); + _url = _url.Replace("{segmentId}", System.Uri.EscapeDataString(segmentId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -8362,7 +9098,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8393,12 +9129,6 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkDnsZone != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkDnsZone, 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) { @@ -8419,16 +9149,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -8438,10 +9167,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -8454,48 +9179,25 @@ internal WorkloadNetworksOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _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) + try { - _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.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } - // Deserialize Response - if ((int)_statusCode == 201) + catch (JsonException ex) { - _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) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -8505,7 +9207,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create or update a DNS zone by id in a private cloud workload network. + /// Create a WorkloadNetworkVMGroup /// /// /// The name of the resource group. The name is case insensitive. @@ -8513,11 +9215,11 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// + /// ID of the VM group. /// - /// - /// NSX DNS Zone + /// + /// Resource create parameters. /// /// /// Headers that will be added to request. @@ -8525,7 +9227,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -8540,17 +9242,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateDnsZoneWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -8568,28 +9270,31 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (privateCloudName == null) + if (vmGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "vmGroupId"); } - if (dnsZoneId == null) + if (vmGroupId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dnsZoneId"); + if (!System.Text.RegularExpressions.Regex.IsMatch(vmGroupId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "vmGroupId", "^[-\\w\\._]+$"); + } } - if (workloadNetworkDnsZone == null) + if (workloadNetworkVMGroup == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkDnsZone"); + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkVMGroup"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -8600,18 +9305,18 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("dnsZoneId", dnsZoneId); - tracingParameters.Add("workloadNetworkDnsZone", workloadNetworkDnsZone); + tracingParameters.Add("vmGroupId", vmGroupId); + tracingParameters.Add("workloadNetworkVMGroup", workloadNetworkVMGroup); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateDnsZone", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateVMGroup", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{dnsZoneId}", System.Uri.EscapeDataString(dnsZoneId)); + _url = _url.Replace("{vmGroupId}", System.Uri.EscapeDataString(vmGroupId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -8624,7 +9329,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8655,9 +9360,9 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkDnsZone != null) + if(workloadNetworkVMGroup != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkDnsZone, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkVMGroup, 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"); } @@ -8681,16 +9386,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -8700,10 +9404,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -8716,7 +9416,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -8729,7 +9429,25 @@ internal WorkloadNetworksOperations(AvsClient 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) + { + _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) { @@ -8741,6 +9459,19 @@ internal WorkloadNetworksOperations(AvsClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -8749,26 +9480,32 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Delete a DNS zone by id in a private cloud workload network. + /// Update a WorkloadNetworkVMGroup /// /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// /// /// Name of the private cloud /// + /// + /// ID of the VM group. + /// + /// + /// The resource properties to be updated. + /// /// /// 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 /// @@ -8778,17 +9515,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteDnsZoneWithHttpMessagesAsync(string resourceGroupName, string dnsZoneId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateVMGroupWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroupUpdate workloadNetworkVMGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -8806,24 +9543,31 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (privateCloudName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (Client.ApiVersion != null) + if (privateCloudName != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); } } - if (dnsZoneId == null) + if (vmGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dnsZoneId"); + throw new ValidationException(ValidationRules.CannotBeNull, "vmGroupId"); } - if (privateCloudName == null) + if (vmGroupId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + if (!System.Text.RegularExpressions.Regex.IsMatch(vmGroupId, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "vmGroupId", "^[-\\w\\._]+$"); + } + } + if (workloadNetworkVMGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkVMGroup"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -8833,18 +9577,19 @@ internal WorkloadNetworksOperations(AvsClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("dnsZoneId", dnsZoneId); tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("vmGroupId", vmGroupId); + tracingParameters.Add("workloadNetworkVMGroup", workloadNetworkVMGroup); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteDnsZone", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateVMGroup", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{dnsZoneId}", System.Uri.EscapeDataString(dnsZoneId)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + _url = _url.Replace("{vmGroupId}", System.Uri.EscapeDataString(vmGroupId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -8857,7 +9602,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -8888,6 +9633,12 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; + if(workloadNetworkVMGroup != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkVMGroup, 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) { @@ -8908,16 +9659,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -8927,10 +9677,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -8943,13 +9689,44 @@ internal WorkloadNetworksOperations(AvsClient 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); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -8958,33 +9735,26 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Create a Public IP Block by id in a private cloud workload network. + /// Delete a WorkloadNetworkVMGroup /// /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the VM group. + /// /// /// Name of the private cloud /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name - /// - /// - /// NSX Public IP Block - /// /// /// 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 /// @@ -8994,17 +9764,17 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreatePublicIPWithHttpMessagesAsync(string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteVMGroupWithHttpMessagesAsync(string resourceGroupName, string vmGroupId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId != null) + if (Client.ApiVersion != null) { - if (Client.SubscriptionId.Length < 1) + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } if (resourceGroupName == null) @@ -9022,28 +9792,27 @@ internal WorkloadNetworksOperations(AvsClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.ApiVersion == null) + if (vmGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "vmGroupId"); } - if (Client.ApiVersion != null) + if (vmGroupId != null) { - if (Client.ApiVersion.Length < 1) + if (!System.Text.RegularExpressions.Regex.IsMatch(vmGroupId, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "vmGroupId", "^[-\\w\\._]+$"); } } if (privateCloudName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); } - if (publicIPId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIPId"); - } - if (workloadNetworkPublicIP == null) + if (privateCloudName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workloadNetworkPublicIP"); + if (!System.Text.RegularExpressions.Regex.IsMatch(privateCloudName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "privateCloudName", "^[-\\w\\._]+$"); + } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -9053,19 +9822,18 @@ internal WorkloadNetworksOperations(AvsClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vmGroupId", vmGroupId); tracingParameters.Add("privateCloudName", privateCloudName); - tracingParameters.Add("publicIPId", publicIPId); - tracingParameters.Add("workloadNetworkPublicIP", workloadNetworkPublicIP); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreatePublicIP", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteVMGroup", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(Client.SubscriptionId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vmGroupId}", System.Uri.EscapeDataString(vmGroupId)); _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); - _url = _url.Replace("{publicIPId}", System.Uri.EscapeDataString(publicIPId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -9078,7 +9846,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -9109,12 +9877,6 @@ internal WorkloadNetworksOperations(AvsClient client) // Serialize Request string _requestContent = null; - if(workloadNetworkPublicIP != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workloadNetworkPublicIP, 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) { @@ -9135,16 +9897,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -9154,10 +9915,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -9170,48 +9927,25 @@ internal WorkloadNetworksOperations(AvsClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _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) + try { - _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.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } - // Deserialize Response - if ((int)_statusCode == 201) + catch (JsonException ex) { - _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) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -9221,17 +9955,10 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// Delete a Public IP Block by id in a private cloud workload network. + /// List WorkloadNetwork resources by PrivateCloud /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name - /// - /// - /// Name of the private cloud + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -9239,9 +9966,12 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// 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 /// @@ -9251,52 +9981,11 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeletePublicIPWithHttpMessagesAsync(string resourceGroupName, string publicIPId, string privateCloudName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.SubscriptionId != null) - { - if (Client.SubscriptionId.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) - { - if (Client.ApiVersion.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); - } - } - if (publicIPId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIPId"); - } - if (privateCloudName == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "privateCloudName"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -9305,24 +9994,14 @@ internal WorkloadNetworksOperations(AvsClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("publicIPId", publicIPId); - tracingParameters.Add("privateCloudName", privateCloudName); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeletePublicIP", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{publicIPId}", System.Uri.EscapeDataString(publicIPId)); - _url = _url.Replace("{privateCloudName}", System.Uri.EscapeDataString(privateCloudName)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -9330,7 +10009,7 @@ internal WorkloadNetworksOperations(AvsClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -9381,16 +10060,15 @@ internal WorkloadNetworksOperations(AvsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -9400,10 +10078,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -9416,13 +10090,31 @@ internal WorkloadNetworksOperations(AvsClient 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); @@ -9431,7 +10123,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// List of segments in a private cloud workload network. + /// List WorkloadNetworkDhcp resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -9442,7 +10134,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -9457,7 +10149,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSegmentsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDhcpNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -9472,7 +10164,7 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSegmentsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDhcpNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -9538,14 +10230,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -9555,10 +10246,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -9571,7 +10258,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -9584,7 +10271,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -9604,7 +10291,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// List dhcp in a private cloud workload network. + /// List WorkloadNetworkDnsService resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -9615,7 +10302,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -9630,7 +10317,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDhcpNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDnsServicesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -9645,7 +10332,7 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDhcpNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDnsServicesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -9711,14 +10398,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -9728,10 +10414,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -9744,7 +10426,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -9757,7 +10439,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -9777,7 +10459,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// List of gateways in a private cloud workload network. + /// List WorkloadNetworkDnsZone resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -9788,7 +10470,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -9803,7 +10485,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListGatewaysNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListDnsZonesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -9818,7 +10500,7 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListGatewaysNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListDnsZonesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -9884,14 +10566,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -9901,10 +10582,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -9917,7 +10594,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -9930,7 +10607,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -9950,7 +10627,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// List of port mirroring profiles in a private cloud workload network. + /// List WorkloadNetworkGateway resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -9961,7 +10638,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -9976,7 +10653,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPortMirroringNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListGatewaysNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -9991,7 +10668,7 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPortMirroringNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListGatewaysNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -10057,14 +10734,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -10074,10 +10750,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -10090,7 +10762,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -10103,7 +10775,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -10123,7 +10795,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// List of vm groups in a private cloud workload network. + /// List WorkloadNetworkPortMirroring resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -10134,7 +10806,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -10149,7 +10821,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVMGroupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPortMirroringNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -10164,7 +10836,7 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVMGroupsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPortMirroringNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -10230,14 +10902,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -10247,10 +10918,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -10263,7 +10930,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -10276,7 +10943,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -10296,7 +10963,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// List of virtual machines in a private cloud workload network. + /// List WorkloadNetworkPublicIP resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -10307,7 +10974,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -10322,7 +10989,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachinesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListPublicIPsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -10337,7 +11004,7 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachinesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPublicIPsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -10403,14 +11070,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -10420,10 +11086,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -10436,7 +11098,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -10449,7 +11111,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -10469,7 +11131,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// List of DNS services in a private cloud workload network. + /// List WorkloadNetworkSegment resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -10480,7 +11142,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -10495,7 +11157,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDnsServicesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSegmentsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -10510,7 +11172,7 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDnsServicesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSegmentsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -10576,14 +11238,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -10593,10 +11254,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -10609,7 +11266,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -10622,7 +11279,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -10642,7 +11299,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// List of DNS zones in a private cloud workload network. + /// List WorkloadNetworkVirtualMachine resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -10653,7 +11310,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -10668,7 +11325,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListDnsZonesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVirtualMachinesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -10683,7 +11340,7 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDnsZonesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachinesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -10749,14 +11406,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -10766,10 +11422,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -10782,7 +11434,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -10795,7 +11447,7 @@ internal WorkloadNetworksOperations(AvsClient 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) { @@ -10815,7 +11467,7 @@ internal WorkloadNetworksOperations(AvsClient client) } /// - /// List of Public IP Blocks in a private cloud workload network. + /// List WorkloadNetworkVMGroup resources by WorkloadNetwork /// /// /// The NextLink from the previous successful call to List operation. @@ -10826,7 +11478,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -10841,7 +11493,7 @@ internal WorkloadNetworksOperations(AvsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListPublicIPsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVMGroupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -10856,7 +11508,7 @@ internal WorkloadNetworksOperations(AvsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPublicIPsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVMGroupsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -10922,14 +11574,13 @@ internal WorkloadNetworksOperations(AvsClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -10939,10 +11590,6 @@ internal WorkloadNetworksOperations(AvsClient client) } 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); @@ -10955,7 +11602,7 @@ internal WorkloadNetworksOperations(AvsClient 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")) @@ -10968,7 +11615,7 @@ internal WorkloadNetworksOperations(AvsClient 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/avs/Microsoft.Azure.Management.Avs/src/Generated/WorkloadNetworksOperationsExtensions.cs b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/WorkloadNetworksOperationsExtensions.cs index 1c8a096ffa11c..797f6968d0199 100644 --- a/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/WorkloadNetworksOperationsExtensions.cs +++ b/sdk/avs/Microsoft.Azure.Management.Avs/src/Generated/WorkloadNetworksOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Avs public static partial class WorkloadNetworksOperationsExtensions { /// - /// List of segments in a private cloud workload network. + /// List WorkloadNetwork resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -33,13 +33,13 @@ public static partial class WorkloadNetworksOperationsExtensions /// /// Name of the private cloud /// - public static IPage ListSegments(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) + public static IPage List(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) { - return operations.ListSegmentsAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// List of segments in a private cloud workload network. + /// List WorkloadNetwork resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -53,16 +53,16 @@ public static IPage ListSegments(this IWorkloadNetworksO /// /// The cancellation token. /// - public static async Task> ListSegmentsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get a segment by id in a private cloud workload network. + /// Get a WorkloadNetwork /// /// /// The operations group for this extension method. @@ -73,16 +73,13 @@ public static IPage ListSegments(this IWorkloadNetworksO /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name - /// - public static WorkloadNetworkSegment GetSegment(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId) + public static WorkloadNetwork Get(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) { - return operations.GetSegmentAsync(resourceGroupName, privateCloudName, segmentId).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// Get a segment by id in a private cloud workload network. + /// Get a WorkloadNetwork /// /// /// The operations group for this extension method. @@ -93,22 +90,19 @@ public static WorkloadNetworkSegment GetSegment(this IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name - /// /// /// The cancellation token. /// - public static async Task GetSegmentAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetSegmentWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create a segment by id in a private cloud workload network. + /// List WorkloadNetworkDhcp resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -119,19 +113,13 @@ public static WorkloadNetworkSegment GetSegment(this IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name - /// - /// - /// NSX Segment - /// - public static WorkloadNetworkSegment CreateSegments(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment) + public static IPage ListDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) { - return operations.CreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).GetAwaiter().GetResult(); + return operations.ListDhcpAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// Create a segment by id in a private cloud workload network. + /// List WorkloadNetworkDhcp resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -142,25 +130,19 @@ public static WorkloadNetworkSegment CreateSegments(this IWorkloadNetworksOperat /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name - /// - /// - /// NSX Segment - /// /// /// The cancellation token. /// - public static async Task CreateSegmentsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update a segment by id in a private cloud workload network. + /// Get a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -168,22 +150,19 @@ public static WorkloadNetworkSegment CreateSegments(this IWorkloadNetworksOperat /// /// The name of the resource group. The name is case insensitive. /// + /// + /// The ID of the DHCP configuration + /// /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name - /// - /// - /// NSX Segment - /// - public static WorkloadNetworkSegment UpdateSegments(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment) + public static WorkloadNetworkDhcp GetDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string dhcpId, string privateCloudName) { - return operations.UpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).GetAwaiter().GetResult(); + return operations.GetDhcpAsync(resourceGroupName, dhcpId, privateCloudName).GetAwaiter().GetResult(); } /// - /// Create or update a segment by id in a private cloud workload network. + /// Get a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -191,28 +170,25 @@ public static WorkloadNetworkSegment UpdateSegments(this IWorkloadNetworksOperat /// /// The name of the resource group. The name is case insensitive. /// + /// + /// The ID of the DHCP configuration + /// /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name - /// - /// - /// NSX Segment - /// /// /// The cancellation token. /// - public static async Task UpdateSegmentsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string dhcpId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetDhcpWithHttpMessagesAsync(resourceGroupName, dhcpId, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete a segment by id in a private cloud workload network. + /// Create a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -223,16 +199,19 @@ public static WorkloadNetworkSegment UpdateSegments(this IWorkloadNetworksOperat /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name + /// + /// The ID of the DHCP configuration /// - public static void DeleteSegment(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId) + /// + /// Resource create parameters. + /// + public static WorkloadNetworkDhcp CreateDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp) { - operations.DeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).GetAwaiter().GetResult(); + return operations.CreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).GetAwaiter().GetResult(); } /// - /// Delete a segment by id in a private cloud workload network. + /// Create a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -243,19 +222,25 @@ public static void DeleteSegment(this IWorkloadNetworksOperations operations, st /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name + /// + /// The ID of the DHCP configuration + /// + /// + /// Resource create parameters. /// /// /// The cancellation token. /// - public static async Task DeleteSegmentAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteSegmentWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreateDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// List dhcp in a private cloud workload network. + /// Update a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -266,13 +251,19 @@ public static void DeleteSegment(this IWorkloadNetworksOperations operations, st /// /// Name of the private cloud /// - public static IPage ListDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) + /// + /// The ID of the DHCP configuration + /// + /// + /// The resource properties to be updated. + /// + public static WorkloadNetworkDhcp UpdateDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcpUpdate workloadNetworkDhcp) { - return operations.ListDhcpAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.UpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).GetAwaiter().GetResult(); } /// - /// List dhcp in a private cloud workload network. + /// Update a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -283,19 +274,25 @@ public static IPage ListDhcp(this IWorkloadNetworksOperatio /// /// Name of the private cloud /// + /// + /// The ID of the DHCP configuration + /// + /// + /// The resource properties to be updated. + /// /// /// The cancellation token. /// - public static async Task> ListDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcpUpdate workloadNetworkDhcp, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get dhcp by id in a private cloud workload network. + /// Delete a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -303,19 +300,19 @@ public static IPage ListDhcp(this IWorkloadNetworksOperatio /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// /// /// Name of the private cloud /// - public static WorkloadNetworkDhcp GetDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string dhcpId, string privateCloudName) + /// + /// The ID of the DHCP configuration + /// + public static WorkloadNetworksDeleteDhcpHeaders DeleteDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId) { - return operations.GetDhcpAsync(resourceGroupName, dhcpId, privateCloudName).GetAwaiter().GetResult(); + return operations.DeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).GetAwaiter().GetResult(); } /// - /// Get dhcp by id in a private cloud workload network. + /// Delete a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -323,25 +320,25 @@ public static WorkloadNetworkDhcp GetDhcp(this IWorkloadNetworksOperations opera /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// /// /// Name of the private cloud /// + /// + /// The ID of the DHCP configuration + /// /// /// The cancellation token. /// - public static async Task GetDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string dhcpId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetDhcpWithHttpMessagesAsync(resourceGroupName, dhcpId, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Create dhcp by id in a private cloud workload network. + /// List WorkloadNetworkDnsService resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -352,19 +349,13 @@ public static WorkloadNetworkDhcp GetDhcp(this IWorkloadNetworksOperations opera /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// - /// - /// NSX DHCP - /// - public static WorkloadNetworkDhcp CreateDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp) + public static IPage ListDnsServices(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) { - return operations.CreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).GetAwaiter().GetResult(); + return operations.ListDnsServicesAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// Create dhcp by id in a private cloud workload network. + /// List WorkloadNetworkDnsService resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -375,25 +366,19 @@ public static WorkloadNetworkDhcp CreateDhcp(this IWorkloadNetworksOperations op /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// - /// - /// NSX DHCP - /// /// /// The cancellation token. /// - public static async Task CreateDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListDnsServicesAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListDnsServicesWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update dhcp by id in a private cloud workload network. + /// Get a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -404,19 +389,16 @@ public static WorkloadNetworkDhcp CreateDhcp(this IWorkloadNetworksOperations op /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// - /// - /// NSX DHCP + /// + /// ID of the DNS service. /// - public static WorkloadNetworkDhcp UpdateDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp) + public static WorkloadNetworkDnsService GetDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId) { - return operations.UpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).GetAwaiter().GetResult(); + return operations.GetDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId).GetAwaiter().GetResult(); } /// - /// Create or update dhcp by id in a private cloud workload network. + /// Get a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -427,25 +409,22 @@ public static WorkloadNetworkDhcp UpdateDhcp(this IWorkloadNetworksOperations op /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// - /// - /// NSX DHCP + /// + /// ID of the DNS service. /// /// /// The cancellation token. /// - public static async Task UpdateDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete dhcp by id in a private cloud workload network. + /// Create a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -456,16 +435,19 @@ public static WorkloadNetworkDhcp UpdateDhcp(this IWorkloadNetworksOperations op /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// + /// ID of the DNS service. /// - public static void DeleteDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId) + /// + /// Resource create parameters. + /// + public static WorkloadNetworkDnsService CreateDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService) { - operations.DeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).GetAwaiter().GetResult(); + return operations.CreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService).GetAwaiter().GetResult(); } /// - /// Delete dhcp by id in a private cloud workload network. + /// Create a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -476,19 +458,25 @@ public static void DeleteDhcp(this IWorkloadNetworksOperations operations, strin /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// + /// ID of the DNS service. + /// + /// + /// Resource create parameters. /// /// /// The cancellation token. /// - public static async Task DeleteDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreateDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// List of gateways in a private cloud workload network. + /// Update a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -499,13 +487,19 @@ public static void DeleteDhcp(this IWorkloadNetworksOperations operations, strin /// /// Name of the private cloud /// - public static IPage ListGateways(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) + /// + /// ID of the DNS service. + /// + /// + /// The resource properties to be updated. + /// + public static WorkloadNetworkDnsService UpdateDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsServiceUpdate workloadNetworkDnsService) { - return operations.ListGatewaysAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.UpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService).GetAwaiter().GetResult(); } /// - /// List of gateways in a private cloud workload network. + /// Update a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -516,19 +510,25 @@ public static IPage ListGateways(this IWorkloadNetworksO /// /// Name of the private cloud /// + /// + /// ID of the DNS service. + /// + /// + /// The resource properties to be updated. + /// /// /// The cancellation token. /// - public static async Task> ListGatewaysAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsServiceUpdate workloadNetworkDnsService, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListGatewaysWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get a gateway by id in a private cloud workload network. + /// Delete a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -536,19 +536,19 @@ public static IPage ListGateways(this IWorkloadNetworksO /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS service. + /// /// /// Name of the private cloud /// - /// - /// NSX Gateway identifier. Generally the same as the Gateway's display name - /// - public static WorkloadNetworkGateway GetGateway(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string gatewayId) + public static WorkloadNetworksDeleteDnsServiceHeaders DeleteDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsServiceId, string privateCloudName) { - return operations.GetGatewayAsync(resourceGroupName, privateCloudName, gatewayId).GetAwaiter().GetResult(); + return operations.DeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).GetAwaiter().GetResult(); } /// - /// Get a gateway by id in a private cloud workload network. + /// Delete a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -556,25 +556,25 @@ public static WorkloadNetworkGateway GetGateway(this IWorkloadNetworksOperations /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS service. + /// /// /// Name of the private cloud /// - /// - /// NSX Gateway identifier. Generally the same as the Gateway's display name - /// /// /// The cancellation token. /// - public static async Task GetGatewayAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string gatewayId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsServiceId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetGatewayWithHttpMessagesAsync(resourceGroupName, privateCloudName, gatewayId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteDnsServiceWithHttpMessagesAsync(resourceGroupName, dnsServiceId, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// List of port mirroring profiles in a private cloud workload network. + /// List WorkloadNetworkDnsZone resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -585,13 +585,13 @@ public static WorkloadNetworkGateway GetGateway(this IWorkloadNetworksOperations /// /// Name of the private cloud /// - public static IPage ListPortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) + public static IPage ListDnsZones(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) { - return operations.ListPortMirroringAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.ListDnsZonesAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// List of port mirroring profiles in a private cloud workload network. + /// List WorkloadNetworkDnsZone resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -605,16 +605,16 @@ public static IPage ListPortMirroring(this IWorklo /// /// The cancellation token. /// - public static async Task> ListPortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListDnsZonesAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListPortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListDnsZonesWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get a port mirroring profile by id in a private cloud workload network. + /// Get a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -625,17 +625,16 @@ public static IPage ListPortMirroring(this IWorklo /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// - public static WorkloadNetworkPortMirroring GetPortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId) + public static WorkloadNetworkDnsZone GetDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId) { - return operations.GetPortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId).GetAwaiter().GetResult(); + return operations.GetDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId).GetAwaiter().GetResult(); } /// - /// Get a port mirroring profile by id in a private cloud workload network. + /// Get a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -646,23 +645,22 @@ public static WorkloadNetworkPortMirroring GetPortMirroring(this IWorkloadNetwor /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// /// /// The cancellation token. /// - public static async Task GetPortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create a port mirroring profile by id in a private cloud workload network. + /// Create a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -673,20 +671,19 @@ public static WorkloadNetworkPortMirroring GetPortMirroring(this IWorkloadNetwor /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// Resource create parameters. /// - public static WorkloadNetworkPortMirroring CreatePortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring) + public static WorkloadNetworkDnsZone CreateDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone) { - return operations.CreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).GetAwaiter().GetResult(); + return operations.CreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).GetAwaiter().GetResult(); } /// - /// Create a port mirroring profile by id in a private cloud workload network. + /// Create a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -697,27 +694,25 @@ public static WorkloadNetworkPortMirroring CreatePortMirroring(this IWorkloadNet /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// Resource create parameters. /// /// /// The cancellation token. /// - public static async Task CreatePortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreatePortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update a port mirroring profile by id in a private cloud workload - /// network. + /// Update a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -728,21 +723,19 @@ public static WorkloadNetworkPortMirroring CreatePortMirroring(this IWorkloadNet /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// The resource properties to be updated. /// - public static WorkloadNetworkPortMirroring UpdatePortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring) + public static WorkloadNetworkDnsZone UpdateDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZoneUpdate workloadNetworkDnsZone) { - return operations.UpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).GetAwaiter().GetResult(); + return operations.UpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).GetAwaiter().GetResult(); } /// - /// Create or update a port mirroring profile by id in a private cloud workload - /// network. + /// Update a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -753,26 +746,25 @@ public static WorkloadNetworkPortMirroring UpdatePortMirroring(this IWorkloadNet /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// The resource properties to be updated. /// /// /// The cancellation token. /// - public static async Task UpdatePortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZoneUpdate workloadNetworkDnsZone, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdatePortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete a port mirroring profile by id in a private cloud workload network. + /// Delete a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -780,20 +772,19 @@ public static WorkloadNetworkPortMirroring UpdatePortMirroring(this IWorkloadNet /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// /// /// Name of the private cloud /// - public static void DeletePortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string portMirroringId, string privateCloudName) + public static WorkloadNetworksDeleteDnsZoneHeaders DeleteDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsZoneId, string privateCloudName) { - operations.DeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).GetAwaiter().GetResult(); + return operations.DeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).GetAwaiter().GetResult(); } /// - /// Delete a port mirroring profile by id in a private cloud workload network. + /// Delete a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -801,9 +792,8 @@ public static void DeletePortMirroring(this IWorkloadNetworksOperations operatio /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// /// /// Name of the private cloud @@ -811,13 +801,16 @@ public static void DeletePortMirroring(this IWorkloadNetworksOperations operatio /// /// The cancellation token. /// - public static async Task DeletePortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string portMirroringId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsZoneId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeletePortMirroringWithHttpMessagesAsync(resourceGroupName, portMirroringId, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteDnsZoneWithHttpMessagesAsync(resourceGroupName, dnsZoneId, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List of vm groups in a private cloud workload network. + /// List WorkloadNetworkGateway resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -828,13 +821,13 @@ public static void DeletePortMirroring(this IWorkloadNetworksOperations operatio /// /// Name of the private cloud /// - public static IPage ListVMGroups(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) + public static IPage ListGateways(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) { - return operations.ListVMGroupsAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.ListGatewaysAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// List of vm groups in a private cloud workload network. + /// List WorkloadNetworkGateway resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -848,16 +841,16 @@ public static IPage ListVMGroups(this IWorkloadNetworksO /// /// The cancellation token. /// - public static async Task> ListVMGroupsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListGatewaysAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListVMGroupsWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListGatewaysWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get a vm group by id in a private cloud workload network. + /// Get a WorkloadNetworkGateway /// /// /// The operations group for this extension method. @@ -868,16 +861,16 @@ public static IPage ListVMGroups(this IWorkloadNetworksO /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// + /// The ID of the NSX Gateway /// - public static WorkloadNetworkVMGroup GetVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId) + public static WorkloadNetworkGateway GetGateway(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string gatewayId) { - return operations.GetVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId).GetAwaiter().GetResult(); + return operations.GetGatewayAsync(resourceGroupName, privateCloudName, gatewayId).GetAwaiter().GetResult(); } /// - /// Get a vm group by id in a private cloud workload network. + /// Get a WorkloadNetworkGateway /// /// /// The operations group for this extension method. @@ -888,22 +881,22 @@ public static WorkloadNetworkVMGroup GetVMGroup(this IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// + /// The ID of the NSX Gateway /// /// /// The cancellation token. /// - public static async Task GetVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetGatewayAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string gatewayId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetGatewayWithHttpMessagesAsync(resourceGroupName, privateCloudName, gatewayId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create a vm group by id in a private cloud workload network. + /// List WorkloadNetworkPortMirroring resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -914,19 +907,13 @@ public static WorkloadNetworkVMGroup GetVMGroup(this IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// - /// - /// NSX VM Group - /// - public static WorkloadNetworkVMGroup CreateVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup) + public static IPage ListPortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) { - return operations.CreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).GetAwaiter().GetResult(); + return operations.ListPortMirroringAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// Create a vm group by id in a private cloud workload network. + /// List WorkloadNetworkPortMirroring resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -937,25 +924,19 @@ public static WorkloadNetworkVMGroup CreateVMGroup(this IWorkloadNetworksOperati /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// - /// - /// NSX VM Group - /// /// /// The cancellation token. /// - public static async Task CreateVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListPortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListPortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update a vm group by id in a private cloud workload network. + /// Get a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -966,19 +947,16 @@ public static WorkloadNetworkVMGroup CreateVMGroup(this IWorkloadNetworksOperati /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// - /// - /// NSX VM Group + /// + /// ID of the NSX port mirroring profile. /// - public static WorkloadNetworkVMGroup UpdateVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup) + public static WorkloadNetworkPortMirroring GetPortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId) { - return operations.UpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).GetAwaiter().GetResult(); + return operations.GetPortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId).GetAwaiter().GetResult(); } /// - /// Create or update a vm group by id in a private cloud workload network. + /// Get a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -989,25 +967,22 @@ public static WorkloadNetworkVMGroup UpdateVMGroup(this IWorkloadNetworksOperati /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// - /// - /// NSX VM Group + /// + /// ID of the NSX port mirroring profile. /// /// /// The cancellation token. /// - public static async Task UpdateVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetPortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete a vm group by id in a private cloud workload network. + /// Create a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -1015,19 +990,22 @@ public static WorkloadNetworkVMGroup UpdateVMGroup(this IWorkloadNetworksOperati /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// /// /// Name of the private cloud /// - public static void DeleteVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string vmGroupId, string privateCloudName) + /// + /// ID of the NSX port mirroring profile. + /// + /// + /// Resource create parameters. + /// + public static WorkloadNetworkPortMirroring CreatePortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring) { - operations.DeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).GetAwaiter().GetResult(); + return operations.CreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).GetAwaiter().GetResult(); } /// - /// Delete a vm group by id in a private cloud workload network. + /// Create a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -1035,22 +1013,28 @@ public static void DeleteVMGroup(this IWorkloadNetworksOperations operations, st /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// /// /// Name of the private cloud /// + /// + /// ID of the NSX port mirroring profile. + /// + /// + /// Resource create parameters. + /// /// /// The cancellation token. /// - public static async Task DeleteVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string vmGroupId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreatePortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteVMGroupWithHttpMessagesAsync(resourceGroupName, vmGroupId, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreatePortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// List of virtual machines in a private cloud workload network. + /// Update a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -1061,13 +1045,19 @@ public static void DeleteVMGroup(this IWorkloadNetworksOperations operations, st /// /// Name of the private cloud /// - public static IPage ListVirtualMachines(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) + /// + /// ID of the NSX port mirroring profile. + /// + /// + /// The resource properties to be updated. + /// + public static WorkloadNetworkPortMirroring UpdatePortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroringUpdate workloadNetworkPortMirroring) { - return operations.ListVirtualMachinesAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.UpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).GetAwaiter().GetResult(); } /// - /// List of virtual machines in a private cloud workload network. + /// Update a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -1078,19 +1068,25 @@ public static IPage ListVirtualMachines(this IWor /// /// Name of the private cloud /// + /// + /// ID of the NSX port mirroring profile. + /// + /// + /// The resource properties to be updated. + /// /// /// The cancellation token. /// - public static async Task> ListVirtualMachinesAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdatePortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroringUpdate workloadNetworkPortMirroring, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListVirtualMachinesWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdatePortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get a virtual machine by id in a private cloud workload network. + /// Delete a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -1098,19 +1094,19 @@ public static IPage ListVirtualMachines(this IWor /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the NSX port mirroring profile. + /// /// /// Name of the private cloud /// - /// - /// Virtual Machine identifier - /// - public static WorkloadNetworkVirtualMachine GetVirtualMachine(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string virtualMachineId) + public static WorkloadNetworksDeletePortMirroringHeaders DeletePortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string portMirroringId, string privateCloudName) { - return operations.GetVirtualMachineAsync(resourceGroupName, privateCloudName, virtualMachineId).GetAwaiter().GetResult(); + return operations.DeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).GetAwaiter().GetResult(); } /// - /// Get a virtual machine by id in a private cloud workload network. + /// Delete a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -1118,25 +1114,25 @@ public static WorkloadNetworkVirtualMachine GetVirtualMachine(this IWorkloadNetw /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the NSX port mirroring profile. + /// /// /// Name of the private cloud /// - /// - /// Virtual Machine identifier - /// /// /// The cancellation token. /// - public static async Task GetVirtualMachineAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string virtualMachineId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeletePortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string portMirroringId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetVirtualMachineWithHttpMessagesAsync(resourceGroupName, privateCloudName, virtualMachineId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeletePortMirroringWithHttpMessagesAsync(resourceGroupName, portMirroringId, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// List of DNS services in a private cloud workload network. + /// List WorkloadNetworkPublicIP resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -1147,13 +1143,13 @@ public static WorkloadNetworkVirtualMachine GetVirtualMachine(this IWorkloadNetw /// /// Name of the private cloud /// - public static IPage ListDnsServices(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) + public static IPage ListPublicIPs(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) { - return operations.ListDnsServicesAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.ListPublicIPsAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// List of DNS services in a private cloud workload network. + /// List WorkloadNetworkPublicIP resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -1167,16 +1163,16 @@ public static IPage ListDnsServices(this IWorkloadNet /// /// The cancellation token. /// - public static async Task> ListDnsServicesAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListPublicIPsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListDnsServicesWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListPublicIPsWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get a DNS service by id in a private cloud workload network. + /// Get a WorkloadNetworkPublicIP /// /// /// The operations group for this extension method. @@ -1187,17 +1183,16 @@ public static IPage ListDnsServices(this IWorkloadNet /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name + /// + /// ID of the DNS zone. /// - public static WorkloadNetworkDnsService GetDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId) + public static WorkloadNetworkPublicIP GetPublicIP(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string publicIPId) { - return operations.GetDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId).GetAwaiter().GetResult(); + return operations.GetPublicIPAsync(resourceGroupName, privateCloudName, publicIPId).GetAwaiter().GetResult(); } /// - /// Get a DNS service by id in a private cloud workload network. + /// Get a WorkloadNetworkPublicIP /// /// /// The operations group for this extension method. @@ -1208,23 +1203,22 @@ public static WorkloadNetworkDnsService GetDnsService(this IWorkloadNetworksOper /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name + /// + /// ID of the DNS zone. /// /// /// The cancellation token. /// - public static async Task GetDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetPublicIPAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string publicIPId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPublicIPWithHttpMessagesAsync(resourceGroupName, privateCloudName, publicIPId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create a DNS service by id in a private cloud workload network. + /// Create a WorkloadNetworkPublicIP /// /// /// The operations group for this extension method. @@ -1235,20 +1229,19 @@ public static WorkloadNetworkDnsService GetDnsService(this IWorkloadNetworksOper /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name + /// + /// ID of the DNS zone. /// - /// - /// NSX DNS Service + /// + /// Resource create parameters. /// - public static WorkloadNetworkDnsService CreateDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService) + public static WorkloadNetworkPublicIP CreatePublicIP(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP) { - return operations.CreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService).GetAwaiter().GetResult(); + return operations.CreatePublicIPAsync(resourceGroupName, privateCloudName, publicIPId, workloadNetworkPublicIP).GetAwaiter().GetResult(); } /// - /// Create a DNS service by id in a private cloud workload network. + /// Create a WorkloadNetworkPublicIP /// /// /// The operations group for this extension method. @@ -1259,26 +1252,25 @@ public static WorkloadNetworkDnsService CreateDnsService(this IWorkloadNetworksO /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name + /// + /// ID of the DNS zone. /// - /// - /// NSX DNS Service + /// + /// Resource create parameters. /// /// /// The cancellation token. /// - public static async Task CreateDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreatePublicIPAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreatePublicIPWithHttpMessagesAsync(resourceGroupName, privateCloudName, publicIPId, workloadNetworkPublicIP, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update a DNS service by id in a private cloud workload network. + /// Delete a WorkloadNetworkPublicIP /// /// /// The operations group for this extension method. @@ -1286,23 +1278,45 @@ public static WorkloadNetworkDnsService CreateDnsService(this IWorkloadNetworksO /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS zone. + /// /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name + public static WorkloadNetworksDeletePublicIPHeaders DeletePublicIP(this IWorkloadNetworksOperations operations, string resourceGroupName, string publicIPId, string privateCloudName) + { + return operations.DeletePublicIPAsync(resourceGroupName, publicIPId, privateCloudName).GetAwaiter().GetResult(); + } + + /// + /// Delete a WorkloadNetworkPublicIP + /// + /// + /// The operations group for this extension method. /// - /// - /// NSX DNS Service + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// ID of the DNS zone. + /// + /// + /// Name of the private cloud + /// + /// + /// The cancellation token. /// - public static WorkloadNetworkDnsService UpdateDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService) + public static async Task DeletePublicIPAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string publicIPId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - return operations.UpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService).GetAwaiter().GetResult(); + using (var _result = await operations.DeletePublicIPWithHttpMessagesAsync(resourceGroupName, publicIPId, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create or update a DNS service by id in a private cloud workload network. + /// List WorkloadNetworkSegment resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -1313,26 +1327,36 @@ public static WorkloadNetworkDnsService UpdateDnsService(this IWorkloadNetworksO /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name + public static IPage ListSegments(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) + { + return operations.ListSegmentsAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + } + + /// + /// List WorkloadNetworkSegment resources by WorkloadNetwork + /// + /// + /// The operations group for this extension method. /// - /// - /// NSX DNS Service + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud /// /// /// The cancellation token. /// - public static async Task UpdateDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListSegmentsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete a DNS service by id in a private cloud workload network. + /// Get a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -1340,20 +1364,19 @@ public static WorkloadNetworkDnsService UpdateDnsService(this IWorkloadNetworksO /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name - /// /// /// Name of the private cloud /// - public static void DeleteDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsServiceId, string privateCloudName) + /// + /// The ID of the NSX Segment + /// + public static WorkloadNetworkSegment GetSegment(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId) { - operations.DeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).GetAwaiter().GetResult(); + return operations.GetSegmentAsync(resourceGroupName, privateCloudName, segmentId).GetAwaiter().GetResult(); } /// - /// Delete a DNS service by id in a private cloud workload network. + /// Get a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -1361,23 +1384,25 @@ public static void DeleteDnsService(this IWorkloadNetworksOperations operations, /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name - /// /// /// Name of the private cloud /// + /// + /// The ID of the NSX Segment + /// /// /// The cancellation token. /// - public static async Task DeleteDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsServiceId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetSegmentAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteDnsServiceWithHttpMessagesAsync(resourceGroupName, dnsServiceId, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.GetSegmentWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// List of DNS zones in a private cloud workload network. + /// Create a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -1388,13 +1413,19 @@ public static void DeleteDnsService(this IWorkloadNetworksOperations operations, /// /// Name of the private cloud /// - public static IPage ListDnsZones(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) + /// + /// The ID of the NSX Segment + /// + /// + /// Resource create parameters. + /// + public static WorkloadNetworkSegment CreateSegments(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment) { - return operations.ListDnsZonesAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.CreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).GetAwaiter().GetResult(); } /// - /// List of DNS zones in a private cloud workload network. + /// Create a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -1405,19 +1436,25 @@ public static IPage ListDnsZones(this IWorkloadNetworksO /// /// Name of the private cloud /// + /// + /// The ID of the NSX Segment + /// + /// + /// Resource create parameters. + /// /// /// The cancellation token. /// - public static async Task> ListDnsZonesAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateSegmentsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListDnsZonesWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get a DNS zone by id in a private cloud workload network. + /// Update a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -1428,16 +1465,19 @@ public static IPage ListDnsZones(this IWorkloadNetworksO /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// + /// The ID of the NSX Segment /// - public static WorkloadNetworkDnsZone GetDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId) + /// + /// The resource properties to be updated. + /// + public static WorkloadNetworkSegment UpdateSegments(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegmentUpdate workloadNetworkSegment) { - return operations.GetDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId).GetAwaiter().GetResult(); + return operations.UpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).GetAwaiter().GetResult(); } /// - /// Get a DNS zone by id in a private cloud workload network. + /// Update a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -1448,22 +1488,25 @@ public static WorkloadNetworkDnsZone GetDnsZone(this IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// + /// The ID of the NSX Segment + /// + /// + /// The resource properties to be updated. /// /// /// The cancellation token. /// - public static async Task GetDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateSegmentsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegmentUpdate workloadNetworkSegment, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create a DNS zone by id in a private cloud workload network. + /// Delete a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -1474,19 +1517,42 @@ public static WorkloadNetworkDnsZone GetDnsZone(this IWorkloadNetworksOperations /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// + /// The ID of the NSX Segment /// - /// - /// NSX DNS Zone + public static WorkloadNetworksDeleteSegmentHeaders DeleteSegment(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId) + { + return operations.DeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).GetAwaiter().GetResult(); + } + + /// + /// Delete a WorkloadNetworkSegment + /// + /// + /// The operations group for this extension method. /// - public static WorkloadNetworkDnsZone CreateDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone) + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud + /// + /// + /// The ID of the NSX Segment + /// + /// + /// The cancellation token. + /// + public static async Task DeleteSegmentAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, CancellationToken cancellationToken = default(CancellationToken)) { - return operations.CreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).GetAwaiter().GetResult(); + using (var _result = await operations.DeleteSegmentWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create a DNS zone by id in a private cloud workload network. + /// List WorkloadNetworkVirtualMachine resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -1497,25 +1563,36 @@ public static WorkloadNetworkDnsZone CreateDnsZone(this IWorkloadNetworksOperati /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + public static IPage ListVirtualMachines(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) + { + return operations.ListVirtualMachinesAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + } + + /// + /// List WorkloadNetworkVirtualMachine resources by WorkloadNetwork + /// + /// + /// The operations group for this extension method. /// - /// - /// NSX DNS Zone + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the private cloud /// /// /// The cancellation token. /// - public static async Task CreateDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListVirtualMachinesAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListVirtualMachinesWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update a DNS zone by id in a private cloud workload network. + /// Get a WorkloadNetworkVirtualMachine /// /// /// The operations group for this extension method. @@ -1526,19 +1603,16 @@ public static WorkloadNetworkDnsZone CreateDnsZone(this IWorkloadNetworksOperati /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// - /// - /// NSX DNS Zone + /// + /// ID of the virtual machine. /// - public static WorkloadNetworkDnsZone UpdateDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone) + public static WorkloadNetworkVirtualMachine GetVirtualMachine(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string virtualMachineId) { - return operations.UpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).GetAwaiter().GetResult(); + return operations.GetVirtualMachineAsync(resourceGroupName, privateCloudName, virtualMachineId).GetAwaiter().GetResult(); } /// - /// Create or update a DNS zone by id in a private cloud workload network. + /// Get a WorkloadNetworkVirtualMachine /// /// /// The operations group for this extension method. @@ -1549,25 +1623,22 @@ public static WorkloadNetworkDnsZone UpdateDnsZone(this IWorkloadNetworksOperati /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// - /// - /// NSX DNS Zone + /// + /// ID of the virtual machine. /// /// /// The cancellation token. /// - public static async Task UpdateDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetVirtualMachineAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string virtualMachineId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetVirtualMachineWithHttpMessagesAsync(resourceGroupName, privateCloudName, virtualMachineId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete a DNS zone by id in a private cloud workload network. + /// List WorkloadNetworkVMGroup resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -1575,19 +1646,16 @@ public static WorkloadNetworkDnsZone UpdateDnsZone(this IWorkloadNetworksOperati /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// /// /// Name of the private cloud /// - public static void DeleteDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsZoneId, string privateCloudName) + public static IPage ListVMGroups(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) { - operations.DeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).GetAwaiter().GetResult(); + return operations.ListVMGroupsAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); } /// - /// Delete a DNS zone by id in a private cloud workload network. + /// List WorkloadNetworkVMGroup resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -1595,22 +1663,22 @@ public static void DeleteDnsZone(this IWorkloadNetworksOperations operations, st /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// /// /// Name of the private cloud /// /// /// The cancellation token. /// - public static async Task DeleteDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsZoneId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListVMGroupsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteDnsZoneWithHttpMessagesAsync(resourceGroupName, dnsZoneId, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListVMGroupsWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// List of Public IP Blocks in a private cloud workload network. + /// Get a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -1621,13 +1689,16 @@ public static void DeleteDnsZone(this IWorkloadNetworksOperations operations, st /// /// Name of the private cloud /// - public static IPage ListPublicIPs(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName) + /// + /// ID of the VM group. + /// + public static WorkloadNetworkVMGroup GetVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId) { - return operations.ListPublicIPsAsync(resourceGroupName, privateCloudName).GetAwaiter().GetResult(); + return operations.GetVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId).GetAwaiter().GetResult(); } /// - /// List of Public IP Blocks in a private cloud workload network. + /// Get a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -1638,19 +1709,22 @@ public static IPage ListPublicIPs(this IWorkloadNetwork /// /// Name of the private cloud /// + /// + /// ID of the VM group. + /// /// /// The cancellation token. /// - public static async Task> ListPublicIPsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListPublicIPsWithHttpMessagesAsync(resourceGroupName, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get a Public IP Block by id in a private cloud workload network. + /// Create a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -1661,17 +1735,19 @@ public static IPage ListPublicIPs(this IWorkloadNetwork /// /// Name of the private cloud /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name + /// + /// ID of the VM group. /// - public static WorkloadNetworkPublicIP GetPublicIP(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string publicIPId) + /// + /// Resource create parameters. + /// + public static WorkloadNetworkVMGroup CreateVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup) { - return operations.GetPublicIPAsync(resourceGroupName, privateCloudName, publicIPId).GetAwaiter().GetResult(); + return operations.CreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).GetAwaiter().GetResult(); } /// - /// Get a Public IP Block by id in a private cloud workload network. + /// Create a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -1682,23 +1758,25 @@ public static WorkloadNetworkPublicIP GetPublicIP(this IWorkloadNetworksOperatio /// /// Name of the private cloud /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name + /// + /// ID of the VM group. + /// + /// + /// Resource create parameters. /// /// /// The cancellation token. /// - public static async Task GetPublicIPAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string publicIPId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPublicIPWithHttpMessagesAsync(resourceGroupName, privateCloudName, publicIPId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create a Public IP Block by id in a private cloud workload network. + /// Update a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -1709,20 +1787,19 @@ public static WorkloadNetworkPublicIP GetPublicIP(this IWorkloadNetworksOperatio /// /// Name of the private cloud /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name + /// + /// ID of the VM group. /// - /// - /// NSX Public IP Block + /// + /// The resource properties to be updated. /// - public static WorkloadNetworkPublicIP CreatePublicIP(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP) + public static WorkloadNetworkVMGroup UpdateVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroupUpdate workloadNetworkVMGroup) { - return operations.CreatePublicIPAsync(resourceGroupName, privateCloudName, publicIPId, workloadNetworkPublicIP).GetAwaiter().GetResult(); + return operations.UpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).GetAwaiter().GetResult(); } /// - /// Create a Public IP Block by id in a private cloud workload network. + /// Update a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -1733,26 +1810,25 @@ public static WorkloadNetworkPublicIP CreatePublicIP(this IWorkloadNetworksOpera /// /// Name of the private cloud /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name + /// + /// ID of the VM group. /// - /// - /// NSX Public IP Block + /// + /// The resource properties to be updated. /// /// /// The cancellation token. /// - public static async Task CreatePublicIPAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroupUpdate workloadNetworkVMGroup, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreatePublicIPWithHttpMessagesAsync(resourceGroupName, privateCloudName, publicIPId, workloadNetworkPublicIP, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete a Public IP Block by id in a private cloud workload network. + /// Delete a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -1760,20 +1836,19 @@ public static WorkloadNetworkPublicIP CreatePublicIP(this IWorkloadNetworksOpera /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name + /// + /// ID of the VM group. /// /// /// Name of the private cloud /// - public static void DeletePublicIP(this IWorkloadNetworksOperations operations, string resourceGroupName, string publicIPId, string privateCloudName) + public static WorkloadNetworksDeleteVMGroupHeaders DeleteVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string vmGroupId, string privateCloudName) { - operations.DeletePublicIPAsync(resourceGroupName, publicIPId, privateCloudName).GetAwaiter().GetResult(); + return operations.DeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).GetAwaiter().GetResult(); } /// - /// Delete a Public IP Block by id in a private cloud workload network. + /// Delete a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -1781,9 +1856,8 @@ public static void DeletePublicIP(this IWorkloadNetworksOperations operations, s /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name + /// + /// ID of the VM group. /// /// /// Name of the private cloud @@ -1791,13 +1865,16 @@ public static void DeletePublicIP(this IWorkloadNetworksOperations operations, s /// /// The cancellation token. /// - public static async Task DeletePublicIPAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string publicIPId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string vmGroupId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeletePublicIPWithHttpMessagesAsync(resourceGroupName, publicIPId, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteVMGroupWithHttpMessagesAsync(resourceGroupName, vmGroupId, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create a segment by id in a private cloud workload network. + /// Create a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -1808,19 +1885,19 @@ public static void DeletePublicIP(this IWorkloadNetworksOperations operations, s /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name + /// + /// The ID of the DHCP configuration /// - /// - /// NSX Segment + /// + /// Resource create parameters. /// - public static WorkloadNetworkSegment BeginCreateSegments(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment) + public static WorkloadNetworkDhcp BeginCreateDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp) { - return operations.BeginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).GetAwaiter().GetResult(); + return operations.BeginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).GetAwaiter().GetResult(); } /// - /// Create a segment by id in a private cloud workload network. + /// Create a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -1831,25 +1908,25 @@ public static WorkloadNetworkSegment BeginCreateSegments(this IWorkloadNetworksO /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name + /// + /// The ID of the DHCP configuration /// - /// - /// NSX Segment + /// + /// Resource create parameters. /// /// /// The cancellation token. /// - public static async Task BeginCreateSegmentsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update a segment by id in a private cloud workload network. + /// Update a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -1860,19 +1937,19 @@ public static WorkloadNetworkSegment BeginCreateSegments(this IWorkloadNetworksO /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name + /// + /// The ID of the DHCP configuration /// - /// - /// NSX Segment + /// + /// The resource properties to be updated. /// - public static WorkloadNetworkSegment BeginUpdateSegments(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment) + public static WorkloadNetworkDhcp BeginUpdateDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcpUpdate workloadNetworkDhcp) { - return operations.BeginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).GetAwaiter().GetResult(); + return operations.BeginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).GetAwaiter().GetResult(); } /// - /// Create or update a segment by id in a private cloud workload network. + /// Update a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -1883,25 +1960,25 @@ public static WorkloadNetworkSegment BeginUpdateSegments(this IWorkloadNetworksO /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name + /// + /// The ID of the DHCP configuration /// - /// - /// NSX Segment + /// + /// The resource properties to be updated. /// /// /// The cancellation token. /// - public static async Task BeginUpdateSegmentsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcpUpdate workloadNetworkDhcp, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginUpdateSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete a segment by id in a private cloud workload network. + /// Delete a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -1912,16 +1989,16 @@ public static WorkloadNetworkSegment BeginUpdateSegments(this IWorkloadNetworksO /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name + /// + /// The ID of the DHCP configuration /// - public static void BeginDeleteSegment(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId) + public static WorkloadNetworksDeleteDhcpHeaders BeginDeleteDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId) { - operations.BeginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).GetAwaiter().GetResult(); + return operations.BeginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).GetAwaiter().GetResult(); } /// - /// Delete a segment by id in a private cloud workload network. + /// Delete a WorkloadNetworkDhcp /// /// /// The operations group for this extension method. @@ -1932,19 +2009,22 @@ public static void BeginDeleteSegment(this IWorkloadNetworksOperations operation /// /// Name of the private cloud /// - /// - /// NSX Segment identifier. Generally the same as the Segment's display name + /// + /// The ID of the DHCP configuration /// /// /// The cancellation token. /// - public static async Task BeginDeleteSegmentAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteSegmentWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create dhcp by id in a private cloud workload network. + /// Create a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -1955,19 +2035,19 @@ public static void BeginDeleteSegment(this IWorkloadNetworksOperations operation /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// + /// ID of the DNS service. /// - /// - /// NSX DHCP + /// + /// Resource create parameters. /// - public static WorkloadNetworkDhcp BeginCreateDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp) + public static WorkloadNetworkDnsService BeginCreateDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService) { - return operations.BeginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).GetAwaiter().GetResult(); + return operations.BeginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService).GetAwaiter().GetResult(); } /// - /// Create dhcp by id in a private cloud workload network. + /// Create a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -1978,25 +2058,25 @@ public static WorkloadNetworkDhcp BeginCreateDhcp(this IWorkloadNetworksOperatio /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// + /// ID of the DNS service. /// - /// - /// NSX DHCP + /// + /// Resource create parameters. /// /// /// The cancellation token. /// - public static async Task BeginCreateDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update dhcp by id in a private cloud workload network. + /// Update a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -2007,19 +2087,19 @@ public static WorkloadNetworkDhcp BeginCreateDhcp(this IWorkloadNetworksOperatio /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// + /// ID of the DNS service. /// - /// - /// NSX DHCP + /// + /// The resource properties to be updated. /// - public static WorkloadNetworkDhcp BeginUpdateDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp) + public static WorkloadNetworkDnsService BeginUpdateDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsServiceUpdate workloadNetworkDnsService) { - return operations.BeginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).GetAwaiter().GetResult(); + return operations.BeginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService).GetAwaiter().GetResult(); } /// - /// Create or update dhcp by id in a private cloud workload network. + /// Update a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -2030,25 +2110,25 @@ public static WorkloadNetworkDhcp BeginUpdateDhcp(this IWorkloadNetworksOperatio /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name + /// + /// ID of the DNS service. /// - /// - /// NSX DHCP + /// + /// The resource properties to be updated. /// /// /// The cancellation token. /// - public static async Task BeginUpdateDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, WorkloadNetworkDhcp workloadNetworkDhcp, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsServiceUpdate workloadNetworkDnsService, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginUpdateDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete dhcp by id in a private cloud workload network. + /// Delete a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -2056,19 +2136,19 @@ public static WorkloadNetworkDhcp BeginUpdateDhcp(this IWorkloadNetworksOperatio /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS service. + /// /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// - public static void BeginDeleteDhcp(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId) + public static WorkloadNetworksDeleteDnsServiceHeaders BeginDeleteDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsServiceId, string privateCloudName) { - operations.BeginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).GetAwaiter().GetResult(); + return operations.BeginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).GetAwaiter().GetResult(); } /// - /// Delete dhcp by id in a private cloud workload network. + /// Delete a WorkloadNetworkDnsService /// /// /// The operations group for this extension method. @@ -2076,22 +2156,25 @@ public static void BeginDeleteDhcp(this IWorkloadNetworksOperations operations, /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS service. + /// /// /// Name of the private cloud /// - /// - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// /// /// The cancellation token. /// - public static async Task BeginDeleteDhcpAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dhcpId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsServiceId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteDhcpWithHttpMessagesAsync(resourceGroupName, privateCloudName, dhcpId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteDnsServiceWithHttpMessagesAsync(resourceGroupName, dnsServiceId, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create a port mirroring profile by id in a private cloud workload network. + /// Create a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -2102,20 +2185,19 @@ public static void BeginDeleteDhcp(this IWorkloadNetworksOperations operations, /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// Resource create parameters. /// - public static WorkloadNetworkPortMirroring BeginCreatePortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring) + public static WorkloadNetworkDnsZone BeginCreateDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone) { - return operations.BeginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).GetAwaiter().GetResult(); + return operations.BeginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).GetAwaiter().GetResult(); } /// - /// Create a port mirroring profile by id in a private cloud workload network. + /// Create a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -2126,27 +2208,25 @@ public static WorkloadNetworkPortMirroring BeginCreatePortMirroring(this IWorklo /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// Resource create parameters. /// /// /// The cancellation token. /// - public static async Task BeginCreatePortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreatePortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update a port mirroring profile by id in a private cloud workload - /// network. + /// Update a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -2157,21 +2237,19 @@ public static WorkloadNetworkPortMirroring BeginCreatePortMirroring(this IWorklo /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// The resource properties to be updated. /// - public static WorkloadNetworkPortMirroring BeginUpdatePortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring) + public static WorkloadNetworkDnsZone BeginUpdateDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZoneUpdate workloadNetworkDnsZone) { - return operations.BeginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).GetAwaiter().GetResult(); + return operations.BeginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).GetAwaiter().GetResult(); } /// - /// Create or update a port mirroring profile by id in a private cloud workload - /// network. + /// Update a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -2182,26 +2260,25 @@ public static WorkloadNetworkPortMirroring BeginUpdatePortMirroring(this IWorklo /// /// Name of the private cloud /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// - /// - /// NSX port mirroring + /// + /// The resource properties to be updated. /// /// /// The cancellation token. /// - public static async Task BeginUpdatePortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZoneUpdate workloadNetworkDnsZone, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginUpdatePortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete a port mirroring profile by id in a private cloud workload network. + /// Delete a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -2209,20 +2286,19 @@ public static WorkloadNetworkPortMirroring BeginUpdatePortMirroring(this IWorklo /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// /// /// Name of the private cloud /// - public static void BeginDeletePortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string portMirroringId, string privateCloudName) + public static WorkloadNetworksDeleteDnsZoneHeaders BeginDeleteDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsZoneId, string privateCloudName) { - operations.BeginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).GetAwaiter().GetResult(); + return operations.BeginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).GetAwaiter().GetResult(); } /// - /// Delete a port mirroring profile by id in a private cloud workload network. + /// Delete a WorkloadNetworkDnsZone /// /// /// The operations group for this extension method. @@ -2230,9 +2306,8 @@ public static void BeginDeletePortMirroring(this IWorkloadNetworksOperations ope /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring - /// display name + /// + /// ID of the DNS zone. /// /// /// Name of the private cloud @@ -2240,13 +2315,16 @@ public static void BeginDeletePortMirroring(this IWorkloadNetworksOperations ope /// /// The cancellation token. /// - public static async Task BeginDeletePortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string portMirroringId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsZoneId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeletePortMirroringWithHttpMessagesAsync(resourceGroupName, portMirroringId, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteDnsZoneWithHttpMessagesAsync(resourceGroupName, dnsZoneId, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create a vm group by id in a private cloud workload network. + /// Create a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -2257,19 +2335,19 @@ public static void BeginDeletePortMirroring(this IWorkloadNetworksOperations ope /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// + /// ID of the NSX port mirroring profile. /// - /// - /// NSX VM Group + /// + /// Resource create parameters. /// - public static WorkloadNetworkVMGroup BeginCreateVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup) + public static WorkloadNetworkPortMirroring BeginCreatePortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring) { - return operations.BeginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).GetAwaiter().GetResult(); + return operations.BeginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).GetAwaiter().GetResult(); } /// - /// Create a vm group by id in a private cloud workload network. + /// Create a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -2280,25 +2358,25 @@ public static WorkloadNetworkVMGroup BeginCreateVMGroup(this IWorkloadNetworksOp /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// + /// ID of the NSX port mirroring profile. /// - /// - /// NSX VM Group + /// + /// Resource create parameters. /// /// /// The cancellation token. /// - public static async Task BeginCreateVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreatePortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroring workloadNetworkPortMirroring, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreatePortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update a vm group by id in a private cloud workload network. + /// Update a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -2309,19 +2387,19 @@ public static WorkloadNetworkVMGroup BeginCreateVMGroup(this IWorkloadNetworksOp /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// + /// ID of the NSX port mirroring profile. /// - /// - /// NSX VM Group + /// + /// The resource properties to be updated. /// - public static WorkloadNetworkVMGroup BeginUpdateVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup) + public static WorkloadNetworkPortMirroring BeginUpdatePortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroringUpdate workloadNetworkPortMirroring) { - return operations.BeginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).GetAwaiter().GetResult(); + return operations.BeginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).GetAwaiter().GetResult(); } /// - /// Create or update a vm group by id in a private cloud workload network. + /// Update a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -2332,25 +2410,25 @@ public static WorkloadNetworkVMGroup BeginUpdateVMGroup(this IWorkloadNetworksOp /// /// Name of the private cloud /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// + /// ID of the NSX port mirroring profile. /// - /// - /// NSX VM Group + /// + /// The resource properties to be updated. /// /// /// The cancellation token. /// - public static async Task BeginUpdateVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdatePortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string portMirroringId, WorkloadNetworkPortMirroringUpdate workloadNetworkPortMirroring, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginUpdateVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdatePortMirroringWithHttpMessagesAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete a vm group by id in a private cloud workload network. + /// Delete a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -2358,19 +2436,19 @@ public static WorkloadNetworkVMGroup BeginUpdateVMGroup(this IWorkloadNetworksOp /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// + /// ID of the NSX port mirroring profile. /// /// /// Name of the private cloud /// - public static void BeginDeleteVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string vmGroupId, string privateCloudName) + public static WorkloadNetworksDeletePortMirroringHeaders BeginDeletePortMirroring(this IWorkloadNetworksOperations operations, string resourceGroupName, string portMirroringId, string privateCloudName) { - operations.BeginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).GetAwaiter().GetResult(); + return operations.BeginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).GetAwaiter().GetResult(); } /// - /// Delete a vm group by id in a private cloud workload network. + /// Delete a WorkloadNetworkPortMirroring /// /// /// The operations group for this extension method. @@ -2378,8 +2456,8 @@ public static void BeginDeleteVMGroup(this IWorkloadNetworksOperations operation /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// + /// ID of the NSX port mirroring profile. /// /// /// Name of the private cloud @@ -2387,13 +2465,16 @@ public static void BeginDeleteVMGroup(this IWorkloadNetworksOperations operation /// /// The cancellation token. /// - public static async Task BeginDeleteVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string vmGroupId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeletePortMirroringAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string portMirroringId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteVMGroupWithHttpMessagesAsync(resourceGroupName, vmGroupId, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeletePortMirroringWithHttpMessagesAsync(resourceGroupName, portMirroringId, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Create a DNS service by id in a private cloud workload network. + /// Create a WorkloadNetworkPublicIP /// /// /// The operations group for this extension method. @@ -2404,20 +2485,19 @@ public static void BeginDeleteVMGroup(this IWorkloadNetworksOperations operation /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name + /// + /// ID of the DNS zone. /// - /// - /// NSX DNS Service + /// + /// Resource create parameters. /// - public static WorkloadNetworkDnsService BeginCreateDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService) + public static WorkloadNetworkPublicIP BeginCreatePublicIP(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP) { - return operations.BeginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService).GetAwaiter().GetResult(); + return operations.BeginCreatePublicIPAsync(resourceGroupName, privateCloudName, publicIPId, workloadNetworkPublicIP).GetAwaiter().GetResult(); } /// - /// Create a DNS service by id in a private cloud workload network. + /// Create a WorkloadNetworkPublicIP /// /// /// The operations group for this extension method. @@ -2428,26 +2508,25 @@ public static WorkloadNetworkDnsService BeginCreateDnsService(this IWorkloadNetw /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name + /// + /// ID of the DNS zone. /// - /// - /// NSX DNS Service + /// + /// Resource create parameters. /// /// /// The cancellation token. /// - public static async Task BeginCreateDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreatePublicIPAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreatePublicIPWithHttpMessagesAsync(resourceGroupName, privateCloudName, publicIPId, workloadNetworkPublicIP, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update a DNS service by id in a private cloud workload network. + /// Delete a WorkloadNetworkPublicIP /// /// /// The operations group for this extension method. @@ -2455,23 +2534,19 @@ public static WorkloadNetworkDnsService BeginCreateDnsService(this IWorkloadNetw /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS zone. + /// /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name - /// - /// - /// NSX DNS Service - /// - public static WorkloadNetworkDnsService BeginUpdateDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService) + public static WorkloadNetworksDeletePublicIPHeaders BeginDeletePublicIP(this IWorkloadNetworksOperations operations, string resourceGroupName, string publicIPId, string privateCloudName) { - return operations.BeginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService).GetAwaiter().GetResult(); + return operations.BeginDeletePublicIPAsync(resourceGroupName, publicIPId, privateCloudName).GetAwaiter().GetResult(); } /// - /// Create or update a DNS service by id in a private cloud workload network. + /// Delete a WorkloadNetworkPublicIP /// /// /// The operations group for this extension method. @@ -2479,29 +2554,25 @@ public static WorkloadNetworkDnsService BeginUpdateDnsService(this IWorkloadNetw /// /// The name of the resource group. The name is case insensitive. /// + /// + /// ID of the DNS zone. + /// /// /// Name of the private cloud /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name - /// - /// - /// NSX DNS Service - /// /// /// The cancellation token. /// - public static async Task BeginUpdateDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsServiceId, WorkloadNetworkDnsService workloadNetworkDnsService, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeletePublicIPAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string publicIPId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginUpdateDnsServiceWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeletePublicIPWithHttpMessagesAsync(resourceGroupName, publicIPId, privateCloudName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Delete a DNS service by id in a private cloud workload network. + /// Create a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -2509,20 +2580,22 @@ public static WorkloadNetworkDnsService BeginUpdateDnsService(this IWorkloadNetw /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name - /// /// /// Name of the private cloud /// - public static void BeginDeleteDnsService(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsServiceId, string privateCloudName) + /// + /// The ID of the NSX Segment + /// + /// + /// Resource create parameters. + /// + public static WorkloadNetworkSegment BeginCreateSegments(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment) { - operations.BeginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).GetAwaiter().GetResult(); + return operations.BeginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).GetAwaiter().GetResult(); } /// - /// Delete a DNS service by id in a private cloud workload network. + /// Create a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -2530,23 +2603,28 @@ public static void BeginDeleteDnsService(this IWorkloadNetworksOperations operat /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Service identifier. Generally the same as the DNS Service's display - /// name - /// /// /// Name of the private cloud /// + /// + /// The ID of the NSX Segment + /// + /// + /// Resource create parameters. + /// /// /// The cancellation token. /// - public static async Task BeginDeleteDnsServiceAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsServiceId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateSegmentsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegment workloadNetworkSegment, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteDnsServiceWithHttpMessagesAsync(resourceGroupName, dnsServiceId, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginCreateSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Create a DNS zone by id in a private cloud workload network. + /// Update a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -2557,19 +2635,19 @@ public static void BeginDeleteDnsService(this IWorkloadNetworksOperations operat /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// + /// The ID of the NSX Segment /// - /// - /// NSX DNS Zone + /// + /// The resource properties to be updated. /// - public static WorkloadNetworkDnsZone BeginCreateDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone) + public static WorkloadNetworkSegment BeginUpdateSegments(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegmentUpdate workloadNetworkSegment) { - return operations.BeginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).GetAwaiter().GetResult(); + return operations.BeginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).GetAwaiter().GetResult(); } /// - /// Create a DNS zone by id in a private cloud workload network. + /// Update a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -2580,25 +2658,25 @@ public static WorkloadNetworkDnsZone BeginCreateDnsZone(this IWorkloadNetworksOp /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// + /// The ID of the NSX Segment /// - /// - /// NSX DNS Zone + /// + /// The resource properties to be updated. /// /// /// The cancellation token. /// - public static async Task BeginCreateDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateSegmentsAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, WorkloadNetworkSegmentUpdate workloadNetworkSegment, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateSegmentsWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update a DNS zone by id in a private cloud workload network. + /// Delete a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -2609,19 +2687,16 @@ public static WorkloadNetworkDnsZone BeginCreateDnsZone(this IWorkloadNetworksOp /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// - /// - /// NSX DNS Zone + /// + /// The ID of the NSX Segment /// - public static WorkloadNetworkDnsZone BeginUpdateDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone) + public static WorkloadNetworksDeleteSegmentHeaders BeginDeleteSegment(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId) { - return operations.BeginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).GetAwaiter().GetResult(); + return operations.BeginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).GetAwaiter().GetResult(); } /// - /// Create or update a DNS zone by id in a private cloud workload network. + /// Delete a WorkloadNetworkSegment /// /// /// The operations group for this extension method. @@ -2632,25 +2707,22 @@ public static WorkloadNetworkDnsZone BeginUpdateDnsZone(this IWorkloadNetworksOp /// /// Name of the private cloud /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// - /// - /// NSX DNS Zone + /// + /// The ID of the NSX Segment /// /// /// The cancellation token. /// - public static async Task BeginUpdateDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string dnsZoneId, WorkloadNetworkDnsZone workloadNetworkDnsZone, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteSegmentAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string segmentId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginUpdateDnsZoneWithHttpMessagesAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteSegmentWithHttpMessagesAsync(resourceGroupName, privateCloudName, segmentId, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Delete a DNS zone by id in a private cloud workload network. + /// Create a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -2658,19 +2730,22 @@ public static WorkloadNetworkDnsZone BeginUpdateDnsZone(this IWorkloadNetworksOp /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// /// /// Name of the private cloud /// - public static void BeginDeleteDnsZone(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsZoneId, string privateCloudName) + /// + /// ID of the VM group. + /// + /// + /// Resource create parameters. + /// + public static WorkloadNetworkVMGroup BeginCreateVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup) { - operations.BeginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).GetAwaiter().GetResult(); + return operations.BeginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).GetAwaiter().GetResult(); } /// - /// Delete a DNS zone by id in a private cloud workload network. + /// Create a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -2678,22 +2753,28 @@ public static void BeginDeleteDnsZone(this IWorkloadNetworksOperations operation /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// /// /// Name of the private cloud /// + /// + /// ID of the VM group. + /// + /// + /// Resource create parameters. + /// /// /// The cancellation token. /// - public static async Task BeginDeleteDnsZoneAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string dnsZoneId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroup workloadNetworkVMGroup, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteDnsZoneWithHttpMessagesAsync(resourceGroupName, dnsZoneId, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginCreateVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Create a Public IP Block by id in a private cloud workload network. + /// Update a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -2704,20 +2785,19 @@ public static void BeginDeleteDnsZone(this IWorkloadNetworksOperations operation /// /// Name of the private cloud /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name + /// + /// ID of the VM group. /// - /// - /// NSX Public IP Block + /// + /// The resource properties to be updated. /// - public static WorkloadNetworkPublicIP BeginCreatePublicIP(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP) + public static WorkloadNetworkVMGroup BeginUpdateVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroupUpdate workloadNetworkVMGroup) { - return operations.BeginCreatePublicIPAsync(resourceGroupName, privateCloudName, publicIPId, workloadNetworkPublicIP).GetAwaiter().GetResult(); + return operations.BeginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).GetAwaiter().GetResult(); } /// - /// Create a Public IP Block by id in a private cloud workload network. + /// Update a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -2728,26 +2808,25 @@ public static WorkloadNetworkPublicIP BeginCreatePublicIP(this IWorkloadNetworks /// /// Name of the private cloud /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name + /// + /// ID of the VM group. /// - /// - /// NSX Public IP Block + /// + /// The resource properties to be updated. /// /// /// The cancellation token. /// - public static async Task BeginCreatePublicIPAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string publicIPId, WorkloadNetworkPublicIP workloadNetworkPublicIP, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string privateCloudName, string vmGroupId, WorkloadNetworkVMGroupUpdate workloadNetworkVMGroup, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreatePublicIPWithHttpMessagesAsync(resourceGroupName, privateCloudName, publicIPId, workloadNetworkPublicIP, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateVMGroupWithHttpMessagesAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete a Public IP Block by id in a private cloud workload network. + /// Delete a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -2755,20 +2834,19 @@ public static WorkloadNetworkPublicIP BeginCreatePublicIP(this IWorkloadNetworks /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name + /// + /// ID of the VM group. /// /// /// Name of the private cloud /// - public static void BeginDeletePublicIP(this IWorkloadNetworksOperations operations, string resourceGroupName, string publicIPId, string privateCloudName) + public static WorkloadNetworksDeleteVMGroupHeaders BeginDeleteVMGroup(this IWorkloadNetworksOperations operations, string resourceGroupName, string vmGroupId, string privateCloudName) { - operations.BeginDeletePublicIPAsync(resourceGroupName, publicIPId, privateCloudName).GetAwaiter().GetResult(); + return operations.BeginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).GetAwaiter().GetResult(); } /// - /// Delete a Public IP Block by id in a private cloud workload network. + /// Delete a WorkloadNetworkVMGroup /// /// /// The operations group for this extension method. @@ -2776,9 +2854,8 @@ public static void BeginDeletePublicIP(this IWorkloadNetworksOperations operatio /// /// The name of the resource group. The name is case insensitive. /// - /// - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's - /// display name + /// + /// ID of the VM group. /// /// /// Name of the private cloud @@ -2786,13 +2863,16 @@ public static void BeginDeletePublicIP(this IWorkloadNetworksOperations operatio /// /// The cancellation token. /// - public static async Task BeginDeletePublicIPAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string publicIPId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteVMGroupAsync(this IWorkloadNetworksOperations operations, string resourceGroupName, string vmGroupId, string privateCloudName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeletePublicIPWithHttpMessagesAsync(resourceGroupName, publicIPId, privateCloudName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteVMGroupWithHttpMessagesAsync(resourceGroupName, vmGroupId, privateCloudName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// List of segments in a private cloud workload network. + /// List WorkloadNetwork resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -2800,13 +2880,13 @@ public static void BeginDeletePublicIP(this IWorkloadNetworksOperations operatio /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListSegmentsNext(this IWorkloadNetworksOperations operations, string nextPageLink) + public static IPage ListNext(this IWorkloadNetworksOperations operations, string nextPageLink) { - return operations.ListSegmentsNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List of segments in a private cloud workload network. + /// List WorkloadNetwork resources by PrivateCloud /// /// /// The operations group for this extension method. @@ -2817,16 +2897,16 @@ public static IPage ListSegmentsNext(this IWorkloadNetwo /// /// The cancellation token. /// - public static async Task> ListSegmentsNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListSegmentsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List dhcp in a private cloud workload network. + /// List WorkloadNetworkDhcp resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -2840,7 +2920,7 @@ public static IPage ListDhcpNext(this IWorkloadNetworksOper } /// - /// List dhcp in a private cloud workload network. + /// List WorkloadNetworkDhcp resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -2860,7 +2940,7 @@ public static IPage ListDhcpNext(this IWorkloadNetworksOper } /// - /// List of gateways in a private cloud workload network. + /// List WorkloadNetworkDnsService resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -2868,13 +2948,13 @@ public static IPage ListDhcpNext(this IWorkloadNetworksOper /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListGatewaysNext(this IWorkloadNetworksOperations operations, string nextPageLink) + public static IPage ListDnsServicesNext(this IWorkloadNetworksOperations operations, string nextPageLink) { - return operations.ListGatewaysNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListDnsServicesNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List of gateways in a private cloud workload network. + /// List WorkloadNetworkDnsService resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -2885,16 +2965,16 @@ public static IPage ListGatewaysNext(this IWorkloadNetwo /// /// The cancellation token. /// - public static async Task> ListGatewaysNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListDnsServicesNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListGatewaysNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListDnsServicesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List of port mirroring profiles in a private cloud workload network. + /// List WorkloadNetworkDnsZone resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -2902,13 +2982,13 @@ public static IPage ListGatewaysNext(this IWorkloadNetwo /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListPortMirroringNext(this IWorkloadNetworksOperations operations, string nextPageLink) + public static IPage ListDnsZonesNext(this IWorkloadNetworksOperations operations, string nextPageLink) { - return operations.ListPortMirroringNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListDnsZonesNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List of port mirroring profiles in a private cloud workload network. + /// List WorkloadNetworkDnsZone resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -2919,16 +2999,16 @@ public static IPage ListPortMirroringNext(this IWo /// /// The cancellation token. /// - public static async Task> ListPortMirroringNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListDnsZonesNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListPortMirroringNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListDnsZonesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List of vm groups in a private cloud workload network. + /// List WorkloadNetworkGateway resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -2936,13 +3016,13 @@ public static IPage ListPortMirroringNext(this IWo /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListVMGroupsNext(this IWorkloadNetworksOperations operations, string nextPageLink) + public static IPage ListGatewaysNext(this IWorkloadNetworksOperations operations, string nextPageLink) { - return operations.ListVMGroupsNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListGatewaysNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List of vm groups in a private cloud workload network. + /// List WorkloadNetworkGateway resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -2953,16 +3033,16 @@ public static IPage ListVMGroupsNext(this IWorkloadNetwo /// /// The cancellation token. /// - public static async Task> ListVMGroupsNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListGatewaysNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListVMGroupsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListGatewaysNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List of virtual machines in a private cloud workload network. + /// List WorkloadNetworkPortMirroring resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -2970,13 +3050,13 @@ public static IPage ListVMGroupsNext(this IWorkloadNetwo /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListVirtualMachinesNext(this IWorkloadNetworksOperations operations, string nextPageLink) + public static IPage ListPortMirroringNext(this IWorkloadNetworksOperations operations, string nextPageLink) { - return operations.ListVirtualMachinesNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListPortMirroringNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List of virtual machines in a private cloud workload network. + /// List WorkloadNetworkPortMirroring resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -2987,16 +3067,16 @@ public static IPage ListVirtualMachinesNext(this /// /// The cancellation token. /// - public static async Task> ListVirtualMachinesNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListPortMirroringNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListVirtualMachinesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListPortMirroringNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List of DNS services in a private cloud workload network. + /// List WorkloadNetworkPublicIP resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -3004,13 +3084,13 @@ public static IPage ListVirtualMachinesNext(this /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListDnsServicesNext(this IWorkloadNetworksOperations operations, string nextPageLink) + public static IPage ListPublicIPsNext(this IWorkloadNetworksOperations operations, string nextPageLink) { - return operations.ListDnsServicesNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListPublicIPsNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List of DNS services in a private cloud workload network. + /// List WorkloadNetworkPublicIP resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -3021,16 +3101,16 @@ public static IPage ListDnsServicesNext(this IWorkloa /// /// The cancellation token. /// - public static async Task> ListDnsServicesNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListPublicIPsNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListDnsServicesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListPublicIPsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List of DNS zones in a private cloud workload network. + /// List WorkloadNetworkSegment resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -3038,13 +3118,13 @@ public static IPage ListDnsServicesNext(this IWorkloa /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListDnsZonesNext(this IWorkloadNetworksOperations operations, string nextPageLink) + public static IPage ListSegmentsNext(this IWorkloadNetworksOperations operations, string nextPageLink) { - return operations.ListDnsZonesNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListSegmentsNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List of DNS zones in a private cloud workload network. + /// List WorkloadNetworkSegment resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -3055,16 +3135,16 @@ public static IPage ListDnsZonesNext(this IWorkloadNetwo /// /// The cancellation token. /// - public static async Task> ListDnsZonesNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListSegmentsNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListDnsZonesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSegmentsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List of Public IP Blocks in a private cloud workload network. + /// List WorkloadNetworkVirtualMachine resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -3072,13 +3152,13 @@ public static IPage ListDnsZonesNext(this IWorkloadNetwo /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListPublicIPsNext(this IWorkloadNetworksOperations operations, string nextPageLink) + public static IPage ListVirtualMachinesNext(this IWorkloadNetworksOperations operations, string nextPageLink) { - return operations.ListPublicIPsNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListVirtualMachinesNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List of Public IP Blocks in a private cloud workload network. + /// List WorkloadNetworkVirtualMachine resources by WorkloadNetwork /// /// /// The operations group for this extension method. @@ -3089,9 +3169,43 @@ public static IPage ListPublicIPsNext(this IWorkloadNet /// /// The cancellation token. /// - public static async Task> ListPublicIPsNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListVirtualMachinesNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListPublicIPsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListVirtualMachinesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List WorkloadNetworkVMGroup resources by WorkloadNetwork + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListVMGroupsNext(this IWorkloadNetworksOperations operations, string nextPageLink) + { + return operations.ListVMGroupsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List WorkloadNetworkVMGroup resources by WorkloadNetwork + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListVMGroupsNextAsync(this IWorkloadNetworksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListVMGroupsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; }