From a54c0aaddc7fe3aeb71b5280557b2ac657efb77b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 11 Mar 2024 16:30:57 +0000 Subject: [PATCH] CodeGen from PR 28023 in Azure/azure-rest-api-specs Merge 44cd0aec2b9546ec81a2b469d50aaafffe1293ca into 154b11de26012fb7a67544ec3d26937154d43a35 --- sdk/resourcemanager/avs/armavs/CHANGELOG.md | 205 +++ sdk/resourcemanager/avs/armavs/README.md | 6 +- .../avs/armavs/addons_client.go | 50 +- .../avs/armavs/addons_client_example_test.go | 354 ---- .../avs/armavs/authorizations_client.go | 50 +- .../authorizations_client_example_test.go | 144 -- sdk/resourcemanager/avs/armavs/autorest.md | 7 +- .../avs/armavs/client_factory.go | 112 +- .../avs/armavs/cloudlinks_client.go | 50 +- .../armavs/cloudlinks_client_example_test.go | 143 -- .../avs/armavs/clusters_client.go | 73 +- .../armavs/clusters_client_example_test.go | 280 --- sdk/resourcemanager/avs/armavs/constants.go | 825 ++++++--- .../avs/armavs/datastores_client.go | 56 +- .../armavs/datastores_client_example_test.go | 169 -- .../avs/armavs/fake/addons_server.go | 2 +- .../avs/armavs/fake/authorizations_server.go | 2 +- .../avs/armavs/fake/cloudlinks_server.go | 2 +- .../avs/armavs/fake/clusters_server.go | 2 +- .../avs/armavs/fake/datastores_server.go | 2 +- .../fake/globalreachconnections_server.go | 2 +- .../armavs/fake/hcxenterprisesites_server.go | 2 +- .../avs/armavs/fake/internal.go | 8 - .../avs/armavs/fake/iscsipaths_server.go | 260 +++ .../avs/armavs/fake/locations_server.go | 2 +- .../avs/armavs/fake/operations_server.go | 2 +- .../armavs/fake/placementpolicies_server.go | 2 +- .../avs/armavs/fake/privateclouds_server.go | 2 +- .../avs/armavs/fake/scriptcmdlets_server.go | 2 +- .../armavs/fake/scriptexecutions_server.go | 2 +- .../avs/armavs/fake/scriptpackages_server.go | 2 +- .../avs/armavs/fake/server_factory.go | 5 + .../avs/armavs/fake/time_rfc3339.go | 42 +- .../avs/armavs/fake/virtualmachines_server.go | 2 +- .../armavs/fake/workloadnetworks_server.go | 44 +- .../armavs/globalreachconnections_client.go | 50 +- ...balreachconnections_client_example_test.go | 156 -- sdk/resourcemanager/avs/armavs/go.mod | 14 +- sdk/resourcemanager/avs/armavs/go.sum | 19 - .../avs/armavs/hcxenterprisesites_client.go | 36 +- .../hcxenterprisesites_client_example_test.go | 130 -- sdk/resourcemanager/avs/armavs/interfaces.go | 9 + .../avs/armavs/iscsipaths_client.go | 330 ++++ .../avs/armavs/locations_client.go | 12 +- .../armavs/locations_client_example_test.go | 97 -- sdk/resourcemanager/avs/armavs/models.go | 1029 +++++++----- .../avs/armavs/models_serde.go | 1406 ++++++++++------ .../avs/armavs/operations_client.go | 8 +- .../armavs/operations_client_example_test.go | 578 ------- sdk/resourcemanager/avs/armavs/options.go | 28 +- .../avs/armavs/placementpolicies_client.go | 75 +- .../placementpolicies_client_example_test.go | 262 --- .../avs/armavs/polymorphic_helpers.go | 33 +- .../avs/armavs/privateclouds_client.go | 87 +- .../privateclouds_client_example_test.go | 991 ----------- .../{response_types.go => responses.go} | 123 +- .../avs/armavs/scriptcmdlets_client.go | 21 +- .../scriptcmdlets_client_example_test.go | 152 -- .../avs/armavs/scriptexecutions_client.go | 56 +- .../scriptexecutions_client_example_test.go | 257 --- .../avs/armavs/scriptpackages_client.go | 16 +- .../scriptpackages_client_example_test.go | 99 -- .../avs/armavs/time_rfc3339.go | 42 +- .../avs/armavs/virtualmachines_client.go | 35 +- .../virtualmachines_client_example_test.go | 123 -- .../avs/armavs/workloadnetworks_client.go | 533 +++--- .../workloadnetworks_client_example_test.go | 1496 ----------------- 67 files changed, 3943 insertions(+), 7273 deletions(-) delete mode 100644 sdk/resourcemanager/avs/armavs/addons_client_example_test.go delete mode 100644 sdk/resourcemanager/avs/armavs/authorizations_client_example_test.go delete mode 100644 sdk/resourcemanager/avs/armavs/cloudlinks_client_example_test.go delete mode 100644 sdk/resourcemanager/avs/armavs/clusters_client_example_test.go delete mode 100644 sdk/resourcemanager/avs/armavs/datastores_client_example_test.go create mode 100644 sdk/resourcemanager/avs/armavs/fake/iscsipaths_server.go delete mode 100644 sdk/resourcemanager/avs/armavs/globalreachconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/avs/armavs/hcxenterprisesites_client_example_test.go create mode 100644 sdk/resourcemanager/avs/armavs/iscsipaths_client.go delete mode 100644 sdk/resourcemanager/avs/armavs/locations_client_example_test.go delete mode 100644 sdk/resourcemanager/avs/armavs/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/avs/armavs/placementpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/avs/armavs/privateclouds_client_example_test.go rename sdk/resourcemanager/avs/armavs/{response_types.go => responses.go} (87%) delete mode 100644 sdk/resourcemanager/avs/armavs/scriptcmdlets_client_example_test.go delete mode 100644 sdk/resourcemanager/avs/armavs/scriptexecutions_client_example_test.go delete mode 100644 sdk/resourcemanager/avs/armavs/scriptpackages_client_example_test.go delete mode 100644 sdk/resourcemanager/avs/armavs/virtualmachines_client_example_test.go delete mode 100644 sdk/resourcemanager/avs/armavs/workloadnetworks_client_example_test.go diff --git a/sdk/resourcemanager/avs/armavs/CHANGELOG.md b/sdk/resourcemanager/avs/armavs/CHANGELOG.md index 7aad85a32be2..1f5d5ca9344f 100644 --- a/sdk/resourcemanager/avs/armavs/CHANGELOG.md +++ b/sdk/resourcemanager/avs/armavs/CHANGELOG.md @@ -1,5 +1,210 @@ # Release History +## 2.0.0 (2024-03-11) +### Breaking Changes + +- Function `*WorkloadNetworksClient.BeginUpdateDNSService` parameter(s) have been changed from `(context.Context, string, string, string, WorkloadNetworkDNSService, *WorkloadNetworksClientBeginUpdateDNSServiceOptions)` to `(context.Context, string, string, string, WorkloadNetworkDNSServiceUpdate, *WorkloadNetworksClientBeginUpdateDNSServiceOptions)` +- Function `*WorkloadNetworksClient.BeginUpdateDNSZone` parameter(s) have been changed from `(context.Context, string, string, string, WorkloadNetworkDNSZone, *WorkloadNetworksClientBeginUpdateDNSZoneOptions)` to `(context.Context, string, string, string, WorkloadNetworkDNSZoneUpdate, *WorkloadNetworksClientBeginUpdateDNSZoneOptions)` +- Function `*WorkloadNetworksClient.BeginUpdateDhcp` parameter(s) have been changed from `(context.Context, string, string, string, WorkloadNetworkDhcp, *WorkloadNetworksClientBeginUpdateDhcpOptions)` to `(context.Context, string, string, string, WorkloadNetworkDhcpUpdate, *WorkloadNetworksClientBeginUpdateDhcpOptions)` +- Function `*WorkloadNetworksClient.BeginUpdatePortMirroring` parameter(s) have been changed from `(context.Context, string, string, string, WorkloadNetworkPortMirroring, *WorkloadNetworksClientBeginUpdatePortMirroringOptions)` to `(context.Context, string, string, string, WorkloadNetworkPortMirroringUpdate, *WorkloadNetworksClientBeginUpdatePortMirroringOptions)` +- Function `*WorkloadNetworksClient.BeginUpdateSegments` parameter(s) have been changed from `(context.Context, string, string, string, WorkloadNetworkSegment, *WorkloadNetworksClientBeginUpdateSegmentsOptions)` to `(context.Context, string, string, string, WorkloadNetworkSegmentUpdate, *WorkloadNetworksClientBeginUpdateSegmentsOptions)` +- Function `*WorkloadNetworksClient.BeginUpdateVMGroup` parameter(s) have been changed from `(context.Context, string, string, string, WorkloadNetworkVMGroup, *WorkloadNetworksClientBeginUpdateVMGroupOptions)` to `(context.Context, string, string, string, WorkloadNetworkVMGroupUpdate, *WorkloadNetworksClientBeginUpdateVMGroupOptions)` +- Function `*WorkloadNetworksClient.Get` parameter(s) have been changed from `(context.Context, string, string, WorkloadNetworkName, *WorkloadNetworksClientGetOptions)` to `(context.Context, string, string, *WorkloadNetworksClientGetOptions)` +- Type of `Operation.Origin` has been changed from `*string` to `*Origin` +- Type of `PrivateCloud.Identity` has been changed from `*PrivateCloudIdentity` to `*SystemAssignedServiceIdentity` +- Type of `PrivateCloudUpdate.Identity` has been changed from `*PrivateCloudIdentity` to `*SystemAssignedServiceIdentity` +- Type of `WorkloadNetworkDNSZoneProperties.DNSServices` has been changed from `*int64` to `*int32` +- Type of `WorkloadNetworkDhcpServer.LeaseTime` has been changed from `*int64` to `*int32` +- Enum `ResourceIdentityType` has been removed +- Enum `WorkloadNetworkName` has been removed +- Struct `AddonList` has been removed +- Struct `CloudLinkList` has been removed +- Struct `ClusterList` has been removed +- Struct `DatastoreList` has been removed +- Struct `ExpressRouteAuthorizationList` has been removed +- Struct `GlobalReachConnectionList` has been removed +- Struct `HcxEnterpriseSiteList` has been removed +- Struct `LogSpecification` has been removed +- Struct `MetricDimension` has been removed +- Struct `MetricSpecification` has been removed +- Struct `OperationList` has been removed +- Struct `OperationProperties` has been removed +- Struct `PlacementPoliciesList` has been removed +- Struct `PrivateCloudIdentity` has been removed +- Struct `PrivateCloudList` has been removed +- Struct `ScriptCmdletsList` has been removed +- Struct `ScriptExecutionsList` has been removed +- Struct `ScriptPackagesList` has been removed +- Struct `ServiceSpecification` has been removed +- Struct `VirtualMachinesList` has been removed +- Struct `WorkloadNetworkDNSServicesList` has been removed +- Struct `WorkloadNetworkDNSZonesList` has been removed +- Struct `WorkloadNetworkDhcpList` has been removed +- Struct `WorkloadNetworkGatewayList` has been removed +- Struct `WorkloadNetworkList` has been removed +- Struct `WorkloadNetworkPortMirroringList` has been removed +- Struct `WorkloadNetworkPublicIPsList` has been removed +- Struct `WorkloadNetworkSegmentsList` has been removed +- Struct `WorkloadNetworkVMGroupsList` has been removed +- Struct `WorkloadNetworkVirtualMachinesList` has been removed +- Field `AddonList` of struct `AddonsClientListResponse` has been removed +- Field `ExpressRouteAuthorizationList` of struct `AuthorizationsClientListResponse` has been removed +- Field `CloudLinkList` of struct `CloudLinksClientListResponse` has been removed +- Field `ClusterList` of struct `ClustersClientListResponse` has been removed +- Field `DatastoreList` of struct `DatastoresClientListResponse` has been removed +- Field `GlobalReachConnectionList` of struct `GlobalReachConnectionsClientListResponse` has been removed +- Field `HcxEnterpriseSiteList` of struct `HcxEnterpriseSitesClientListResponse` has been removed +- Field `Properties` of struct `Operation` has been removed +- Field `OperationList` of struct `OperationsClientListResponse` has been removed +- Field `PlacementPoliciesList` of struct `PlacementPoliciesClientListResponse` has been removed +- Field `PrivateCloudList` of struct `PrivateCloudsClientListInSubscriptionResponse` has been removed +- Field `PrivateCloudList` of struct `PrivateCloudsClientListResponse` has been removed +- Field `ScriptCmdletsList` of struct `ScriptCmdletsClientListResponse` has been removed +- Field `ScriptExecutionsList` of struct `ScriptExecutionsClientListResponse` has been removed +- Field `ScriptPackagesList` of struct `ScriptPackagesClientListResponse` has been removed +- Field `VirtualMachinesList` of struct `VirtualMachinesClientListResponse` has been removed +- Field `WorkloadNetworkDNSServicesList` of struct `WorkloadNetworksClientListDNSServicesResponse` has been removed +- Field `WorkloadNetworkDNSZonesList` of struct `WorkloadNetworksClientListDNSZonesResponse` has been removed +- Field `WorkloadNetworkDhcpList` of struct `WorkloadNetworksClientListDhcpResponse` has been removed +- Field `WorkloadNetworkGatewayList` of struct `WorkloadNetworksClientListGatewaysResponse` has been removed +- Field `WorkloadNetworkPortMirroringList` of struct `WorkloadNetworksClientListPortMirroringResponse` has been removed +- Field `WorkloadNetworkPublicIPsList` of struct `WorkloadNetworksClientListPublicIPsResponse` has been removed +- Field `WorkloadNetworkList` of struct `WorkloadNetworksClientListResponse` has been removed +- Field `WorkloadNetworkSegmentsList` of struct `WorkloadNetworksClientListSegmentsResponse` has been removed +- Field `WorkloadNetworkVMGroupsList` of struct `WorkloadNetworksClientListVMGroupsResponse` has been removed +- Field `WorkloadNetworkVirtualMachinesList` of struct `WorkloadNetworksClientListVirtualMachinesResponse` has been removed + +### Features Added + +- New enum type `ActionType` with values `ActionTypeInternal` +- New enum type `CloudLinkProvisioningState` with values `CloudLinkProvisioningStateCanceled`, `CloudLinkProvisioningStateFailed`, `CloudLinkProvisioningStateSucceeded` +- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser` +- New enum type `DNSZoneType` with values `DNSZoneTypePrivate`, `DNSZoneTypePublic` +- New enum type `HcxEnterpriseSiteProvisioningState` with values `HcxEnterpriseSiteProvisioningStateCanceled`, `HcxEnterpriseSiteProvisioningStateFailed`, `HcxEnterpriseSiteProvisioningStateSucceeded` +- New enum type `IscsiPathProvisioningState` with values `IscsiPathProvisioningStateBuilding`, `IscsiPathProvisioningStateCanceled`, `IscsiPathProvisioningStateDeleting`, `IscsiPathProvisioningStateFailed`, `IscsiPathProvisioningStatePending`, `IscsiPathProvisioningStateSucceeded`, `IscsiPathProvisioningStateUpdating` +- New enum type `Origin` with values `OriginSystem`, `OriginUser`, `OriginUserSystem` +- New enum type `SKUTier` with values `SKUTierBasic`, `SKUTierFree`, `SKUTierPremium`, `SKUTierStandard` +- New enum type `ScriptCmdletAudience` with values `ScriptCmdletAudienceAny`, `ScriptCmdletAudienceAutomation` +- New enum type `ScriptCmdletProvisioningState` with values `ScriptCmdletProvisioningStateCanceled`, `ScriptCmdletProvisioningStateFailed`, `ScriptCmdletProvisioningStateSucceeded` +- New enum type `ScriptPackageProvisioningState` with values `ScriptPackageProvisioningStateCanceled`, `ScriptPackageProvisioningStateFailed`, `ScriptPackageProvisioningStateSucceeded` +- New enum type `SystemAssignedServiceIdentityType` with values `SystemAssignedServiceIdentityTypeNone`, `SystemAssignedServiceIdentityTypeSystemAssigned` +- New enum type `VirtualMachineProvisioningState` with values `VirtualMachineProvisioningStateCanceled`, `VirtualMachineProvisioningStateFailed`, `VirtualMachineProvisioningStateSucceeded` +- New enum type `WorkloadNetworkProvisioningState` with values `WorkloadNetworkProvisioningStateBuilding`, `WorkloadNetworkProvisioningStateCanceled`, `WorkloadNetworkProvisioningStateDeleting`, `WorkloadNetworkProvisioningStateFailed`, `WorkloadNetworkProvisioningStateSucceeded`, `WorkloadNetworkProvisioningStateUpdating` +- New function `*ClientFactory.NewIscsiPathsClient() *IscsiPathsClient` +- New function `NewIscsiPathsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*IscsiPathsClient, error)` +- New function `*IscsiPathsClient.BeginCreateOrUpdate(context.Context, string, string, IscsiPath, *IscsiPathsClientBeginCreateOrUpdateOptions) (*runtime.Poller[IscsiPathsClientCreateOrUpdateResponse], error)` +- New function `*IscsiPathsClient.BeginDelete(context.Context, string, string, *IscsiPathsClientBeginDeleteOptions) (*runtime.Poller[IscsiPathsClientDeleteResponse], error)` +- New function `*IscsiPathsClient.Get(context.Context, string, string, *IscsiPathsClientGetOptions) (IscsiPathsClientGetResponse, error)` +- New function `*IscsiPathsClient.NewListByPrivateCloudPager(string, string, *IscsiPathsClientListByPrivateCloudOptions) *runtime.Pager[IscsiPathsClientListByPrivateCloudResponse]` +- New function `*WorkloadNetworkDhcpEntityUpdate.GetWorkloadNetworkDhcpEntityUpdate() *WorkloadNetworkDhcpEntityUpdate` +- New function `*WorkloadNetworkDhcpRelayUpdate.GetWorkloadNetworkDhcpEntityUpdate() *WorkloadNetworkDhcpEntityUpdate` +- New function `*WorkloadNetworkDhcpServerUpdate.GetWorkloadNetworkDhcpEntityUpdate() *WorkloadNetworkDhcpEntityUpdate` +- New struct `AddonListResult` +- New struct `CloudLinkListResult` +- New struct `ClusterListResult` +- New struct `DatastoreListResult` +- New struct `ElasticSanVolume` +- New struct `ExpressRouteAuthorizationListResult` +- New struct `GlobalReachConnectionListResult` +- New struct `HcxEnterpriseSiteListResult` +- New struct `IscsiPath` +- New struct `IscsiPathListResult` +- New struct `IscsiPathProperties` +- New struct `OperationListResult` +- New struct `PlacementPolicyListResult` +- New struct `PrivateCloudListResult` +- New struct `ScriptCmdletListResult` +- New struct `ScriptExecutionListResult` +- New struct `ScriptPackageListResult` +- New struct `SystemAssignedServiceIdentity` +- New struct `SystemData` +- New struct `VirtualMachineListResult` +- New struct `WorkloadNetworkDNSServiceListResult` +- New struct `WorkloadNetworkDNSServiceUpdate` +- New struct `WorkloadNetworkDNSZoneListResult` +- New struct `WorkloadNetworkDNSZoneUpdate` +- New struct `WorkloadNetworkDhcpListResult` +- New struct `WorkloadNetworkDhcpRelayUpdate` +- New struct `WorkloadNetworkDhcpServerUpdate` +- New struct `WorkloadNetworkDhcpUpdate` +- New struct `WorkloadNetworkGatewayListResult` +- New struct `WorkloadNetworkListResult` +- New struct `WorkloadNetworkPortMirroringListResult` +- New struct `WorkloadNetworkPortMirroringUpdate` +- New struct `WorkloadNetworkProperties` +- New struct `WorkloadNetworkPublicIPListResult` +- New struct `WorkloadNetworkSegmentListResult` +- New struct `WorkloadNetworkSegmentUpdate` +- New struct `WorkloadNetworkVMGroupListResult` +- New struct `WorkloadNetworkVMGroupUpdate` +- New struct `WorkloadNetworkVirtualMachineListResult` +- New field `SystemData` in struct `Addon` +- New anonymous field `AddonListResult` in struct `AddonsClientListResponse` +- New anonymous field `ExpressRouteAuthorizationListResult` in struct `AuthorizationsClientListResponse` +- New field `SystemData` in struct `CloudLink` +- New field `ProvisioningState` in struct `CloudLinkProperties` +- New anonymous field `CloudLinkListResult` in struct `CloudLinksClientListResponse` +- New field `SystemData` in struct `Cluster` +- New field `VsanDatastoreName` in struct `ClusterProperties` +- New field `SKU` in struct `ClusterUpdate` +- New anonymous field `ClusterListResult` in struct `ClustersClientListResponse` +- New field `SystemData` in struct `Datastore` +- New field `ElasticSanVolume` in struct `DatastoreProperties` +- New anonymous field `DatastoreListResult` in struct `DatastoresClientListResponse` +- New field `HcxCloudManagerIP`, `NsxtManagerIP`, `VcenterIP` in struct `Endpoints` +- New field `SystemData` in struct `ExpressRouteAuthorization` +- New field `SystemData` in struct `GlobalReachConnection` +- New anonymous field `GlobalReachConnectionListResult` in struct `GlobalReachConnectionsClientListResponse` +- New field `SystemData` in struct `HcxEnterpriseSite` +- New field `ProvisioningState` in struct `HcxEnterpriseSiteProperties` +- New anonymous field `HcxEnterpriseSiteListResult` in struct `HcxEnterpriseSitesClientListResponse` +- New field `VsanDatastoreName` in struct `ManagementCluster` +- New field `ActionType` in struct `Operation` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New anonymous field `PlacementPolicyListResult` in struct `PlacementPoliciesClientListResponse` +- New field `SystemData` in struct `PlacementPolicy` +- New field `SystemData` in struct `PrivateCloud` +- New field `DNSZoneType`, `VirtualNetworkID` in struct `PrivateCloudProperties` +- New field `SKU` in struct `PrivateCloudUpdate` +- New field `DNSZoneType` in struct `PrivateCloudUpdateProperties` +- New anonymous field `PrivateCloudListResult` in struct `PrivateCloudsClientListInSubscriptionResponse` +- New anonymous field `PrivateCloudListResult` in struct `PrivateCloudsClientListResponse` +- New field `Capacity`, `Family`, `Size`, `Tier` in struct `SKU` +- New field `SystemData` in struct `ScriptCmdlet` +- New field `Audience`, `ProvisioningState` in struct `ScriptCmdletProperties` +- New anonymous field `ScriptCmdletListResult` in struct `ScriptCmdletsClientListResponse` +- New field `SystemData` in struct `ScriptExecution` +- New anonymous field `ScriptExecutionListResult` in struct `ScriptExecutionsClientListResponse` +- New field `SystemData` in struct `ScriptPackage` +- New field `ProvisioningState` in struct `ScriptPackageProperties` +- New anonymous field `ScriptPackageListResult` in struct `ScriptPackagesClientListResponse` +- New field `SystemData` in struct `VirtualMachine` +- New field `ProvisioningState` in struct `VirtualMachineProperties` +- New anonymous field `VirtualMachineListResult` in struct `VirtualMachinesClientListResponse` +- New field `Properties`, `SystemData` in struct `WorkloadNetwork` +- New field `SystemData` in struct `WorkloadNetworkDNSService` +- New field `SystemData` in struct `WorkloadNetworkDNSZone` +- New field `SystemData` in struct `WorkloadNetworkDhcp` +- New field `SystemData` in struct `WorkloadNetworkGateway` +- New field `ProvisioningState` in struct `WorkloadNetworkGatewayProperties` +- New field `SystemData` in struct `WorkloadNetworkPortMirroring` +- New field `SystemData` in struct `WorkloadNetworkPublicIP` +- New field `SystemData` in struct `WorkloadNetworkSegment` +- New field `SystemData` in struct `WorkloadNetworkVMGroup` +- New field `SystemData` in struct `WorkloadNetworkVirtualMachine` +- New field `ProvisioningState` in struct `WorkloadNetworkVirtualMachineProperties` +- New anonymous field `WorkloadNetworkDNSServiceListResult` in struct `WorkloadNetworksClientListDNSServicesResponse` +- New anonymous field `WorkloadNetworkDNSZoneListResult` in struct `WorkloadNetworksClientListDNSZonesResponse` +- New anonymous field `WorkloadNetworkDhcpListResult` in struct `WorkloadNetworksClientListDhcpResponse` +- New anonymous field `WorkloadNetworkGatewayListResult` in struct `WorkloadNetworksClientListGatewaysResponse` +- New anonymous field `WorkloadNetworkPortMirroringListResult` in struct `WorkloadNetworksClientListPortMirroringResponse` +- New anonymous field `WorkloadNetworkPublicIPListResult` in struct `WorkloadNetworksClientListPublicIPsResponse` +- New anonymous field `WorkloadNetworkListResult` in struct `WorkloadNetworksClientListResponse` +- New anonymous field `WorkloadNetworkSegmentListResult` in struct `WorkloadNetworksClientListSegmentsResponse` +- New anonymous field `WorkloadNetworkVMGroupListResult` in struct `WorkloadNetworksClientListVMGroupsResponse` +- New anonymous field `WorkloadNetworkVirtualMachineListResult` in struct `WorkloadNetworksClientListVirtualMachinesResponse` + + ## 1.4.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/avs/armavs/README.md b/sdk/resourcemanager/avs/armavs/README.md index 58346169d0de..a0a7bfe737f6 100644 --- a/sdk/resourcemanager/avs/armavs/README.md +++ b/sdk/resourcemanager/avs/armavs/README.md @@ -1,6 +1,6 @@ # Azure VMware Solution Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2) The `armavs` module provides operations for working with Azure VMware Solution. @@ -20,7 +20,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure VMware Solution module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2 ``` ## Authorization @@ -57,7 +57,7 @@ clientFactory, err := armavs.NewClientFactory(, cred, &options) A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewVirtualMachinesClient() +client := clientFactory.NewAddonsClient() ``` ## Fakes diff --git a/sdk/resourcemanager/avs/armavs/addons_client.go b/sdk/resourcemanager/avs/armavs/addons_client.go index c95e6c4470db..b24f28c8ab48 100644 --- a/sdk/resourcemanager/avs/armavs/addons_client.go +++ b/sdk/resourcemanager/avs/armavs/addons_client.go @@ -43,14 +43,14 @@ func NewAddonsClient(subscriptionID string, credential azcore.TokenCredential, o return client, nil } -// BeginCreateOrUpdate - Create or update a addon in a private cloud +// BeginCreateOrUpdate - Create a Addon // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - privateCloudName - The name of the private cloud. -// - addonName - Name of the addon for the private cloud -// - addon - A addon in the private cloud +// - privateCloudName - Name of the private cloud +// - addonName - Name of the addon. +// - addon - Resource create parameters. // - options - AddonsClientBeginCreateOrUpdateOptions contains the optional parameters for the AddonsClient.BeginCreateOrUpdate // method. func (client *AddonsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, addonName string, addon Addon, options *AddonsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AddonsClientCreateOrUpdateResponse], error) { @@ -60,7 +60,8 @@ func (client *AddonsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AddonsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,10 +71,10 @@ func (client *AddonsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro } } -// CreateOrUpdate - Create or update a addon in a private cloud +// CreateOrUpdate - Create a Addon // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *AddonsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, addonName string, addon Addon, options *AddonsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AddonsClient.BeginCreateOrUpdate" @@ -119,7 +120,7 @@ func (client *AddonsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, addon); err != nil { @@ -128,13 +129,13 @@ func (client *AddonsClient) createOrUpdateCreateRequest(ctx context.Context, res return req, nil } -// BeginDelete - Delete a addon in a private cloud +// BeginDelete - Delete a Addon // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - addonName - Name of the addon for the private cloud +// - addonName - Name of the addon. // - options - AddonsClientBeginDeleteOptions contains the optional parameters for the AddonsClient.BeginDelete method. func (client *AddonsClient) BeginDelete(ctx context.Context, resourceGroupName string, privateCloudName string, addonName string, options *AddonsClientBeginDeleteOptions) (*runtime.Poller[AddonsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -143,7 +144,8 @@ func (client *AddonsClient) BeginDelete(ctx context.Context, resourceGroupName s return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AddonsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -153,10 +155,10 @@ func (client *AddonsClient) BeginDelete(ctx context.Context, resourceGroupName s } } -// Delete - Delete a addon in a private cloud +// Delete - Delete a Addon // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *AddonsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateCloudName string, addonName string, options *AddonsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AddonsClient.BeginDelete" @@ -202,19 +204,19 @@ func (client *AddonsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get an addon by name in a private cloud +// Get - Get a Addon // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - addonName - Name of the addon for the private cloud +// - addonName - Name of the addon. // - options - AddonsClientGetOptions contains the optional parameters for the AddonsClient.Get method. func (client *AddonsClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, addonName string, options *AddonsClientGetOptions) (AddonsClientGetResponse, error) { var err error @@ -262,7 +264,7 @@ func (client *AddonsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,9 +279,9 @@ func (client *AddonsClient) getHandleResponse(resp *http.Response) (AddonsClient return result, nil } -// NewListPager - List addons in a private cloud +// NewListPager - List Addon resources by PrivateCloud // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - AddonsClientListOptions contains the optional parameters for the AddonsClient.NewListPager method. @@ -326,7 +328,7 @@ func (client *AddonsClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,7 +337,7 @@ func (client *AddonsClient) listCreateRequest(ctx context.Context, resourceGroup // listHandleResponse handles the List response. func (client *AddonsClient) listHandleResponse(resp *http.Response) (AddonsClientListResponse, error) { result := AddonsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AddonList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.AddonListResult); err != nil { return AddonsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/avs/armavs/addons_client_example_test.go b/sdk/resourcemanager/avs/armavs/addons_client_example_test.go deleted file mode 100644 index ddbb6f1bf7ec..000000000000 --- a/sdk/resourcemanager/avs/armavs/addons_client_example_test.go +++ /dev/null @@ -1,354 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_List.json -func ExampleAddonsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAddonsClient().NewListPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AddonList = armavs.AddonList{ - // Value: []*armavs.Addon{ - // { - // Name: to.Ptr("srm"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/addons"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm"), - // Properties: &armavs.AddonSrmProperties{ - // AddonType: to.Ptr(armavs.AddonTypeSRM), - // ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded), - // LicenseKey: to.Ptr("41915178-A8FF-4A4D-B683-6D735AF5E3F5"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Get_ArcReg.json -func ExampleAddonsClient_Get_addonsGetArcReg() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAddonsClient().Get(ctx, "group1", "cloud1", "arc", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Addon = armavs.Addon{ - // Name: to.Ptr("arc"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/addons"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/arc"), - // Properties: &armavs.AddonArcProperties{ - // AddonType: to.Ptr(armavs.AddonTypeArc), - // ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded), - // VCenter: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Get_HCX.json -func ExampleAddonsClient_Get_addonsGetHcx() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAddonsClient().Get(ctx, "group1", "cloud1", "hcx", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Addon = armavs.Addon{ - // Name: to.Ptr("hcx"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/addons"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/hcx"), - // Properties: &armavs.AddonHcxProperties{ - // AddonType: to.Ptr(armavs.AddonTypeHCX), - // ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded), - // Offer: to.Ptr("VMware MaaS Cloud Provider (Enterprise)"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Get_SRM.json -func ExampleAddonsClient_Get_addonsGetSrm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAddonsClient().Get(ctx, "group1", "cloud1", "srm", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Addon = armavs.Addon{ - // Name: to.Ptr("srm"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/addons"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm"), - // Properties: &armavs.AddonSrmProperties{ - // AddonType: to.Ptr(armavs.AddonTypeSRM), - // ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded), - // LicenseKey: to.Ptr("41915178-A8FF-4A4D-B683-6D735AF5E3F5"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Get_VR.json -func ExampleAddonsClient_Get_addonsGetVr() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAddonsClient().Get(ctx, "group1", "cloud1", "vr", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Addon = armavs.Addon{ - // Name: to.Ptr("vr"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/addons"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/vr"), - // Properties: &armavs.AddonVrProperties{ - // AddonType: to.Ptr(armavs.AddonTypeVR), - // ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded), - // VrsCount: to.Ptr[int32](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_CreateOrUpdate_ArcReg.json -func ExampleAddonsClient_BeginCreateOrUpdate_addonsCreateOrUpdateArc() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAddonsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "arc", armavs.Addon{ - Properties: &armavs.AddonArcProperties{ - AddonType: to.Ptr(armavs.AddonTypeArc), - VCenter: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Addon = armavs.Addon{ - // Name: to.Ptr("arc"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/addons"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/arc"), - // Properties: &armavs.AddonArcProperties{ - // AddonType: to.Ptr(armavs.AddonTypeArc), - // ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded), - // VCenter: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_CreateOrUpdate_HCX.json -func ExampleAddonsClient_BeginCreateOrUpdate_addonsCreateOrUpdateHcx() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAddonsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "hcx", armavs.Addon{ - Properties: &armavs.AddonHcxProperties{ - AddonType: to.Ptr(armavs.AddonTypeHCX), - Offer: to.Ptr("VMware MaaS Cloud Provider (Enterprise)"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Addon = armavs.Addon{ - // Name: to.Ptr("hcx"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/addons"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/hcx"), - // Properties: &armavs.AddonHcxProperties{ - // AddonType: to.Ptr(armavs.AddonTypeHCX), - // ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded), - // Offer: to.Ptr("VMware MaaS Cloud Provider (Enterprise)"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_CreateOrUpdate_SRM.json -func ExampleAddonsClient_BeginCreateOrUpdate_addonsCreateOrUpdateSrm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAddonsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "srm", armavs.Addon{ - Properties: &armavs.AddonSrmProperties{ - AddonType: to.Ptr(armavs.AddonTypeSRM), - LicenseKey: to.Ptr("41915178-A8FF-4A4D-B683-6D735AF5E3F5"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Addon = armavs.Addon{ - // Name: to.Ptr("srm"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/addons"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm"), - // Properties: &armavs.AddonSrmProperties{ - // AddonType: to.Ptr(armavs.AddonTypeSRM), - // ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded), - // LicenseKey: to.Ptr("41915178-A8FF-4A4D-B683-6D735AF5E3F5"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_CreateOrUpdate_VR.json -func ExampleAddonsClient_BeginCreateOrUpdate_addonsCreateOrUpdateVr() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAddonsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "vr", armavs.Addon{ - Properties: &armavs.AddonVrProperties{ - AddonType: to.Ptr(armavs.AddonTypeVR), - VrsCount: to.Ptr[int32](1), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Addon = armavs.Addon{ - // Name: to.Ptr("vr"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/addons"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/vr"), - // Properties: &armavs.AddonVrProperties{ - // AddonType: to.Ptr(armavs.AddonTypeVR), - // ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded), - // VrsCount: to.Ptr[int32](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Addons_Delete.json -func ExampleAddonsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAddonsClient().BeginDelete(ctx, "group1", "cloud1", "srm", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/avs/armavs/authorizations_client.go b/sdk/resourcemanager/avs/armavs/authorizations_client.go index bbdca3467fa6..e7a5c102c12d 100644 --- a/sdk/resourcemanager/avs/armavs/authorizations_client.go +++ b/sdk/resourcemanager/avs/armavs/authorizations_client.go @@ -43,14 +43,14 @@ func NewAuthorizationsClient(subscriptionID string, credential azcore.TokenCrede return client, nil } -// BeginCreateOrUpdate - Create or update an ExpressRoute Circuit Authorization in a private cloud +// BeginCreateOrUpdate - Create a ExpressRouteAuthorization // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - privateCloudName - The name of the private cloud. -// - authorizationName - Name of the ExpressRoute Circuit Authorization in the private cloud -// - authorization - An ExpressRoute Circuit Authorization +// - privateCloudName - Name of the private cloud +// - authorizationName - Name of the ExpressRoute Circuit Authorization +// - authorization - Resource create parameters. // - options - AuthorizationsClientBeginCreateOrUpdateOptions contains the optional parameters for the AuthorizationsClient.BeginCreateOrUpdate // method. func (client *AuthorizationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, authorizationName string, authorization ExpressRouteAuthorization, options *AuthorizationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AuthorizationsClientCreateOrUpdateResponse], error) { @@ -60,7 +60,8 @@ func (client *AuthorizationsClient) BeginCreateOrUpdate(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AuthorizationsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,10 +71,10 @@ func (client *AuthorizationsClient) BeginCreateOrUpdate(ctx context.Context, res } } -// CreateOrUpdate - Create or update an ExpressRoute Circuit Authorization in a private cloud +// CreateOrUpdate - Create a ExpressRouteAuthorization // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *AuthorizationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, authorizationName string, authorization ExpressRouteAuthorization, options *AuthorizationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AuthorizationsClient.BeginCreateOrUpdate" @@ -119,7 +120,7 @@ func (client *AuthorizationsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, authorization); err != nil { @@ -128,13 +129,13 @@ func (client *AuthorizationsClient) createOrUpdateCreateRequest(ctx context.Cont return req, nil } -// BeginDelete - Delete an ExpressRoute Circuit Authorization in a private cloud +// BeginDelete - Delete a ExpressRouteAuthorization // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - authorizationName - Name of the ExpressRoute Circuit Authorization in the private cloud +// - authorizationName - Name of the ExpressRoute Circuit Authorization // - options - AuthorizationsClientBeginDeleteOptions contains the optional parameters for the AuthorizationsClient.BeginDelete // method. func (client *AuthorizationsClient) BeginDelete(ctx context.Context, resourceGroupName string, privateCloudName string, authorizationName string, options *AuthorizationsClientBeginDeleteOptions) (*runtime.Poller[AuthorizationsClientDeleteResponse], error) { @@ -144,7 +145,8 @@ func (client *AuthorizationsClient) BeginDelete(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AuthorizationsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -154,10 +156,10 @@ func (client *AuthorizationsClient) BeginDelete(ctx context.Context, resourceGro } } -// Delete - Delete an ExpressRoute Circuit Authorization in a private cloud +// Delete - Delete a ExpressRouteAuthorization // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *AuthorizationsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateCloudName string, authorizationName string, options *AuthorizationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AuthorizationsClient.BeginDelete" @@ -203,19 +205,19 @@ func (client *AuthorizationsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get an ExpressRoute Circuit Authorization by name in a private cloud +// Get - Get a ExpressRouteAuthorization // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - authorizationName - Name of the ExpressRoute Circuit Authorization in the private cloud +// - authorizationName - Name of the ExpressRoute Circuit Authorization // - options - AuthorizationsClientGetOptions contains the optional parameters for the AuthorizationsClient.Get method. func (client *AuthorizationsClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, authorizationName string, options *AuthorizationsClientGetOptions) (AuthorizationsClientGetResponse, error) { var err error @@ -263,7 +265,7 @@ func (client *AuthorizationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,9 +280,9 @@ func (client *AuthorizationsClient) getHandleResponse(resp *http.Response) (Auth return result, nil } -// NewListPager - List ExpressRoute Circuit Authorizations in a private cloud +// NewListPager - List ExpressRouteAuthorization resources by PrivateCloud // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - AuthorizationsClientListOptions contains the optional parameters for the AuthorizationsClient.NewListPager method. @@ -327,7 +329,7 @@ func (client *AuthorizationsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -336,7 +338,7 @@ func (client *AuthorizationsClient) listCreateRequest(ctx context.Context, resou // listHandleResponse handles the List response. func (client *AuthorizationsClient) listHandleResponse(resp *http.Response) (AuthorizationsClientListResponse, error) { result := AuthorizationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteAuthorizationList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.ExpressRouteAuthorizationListResult); err != nil { return AuthorizationsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/avs/armavs/authorizations_client_example_test.go b/sdk/resourcemanager/avs/armavs/authorizations_client_example_test.go deleted file mode 100644 index c68ca864fa6a..000000000000 --- a/sdk/resourcemanager/avs/armavs/authorizations_client_example_test.go +++ /dev/null @@ -1,144 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Authorizations_List.json -func ExampleAuthorizationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAuthorizationsClient().NewListPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExpressRouteAuthorizationList = armavs.ExpressRouteAuthorizationList{ - // Value: []*armavs.ExpressRouteAuthorization{ - // { - // Name: to.Ptr("authorization1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/authorizations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1"), - // Properties: &armavs.ExpressRouteAuthorizationProperties{ - // ExpressRouteAuthorizationID: to.Ptr("/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth"), - // ExpressRouteAuthorizationKey: to.Ptr("37b0db3b-3b17-4c7b-bf76-bf13b01bcadc"), - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // ProvisioningState: to.Ptr(armavs.ExpressRouteAuthorizationProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Authorizations_Get.json -func ExampleAuthorizationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAuthorizationsClient().Get(ctx, "group1", "cloud1", "authorization1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteAuthorization = armavs.ExpressRouteAuthorization{ - // Name: to.Ptr("authorization1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/authorizations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1"), - // Properties: &armavs.ExpressRouteAuthorizationProperties{ - // ExpressRouteAuthorizationID: to.Ptr("/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth"), - // ExpressRouteAuthorizationKey: to.Ptr("37b0db3b-3b17-4c7b-bf76-bf13b01bcadc"), - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // ProvisioningState: to.Ptr(armavs.ExpressRouteAuthorizationProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Authorizations_CreateOrUpdate.json -func ExampleAuthorizationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAuthorizationsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "authorization1", armavs.ExpressRouteAuthorization{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExpressRouteAuthorization = armavs.ExpressRouteAuthorization{ - // Name: to.Ptr("authorization1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/authorizations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1"), - // Properties: &armavs.ExpressRouteAuthorizationProperties{ - // ExpressRouteAuthorizationID: to.Ptr("/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth"), - // ExpressRouteAuthorizationKey: to.Ptr("37b0db3b-3b17-4c7b-bf76-bf13b01bcadc"), - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // ProvisioningState: to.Ptr(armavs.ExpressRouteAuthorizationProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Authorizations_Delete.json -func ExampleAuthorizationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAuthorizationsClient().BeginDelete(ctx, "group1", "cloud1", "authorization1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/avs/armavs/autorest.md b/sdk/resourcemanager/avs/armavs/autorest.md index ef85c4e5378a..95a2fd015e73 100644 --- a/sdk/resourcemanager/avs/armavs/autorest.md +++ b/sdk/resourcemanager/avs/armavs/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/vmware/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/vmware/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.4.0 -tag: package-2023-03-01 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/avs/armavs/client_factory.go b/sdk/resourcemanager/avs/armavs/client_factory.go index 90b2f9e8e4e4..387e47fd6e9c 100644 --- a/sdk/resourcemanager/avs/armavs/client_factory.go +++ b/sdk/resourcemanager/avs/armavs/client_factory.go @@ -17,8 +17,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -27,108 +26,147 @@ type ClientFactory struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewAddonsClient creates a new instance of AddonsClient. func (c *ClientFactory) NewAddonsClient() *AddonsClient { - subClient, _ := NewAddonsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &AddonsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewAuthorizationsClient creates a new instance of AuthorizationsClient. func (c *ClientFactory) NewAuthorizationsClient() *AuthorizationsClient { - subClient, _ := NewAuthorizationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &AuthorizationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewCloudLinksClient creates a new instance of CloudLinksClient. func (c *ClientFactory) NewCloudLinksClient() *CloudLinksClient { - subClient, _ := NewCloudLinksClient(c.subscriptionID, c.credential, c.options) - return subClient + return &CloudLinksClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewClustersClient creates a new instance of ClustersClient. func (c *ClientFactory) NewClustersClient() *ClustersClient { - subClient, _ := NewClustersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ClustersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDatastoresClient creates a new instance of DatastoresClient. func (c *ClientFactory) NewDatastoresClient() *DatastoresClient { - subClient, _ := NewDatastoresClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DatastoresClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewGlobalReachConnectionsClient creates a new instance of GlobalReachConnectionsClient. func (c *ClientFactory) NewGlobalReachConnectionsClient() *GlobalReachConnectionsClient { - subClient, _ := NewGlobalReachConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &GlobalReachConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewHcxEnterpriseSitesClient creates a new instance of HcxEnterpriseSitesClient. func (c *ClientFactory) NewHcxEnterpriseSitesClient() *HcxEnterpriseSitesClient { - subClient, _ := NewHcxEnterpriseSitesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &HcxEnterpriseSitesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewIscsiPathsClient creates a new instance of IscsiPathsClient. +func (c *ClientFactory) NewIscsiPathsClient() *IscsiPathsClient { + return &IscsiPathsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewLocationsClient creates a new instance of LocationsClient. func (c *ClientFactory) NewLocationsClient() *LocationsClient { - subClient, _ := NewLocationsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &LocationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewPlacementPoliciesClient creates a new instance of PlacementPoliciesClient. func (c *ClientFactory) NewPlacementPoliciesClient() *PlacementPoliciesClient { - subClient, _ := NewPlacementPoliciesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PlacementPoliciesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateCloudsClient creates a new instance of PrivateCloudsClient. func (c *ClientFactory) NewPrivateCloudsClient() *PrivateCloudsClient { - subClient, _ := NewPrivateCloudsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateCloudsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewScriptCmdletsClient creates a new instance of ScriptCmdletsClient. func (c *ClientFactory) NewScriptCmdletsClient() *ScriptCmdletsClient { - subClient, _ := NewScriptCmdletsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ScriptCmdletsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewScriptExecutionsClient creates a new instance of ScriptExecutionsClient. func (c *ClientFactory) NewScriptExecutionsClient() *ScriptExecutionsClient { - subClient, _ := NewScriptExecutionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ScriptExecutionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewScriptPackagesClient creates a new instance of ScriptPackagesClient. func (c *ClientFactory) NewScriptPackagesClient() *ScriptPackagesClient { - subClient, _ := NewScriptPackagesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ScriptPackagesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewVirtualMachinesClient creates a new instance of VirtualMachinesClient. func (c *ClientFactory) NewVirtualMachinesClient() *VirtualMachinesClient { - subClient, _ := NewVirtualMachinesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &VirtualMachinesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewWorkloadNetworksClient creates a new instance of WorkloadNetworksClient. func (c *ClientFactory) NewWorkloadNetworksClient() *WorkloadNetworksClient { - subClient, _ := NewWorkloadNetworksClient(c.subscriptionID, c.credential, c.options) - return subClient + return &WorkloadNetworksClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/avs/armavs/cloudlinks_client.go b/sdk/resourcemanager/avs/armavs/cloudlinks_client.go index b76b20102e36..d5440ecefbf6 100644 --- a/sdk/resourcemanager/avs/armavs/cloudlinks_client.go +++ b/sdk/resourcemanager/avs/armavs/cloudlinks_client.go @@ -43,14 +43,14 @@ func NewCloudLinksClient(subscriptionID string, credential azcore.TokenCredentia return client, nil } -// BeginCreateOrUpdate - Create or update a cloud link in a private cloud +// BeginCreateOrUpdate - Create a CloudLink // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - privateCloudName - The name of the private cloud. -// - cloudLinkName - Name of the cloud link resource -// - cloudLink - A cloud link in the private cloud +// - privateCloudName - Name of the private cloud +// - cloudLinkName - Name of the cloud link. +// - cloudLink - Resource create parameters. // - options - CloudLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudLinksClient.BeginCreateOrUpdate // method. func (client *CloudLinksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, cloudLinkName string, cloudLink CloudLink, options *CloudLinksClientBeginCreateOrUpdateOptions) (*runtime.Poller[CloudLinksClientCreateOrUpdateResponse], error) { @@ -60,7 +60,8 @@ func (client *CloudLinksClient) BeginCreateOrUpdate(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudLinksClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,10 +71,10 @@ func (client *CloudLinksClient) BeginCreateOrUpdate(ctx context.Context, resourc } } -// CreateOrUpdate - Create or update a cloud link in a private cloud +// CreateOrUpdate - Create a CloudLink // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *CloudLinksClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, cloudLinkName string, cloudLink CloudLink, options *CloudLinksClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudLinksClient.BeginCreateOrUpdate" @@ -119,7 +120,7 @@ func (client *CloudLinksClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cloudLink); err != nil { @@ -128,13 +129,13 @@ func (client *CloudLinksClient) createOrUpdateCreateRequest(ctx context.Context, return req, nil } -// BeginDelete - Delete a cloud link in a private cloud +// BeginDelete - Delete a CloudLink // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - cloudLinkName - Name of the cloud link resource +// - cloudLinkName - Name of the cloud link. // - options - CloudLinksClientBeginDeleteOptions contains the optional parameters for the CloudLinksClient.BeginDelete method. func (client *CloudLinksClient) BeginDelete(ctx context.Context, resourceGroupName string, privateCloudName string, cloudLinkName string, options *CloudLinksClientBeginDeleteOptions) (*runtime.Poller[CloudLinksClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -143,7 +144,8 @@ func (client *CloudLinksClient) BeginDelete(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudLinksClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -153,10 +155,10 @@ func (client *CloudLinksClient) BeginDelete(ctx context.Context, resourceGroupNa } } -// Delete - Delete a cloud link in a private cloud +// Delete - Delete a CloudLink // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *CloudLinksClient) deleteOperation(ctx context.Context, resourceGroupName string, privateCloudName string, cloudLinkName string, options *CloudLinksClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CloudLinksClient.BeginDelete" @@ -202,19 +204,19 @@ func (client *CloudLinksClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get an cloud link by name in a private cloud +// Get - Get a CloudLink // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - cloudLinkName - Name of the cloud link resource +// - cloudLinkName - Name of the cloud link. // - options - CloudLinksClientGetOptions contains the optional parameters for the CloudLinksClient.Get method. func (client *CloudLinksClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, cloudLinkName string, options *CloudLinksClientGetOptions) (CloudLinksClientGetResponse, error) { var err error @@ -262,7 +264,7 @@ func (client *CloudLinksClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,9 +279,9 @@ func (client *CloudLinksClient) getHandleResponse(resp *http.Response) (CloudLin return result, nil } -// NewListPager - List cloud link in a private cloud +// NewListPager - List CloudLink resources by PrivateCloud // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - CloudLinksClientListOptions contains the optional parameters for the CloudLinksClient.NewListPager method. @@ -326,7 +328,7 @@ func (client *CloudLinksClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,7 +337,7 @@ func (client *CloudLinksClient) listCreateRequest(ctx context.Context, resourceG // listHandleResponse handles the List response. func (client *CloudLinksClient) listHandleResponse(resp *http.Response) (CloudLinksClientListResponse, error) { result := CloudLinksClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudLinkList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.CloudLinkListResult); err != nil { return CloudLinksClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/avs/armavs/cloudlinks_client_example_test.go b/sdk/resourcemanager/avs/armavs/cloudlinks_client_example_test.go deleted file mode 100644 index 9a61601e4ad5..000000000000 --- a/sdk/resourcemanager/avs/armavs/cloudlinks_client_example_test.go +++ /dev/null @@ -1,143 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/CloudLinks_List.json -func ExampleCloudLinksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudLinksClient().NewListPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudLinkList = armavs.CloudLinkList{ - // Value: []*armavs.CloudLink{ - // { - // Name: to.Ptr("cloudLink1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/cloudLinks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1"), - // Properties: &armavs.CloudLinkProperties{ - // LinkedCloud: to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"), - // Status: to.Ptr(armavs.CloudLinkStatusActive), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/CloudLinks_Get.json -func ExampleCloudLinksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudLinksClient().Get(ctx, "group1", "cloud1", "cloudLink1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudLink = armavs.CloudLink{ - // Name: to.Ptr("cloudLink1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/cloudLinks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1"), - // Properties: &armavs.CloudLinkProperties{ - // LinkedCloud: to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"), - // Status: to.Ptr(armavs.CloudLinkStatusActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/CloudLinks_CreateOrUpdate.json -func ExampleCloudLinksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudLinksClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "cloudLink1", armavs.CloudLink{ - Properties: &armavs.CloudLinkProperties{ - LinkedCloud: to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudLink = armavs.CloudLink{ - // Name: to.Ptr("cloudLink1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/cloudLinks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1"), - // Properties: &armavs.CloudLinkProperties{ - // LinkedCloud: to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2"), - // Status: to.Ptr(armavs.CloudLinkStatusActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/CloudLinks_Delete.json -func ExampleCloudLinksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudLinksClient().BeginDelete(ctx, "group1", "cloud1", "cloudLink1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/avs/armavs/clusters_client.go b/sdk/resourcemanager/avs/armavs/clusters_client.go index 00e9567ec456..d5ef5d64f265 100644 --- a/sdk/resourcemanager/avs/armavs/clusters_client.go +++ b/sdk/resourcemanager/avs/armavs/clusters_client.go @@ -43,14 +43,14 @@ func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } -// BeginCreateOrUpdate - Create or update a cluster in a private cloud +// BeginCreateOrUpdate - Create a Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - privateCloudName - The name of the private cloud. -// - clusterName - Name of the cluster in the private cloud -// - cluster - A cluster in the private cloud +// - privateCloudName - Name of the private cloud +// - clusterName - Name of the cluster +// - cluster - Resource create parameters. // - options - ClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ClustersClient.BeginCreateOrUpdate // method. func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, cluster Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClustersClientCreateOrUpdateResponse], error) { @@ -60,7 +60,8 @@ func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,10 +71,10 @@ func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceG } } -// CreateOrUpdate - Create or update a cluster in a private cloud +// CreateOrUpdate - Create a Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *ClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, cluster Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ClustersClient.BeginCreateOrUpdate" @@ -119,7 +120,7 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cluster); err != nil { @@ -128,13 +129,13 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r return req, nil } -// BeginDelete - Delete a cluster in a private cloud +// BeginDelete - Delete a Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud +// - clusterName - Name of the cluster // - options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*runtime.Poller[ClustersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -143,7 +144,8 @@ func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -153,10 +155,10 @@ func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName } } -// Delete - Delete a cluster in a private cloud +// Delete - Delete a Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ClustersClient.BeginDelete" @@ -202,19 +204,19 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get a cluster by name in a private cloud +// Get - Get a Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud +// - clusterName - Name of the cluster // - options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. func (client *ClustersClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, options *ClustersClientGetOptions) (ClustersClientGetResponse, error) { var err error @@ -262,7 +264,7 @@ func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,9 +279,9 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl return result, nil } -// NewListPager - List clusters in a private cloud +// NewListPager - List Cluster resources by PrivateCloud // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - ClustersClientListOptions contains the optional parameters for the ClustersClient.NewListPager method. @@ -326,7 +328,7 @@ func (client *ClustersClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,7 +337,7 @@ func (client *ClustersClient) listCreateRequest(ctx context.Context, resourceGro // listHandleResponse handles the List response. func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersClientListResponse, error) { result := ClustersClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.ClusterListResult); err != nil { return ClustersClientListResponse{}, err } return result, nil @@ -344,10 +346,10 @@ func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersC // ListZones - List hosts by zone in a cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud +// - clusterName - Name of the cluster // - options - ClustersClientListZonesOptions contains the optional parameters for the ClustersClient.ListZones method. func (client *ClustersClient) ListZones(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, options *ClustersClientListZonesOptions) (ClustersClientListZonesResponse, error) { var err error @@ -395,7 +397,7 @@ func (client *ClustersClient) listZonesCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -410,14 +412,14 @@ func (client *ClustersClient) listZonesHandleResponse(resp *http.Response) (Clus return result, nil } -// BeginUpdate - Update a cluster in a private cloud +// BeginUpdate - Update a Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud -// - clusterUpdate - The cluster properties to be updated +// - clusterName - Name of the cluster +// - clusterUpdate - The cluster properties to be updated. // - options - ClustersClientBeginUpdateOptions contains the optional parameters for the ClustersClient.BeginUpdate method. func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, clusterUpdate ClusterUpdate, options *ClustersClientBeginUpdateOptions) (*runtime.Poller[ClustersClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { @@ -426,7 +428,8 @@ func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -436,10 +439,10 @@ func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName } } -// Update - Update a cluster in a private cloud +// Update - Update a Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *ClustersClient) update(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, clusterUpdate ClusterUpdate, options *ClustersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ClustersClient.BeginUpdate" @@ -485,7 +488,7 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, clusterUpdate); err != nil { diff --git a/sdk/resourcemanager/avs/armavs/clusters_client_example_test.go b/sdk/resourcemanager/avs/armavs/clusters_client_example_test.go deleted file mode 100644 index a6d14db78421..000000000000 --- a/sdk/resourcemanager/avs/armavs/clusters_client_example_test.go +++ /dev/null @@ -1,280 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_List.json -func ExampleClustersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterList = armavs.ClusterList{ - // Value: []*armavs.Cluster{ - // { - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1"), - // Properties: &armavs.ClusterProperties{ - // ClusterSize: to.Ptr[int32](3), - // Hosts: []*string{ - // to.Ptr("fakehost22.nyc1.kubernetes.center"), - // to.Ptr("fakehost23.nyc1.kubernetes.center"), - // to.Ptr("fakehost24.nyc1.kubernetes.center")}, - // ProvisioningState: to.Ptr(armavs.ClusterProvisioningStateSucceeded), - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV20"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_Get.json -func ExampleClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Get(ctx, "group1", "cloud1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armavs.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1"), - // Properties: &armavs.ClusterProperties{ - // ClusterSize: to.Ptr[int32](4), - // Hosts: []*string{ - // to.Ptr("fakehost22.nyc1.kubernetes.center"), - // to.Ptr("fakehost23.nyc1.kubernetes.center"), - // to.Ptr("fakehost24.nyc1.kubernetes.center"), - // to.Ptr("fakehost25.nyc1.kubernetes.center")}, - // ProvisioningState: to.Ptr(armavs.ClusterProvisioningStateSucceeded), - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV20"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_CreateOrUpdate.json -func ExampleClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "cluster1", armavs.Cluster{ - Properties: &armavs.ClusterProperties{ - ClusterSize: to.Ptr[int32](3), - }, - SKU: &armavs.SKU{ - Name: to.Ptr("AV20"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armavs.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1"), - // Properties: &armavs.ClusterProperties{ - // ClusterSize: to.Ptr[int32](3), - // Hosts: []*string{ - // to.Ptr("fakehost22.nyc1.kubernetes.center"), - // to.Ptr("fakehost23.nyc1.kubernetes.center"), - // to.Ptr("fakehost24.nyc1.kubernetes.center")}, - // ProvisioningState: to.Ptr(armavs.ClusterProvisioningStateSucceeded), - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV20"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_Update.json -func ExampleClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpdate(ctx, "group1", "cloud1", "cluster1", armavs.ClusterUpdate{ - Properties: &armavs.ClusterUpdateProperties{ - ClusterSize: to.Ptr[int32](4), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armavs.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1"), - // Properties: &armavs.ClusterProperties{ - // ClusterSize: to.Ptr[int32](4), - // Hosts: []*string{ - // to.Ptr("fakehost22.nyc1.kubernetes.center"), - // to.Ptr("fakehost23.nyc1.kubernetes.center"), - // to.Ptr("fakehost24.nyc1.kubernetes.center"), - // to.Ptr("fakehost25.nyc1.kubernetes.center")}, - // ProvisioningState: to.Ptr(armavs.ClusterProvisioningStateSucceeded), - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV20"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_Delete.json -func ExampleClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginDelete(ctx, "group1", "cloud1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_ListZones.json -func ExampleClustersClient_ListZones_clustersListZoneData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().ListZones(ctx, "group1", "cloud1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterZoneList = armavs.ClusterZoneList{ - // Zones: []*armavs.ClusterZone{ - // { - // Hosts: []*string{ - // to.Ptr("fakehost22.nyc1.kubernetes.center"), - // to.Ptr("fakehost23.nyc1.kubernetes.center"), - // to.Ptr("fakehost24.nyc1.kubernetes.center")}, - // Zone: to.Ptr("2"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Clusters_ListZones_Stretched.json -func ExampleClustersClient_ListZones_clustersListZoneDataStretched() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().ListZones(ctx, "group1", "cloud1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterZoneList = armavs.ClusterZoneList{ - // Zones: []*armavs.ClusterZone{ - // { - // Hosts: []*string{ - // to.Ptr("fakehost22.nyc1.kubernetes.center"), - // to.Ptr("fakehost23.nyc1.kubernetes.center"), - // to.Ptr("fakehost24.nyc1.kubernetes.center")}, - // Zone: to.Ptr("2"), - // }, - // { - // Hosts: []*string{ - // to.Ptr("fakehost74.nyc2.kubernetes.center"), - // to.Ptr("fakehost75.nyc2.kubernetes.center"), - // to.Ptr("fakehost76.nyc2.kubernetes.center")}, - // Zone: to.Ptr("1"), - // }}, - // } -} diff --git a/sdk/resourcemanager/avs/armavs/constants.go b/sdk/resourcemanager/avs/armavs/constants.go index c6786580cdac..b24eb1d783b5 100644 --- a/sdk/resourcemanager/avs/armavs/constants.go +++ b/sdk/resourcemanager/avs/armavs/constants.go @@ -10,20 +10,41 @@ package armavs const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" - moduleVersion = "v1.4.0" + moduleVersion = "v2.0.0" ) -// AddonProvisioningState - The state of the addon provisioning +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +type ActionType string + +const ( + ActionTypeInternal ActionType = "Internal" +) + +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeInternal, + } +} + +// AddonProvisioningState - Addon provisioning state type AddonProvisioningState string const ( - AddonProvisioningStateBuilding AddonProvisioningState = "Building" - AddonProvisioningStateCanceled AddonProvisioningState = "Canceled" + // AddonProvisioningStateBuilding - is building + AddonProvisioningStateBuilding AddonProvisioningState = "Building" + // AddonProvisioningStateCanceled - Resource creation was canceled. + AddonProvisioningStateCanceled AddonProvisioningState = "Canceled" + // AddonProvisioningStateCancelled - is cancelled AddonProvisioningStateCancelled AddonProvisioningState = "Cancelled" - AddonProvisioningStateDeleting AddonProvisioningState = "Deleting" - AddonProvisioningStateFailed AddonProvisioningState = "Failed" + // AddonProvisioningStateDeleting - is deleting + AddonProvisioningStateDeleting AddonProvisioningState = "Deleting" + // AddonProvisioningStateFailed - Resource creation failed. + AddonProvisioningStateFailed AddonProvisioningState = "Failed" + // AddonProvisioningStateSucceeded - Resource has been created. AddonProvisioningStateSucceeded AddonProvisioningState = "Succeeded" - AddonProvisioningStateUpdating AddonProvisioningState = "Updating" + // AddonProvisioningStateUpdating - is updating + AddonProvisioningStateUpdating AddonProvisioningState = "Updating" ) // PossibleAddonProvisioningStateValues returns the possible values for the AddonProvisioningState const type. @@ -39,7 +60,7 @@ func PossibleAddonProvisioningStateValues() []AddonProvisioningState { } } -// AddonType - The type of private cloud addon +// AddonType - Addon type type AddonType string const ( @@ -59,11 +80,13 @@ func PossibleAddonTypeValues() []AddonType { } } -// AffinityStrength - VM-Host placement policy affinity strength (should/must) +// AffinityStrength - Affinity Strength type AffinityStrength string const ( - AffinityStrengthMust AffinityStrength = "Must" + // AffinityStrengthMust - is must + AffinityStrengthMust AffinityStrength = "Must" + // AffinityStrengthShould - is should AffinityStrengthShould AffinityStrength = "Should" ) @@ -75,11 +98,13 @@ func PossibleAffinityStrengthValues() []AffinityStrength { } } -// AffinityType - Placement policy affinity type +// AffinityType - Affinity type type AffinityType string const ( - AffinityTypeAffinity AffinityType = "Affinity" + // AffinityTypeAffinity - is affinity + AffinityTypeAffinity AffinityType = "Affinity" + // AffinityTypeAntiAffinity - is anti-affinity AffinityTypeAntiAffinity AffinityType = "AntiAffinity" ) @@ -91,11 +116,13 @@ func PossibleAffinityTypeValues() []AffinityType { } } -// AvailabilityStrategy - The availability strategy for the private cloud +// AvailabilityStrategy - Whether the private clouds is available in a single zone or two zones type AvailabilityStrategy string const ( - AvailabilityStrategyDualZone AvailabilityStrategy = "DualZone" + // AvailabilityStrategyDualZone - in two zones + AvailabilityStrategyDualZone AvailabilityStrategy = "DualZone" + // AvailabilityStrategySingleZone - in single zone AvailabilityStrategySingleZone AvailabilityStrategy = "SingleZone" ) @@ -107,11 +134,13 @@ func PossibleAvailabilityStrategyValues() []AvailabilityStrategy { } } -// AzureHybridBenefitType - Placement policy hosts opt-in Azure Hybrid Benefit type +// AzureHybridBenefitType - Azure Hybrid Benefit type type AzureHybridBenefitType string const ( - AzureHybridBenefitTypeNone AzureHybridBenefitType = "None" + // AzureHybridBenefitTypeNone - is None + AzureHybridBenefitTypeNone AzureHybridBenefitType = "None" + // AzureHybridBenefitTypeSQLHost - is SqlHost AzureHybridBenefitTypeSQLHost AzureHybridBenefitType = "SqlHost" ) @@ -123,15 +152,41 @@ func PossibleAzureHybridBenefitTypeValues() []AzureHybridBenefitType { } } -// CloudLinkStatus - The state of the cloud link. +// CloudLinkProvisioningState - cloud link provisioning state +type CloudLinkProvisioningState string + +const ( + // CloudLinkProvisioningStateCanceled - Resource creation was canceled. + CloudLinkProvisioningStateCanceled CloudLinkProvisioningState = "Canceled" + // CloudLinkProvisioningStateFailed - Resource creation failed. + CloudLinkProvisioningStateFailed CloudLinkProvisioningState = "Failed" + // CloudLinkProvisioningStateSucceeded - Resource has been created. + CloudLinkProvisioningStateSucceeded CloudLinkProvisioningState = "Succeeded" +) + +// PossibleCloudLinkProvisioningStateValues returns the possible values for the CloudLinkProvisioningState const type. +func PossibleCloudLinkProvisioningStateValues() []CloudLinkProvisioningState { + return []CloudLinkProvisioningState{ + CloudLinkProvisioningStateCanceled, + CloudLinkProvisioningStateFailed, + CloudLinkProvisioningStateSucceeded, + } +} + +// CloudLinkStatus - Cloud Link status type CloudLinkStatus string const ( - CloudLinkStatusActive CloudLinkStatus = "Active" - CloudLinkStatusBuilding CloudLinkStatus = "Building" - CloudLinkStatusDeleting CloudLinkStatus = "Deleting" + // CloudLinkStatusActive - is active + CloudLinkStatusActive CloudLinkStatus = "Active" + // CloudLinkStatusBuilding - is building + CloudLinkStatusBuilding CloudLinkStatus = "Building" + // CloudLinkStatusDeleting - is deleting + CloudLinkStatusDeleting CloudLinkStatus = "Deleting" + // CloudLinkStatusDisconnected - is disconnected CloudLinkStatusDisconnected CloudLinkStatus = "Disconnected" - CloudLinkStatusFailed CloudLinkStatus = "Failed" + // CloudLinkStatusFailed - is failed + CloudLinkStatusFailed CloudLinkStatus = "Failed" ) // PossibleCloudLinkStatusValues returns the possible values for the CloudLinkStatus const type. @@ -145,16 +200,22 @@ func PossibleCloudLinkStatusValues() []CloudLinkStatus { } } -// ClusterProvisioningState - The state of the cluster provisioning +// ClusterProvisioningState - Cluster provisioning state type ClusterProvisioningState string const ( - ClusterProvisioningStateCanceled ClusterProvisioningState = "Canceled" + // ClusterProvisioningStateCanceled - Resource creation was canceled. + ClusterProvisioningStateCanceled ClusterProvisioningState = "Canceled" + // ClusterProvisioningStateCancelled - is cancelled ClusterProvisioningStateCancelled ClusterProvisioningState = "Cancelled" - ClusterProvisioningStateDeleting ClusterProvisioningState = "Deleting" - ClusterProvisioningStateFailed ClusterProvisioningState = "Failed" + // ClusterProvisioningStateDeleting - is deleting + ClusterProvisioningStateDeleting ClusterProvisioningState = "Deleting" + // ClusterProvisioningStateFailed - Resource creation failed. + ClusterProvisioningStateFailed ClusterProvisioningState = "Failed" + // ClusterProvisioningStateSucceeded - Resource has been created. ClusterProvisioningStateSucceeded ClusterProvisioningState = "Succeeded" - ClusterProvisioningStateUpdating ClusterProvisioningState = "Updating" + // ClusterProvisioningStateUpdating - is updating + ClusterProvisioningStateUpdating ClusterProvisioningState = "Updating" ) // PossibleClusterProvisioningStateValues returns the possible values for the ClusterProvisioningState const type. @@ -169,14 +230,39 @@ func PossibleClusterProvisioningStateValues() []ClusterProvisioningState { } } -// DNSServiceLogLevelEnum - DNS Service log level. +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// DNSServiceLogLevelEnum - DNS service log level type DNSServiceLogLevelEnum string const ( - DNSServiceLogLevelEnumDEBUG DNSServiceLogLevelEnum = "DEBUG" - DNSServiceLogLevelEnumERROR DNSServiceLogLevelEnum = "ERROR" - DNSServiceLogLevelEnumFATAL DNSServiceLogLevelEnum = "FATAL" - DNSServiceLogLevelEnumINFO DNSServiceLogLevelEnum = "INFO" + // DNSServiceLogLevelEnumDEBUG - is debug + DNSServiceLogLevelEnumDEBUG DNSServiceLogLevelEnum = "DEBUG" + // DNSServiceLogLevelEnumERROR - is error + DNSServiceLogLevelEnumERROR DNSServiceLogLevelEnum = "ERROR" + // DNSServiceLogLevelEnumFATAL - is fatal + DNSServiceLogLevelEnumFATAL DNSServiceLogLevelEnum = "FATAL" + // DNSServiceLogLevelEnumINFO - is info + DNSServiceLogLevelEnumINFO DNSServiceLogLevelEnum = "INFO" + // DNSServiceLogLevelEnumWARNING - is warning DNSServiceLogLevelEnumWARNING DNSServiceLogLevelEnum = "WARNING" ) @@ -191,11 +277,13 @@ func PossibleDNSServiceLogLevelEnumValues() []DNSServiceLogLevelEnum { } } -// DNSServiceStatusEnum - DNS Service status. +// DNSServiceStatusEnum - DNS service status type DNSServiceStatusEnum string const ( + // DNSServiceStatusEnumFAILURE - is failure DNSServiceStatusEnumFAILURE DNSServiceStatusEnum = "FAILURE" + // DNSServiceStatusEnumSUCCESS - is success DNSServiceStatusEnumSUCCESS DNSServiceStatusEnum = "SUCCESS" ) @@ -207,18 +295,44 @@ func PossibleDNSServiceStatusEnumValues() []DNSServiceStatusEnum { } } -// DatastoreProvisioningState - The state of the datastore provisioning +// DNSZoneType - The type of DNS zone. +type DNSZoneType string + +const ( + // DNSZoneTypePrivate - Private DNS zone. + DNSZoneTypePrivate DNSZoneType = "Private" + // DNSZoneTypePublic - Primary DNS zone. + DNSZoneTypePublic DNSZoneType = "Public" +) + +// PossibleDNSZoneTypeValues returns the possible values for the DNSZoneType const type. +func PossibleDNSZoneTypeValues() []DNSZoneType { + return []DNSZoneType{ + DNSZoneTypePrivate, + DNSZoneTypePublic, + } +} + +// DatastoreProvisioningState - datastore provisioning state type DatastoreProvisioningState string const ( - DatastoreProvisioningStateCanceled DatastoreProvisioningState = "Canceled" + // DatastoreProvisioningStateCanceled - Resource creation was canceled. + DatastoreProvisioningStateCanceled DatastoreProvisioningState = "Canceled" + // DatastoreProvisioningStateCancelled - is cancelled DatastoreProvisioningStateCancelled DatastoreProvisioningState = "Cancelled" - DatastoreProvisioningStateCreating DatastoreProvisioningState = "Creating" - DatastoreProvisioningStateDeleting DatastoreProvisioningState = "Deleting" - DatastoreProvisioningStateFailed DatastoreProvisioningState = "Failed" - DatastoreProvisioningStatePending DatastoreProvisioningState = "Pending" + // DatastoreProvisioningStateCreating - is creating + DatastoreProvisioningStateCreating DatastoreProvisioningState = "Creating" + // DatastoreProvisioningStateDeleting - is deleting + DatastoreProvisioningStateDeleting DatastoreProvisioningState = "Deleting" + // DatastoreProvisioningStateFailed - Resource creation failed. + DatastoreProvisioningStateFailed DatastoreProvisioningState = "Failed" + // DatastoreProvisioningStatePending - is pending + DatastoreProvisioningStatePending DatastoreProvisioningState = "Pending" + // DatastoreProvisioningStateSucceeded - Resource has been created. DatastoreProvisioningStateSucceeded DatastoreProvisioningState = "Succeeded" - DatastoreProvisioningStateUpdating DatastoreProvisioningState = "Updating" + // DatastoreProvisioningStateUpdating - is updating + DatastoreProvisioningStateUpdating DatastoreProvisioningState = "Updating" ) // PossibleDatastoreProvisioningStateValues returns the possible values for the DatastoreProvisioningState const type. @@ -235,17 +349,24 @@ func PossibleDatastoreProvisioningStateValues() []DatastoreProvisioningState { } } -// DatastoreStatus - The operational status of the datastore +// DatastoreStatus - datastore status type DatastoreStatus string const ( - DatastoreStatusAccessible DatastoreStatus = "Accessible" - DatastoreStatusAttached DatastoreStatus = "Attached" - DatastoreStatusDeadOrError DatastoreStatus = "DeadOrError" - DatastoreStatusDetached DatastoreStatus = "Detached" - DatastoreStatusInaccessible DatastoreStatus = "Inaccessible" + // DatastoreStatusAccessible - is accessible + DatastoreStatusAccessible DatastoreStatus = "Accessible" + // DatastoreStatusAttached - is attached + DatastoreStatusAttached DatastoreStatus = "Attached" + // DatastoreStatusDeadOrError - is dead or error + DatastoreStatusDeadOrError DatastoreStatus = "DeadOrError" + // DatastoreStatusDetached - is detached + DatastoreStatusDetached DatastoreStatus = "Detached" + // DatastoreStatusInaccessible - is inaccessible + DatastoreStatusInaccessible DatastoreStatus = "Inaccessible" + // DatastoreStatusLostCommunication - is lost communication DatastoreStatusLostCommunication DatastoreStatus = "LostCommunication" - DatastoreStatusUnknown DatastoreStatus = "Unknown" + // DatastoreStatusUnknown - is unknown + DatastoreStatusUnknown DatastoreStatus = "Unknown" ) // PossibleDatastoreStatusValues returns the possible values for the DatastoreStatus const type. @@ -277,12 +398,14 @@ func PossibleDhcpTypeEnumValues() []DhcpTypeEnum { } } -// EncryptionKeyStatus - The state of key provided +// EncryptionKeyStatus - Whether the the encryption key is connected or access denied type EncryptionKeyStatus string const ( + // EncryptionKeyStatusAccessDenied - is access denied EncryptionKeyStatusAccessDenied EncryptionKeyStatus = "AccessDenied" - EncryptionKeyStatusConnected EncryptionKeyStatus = "Connected" + // EncryptionKeyStatusConnected - is connected + EncryptionKeyStatusConnected EncryptionKeyStatus = "Connected" ) // PossibleEncryptionKeyStatusValues returns the possible values for the EncryptionKeyStatus const type. @@ -293,12 +416,14 @@ func PossibleEncryptionKeyStatusValues() []EncryptionKeyStatus { } } -// EncryptionState - Status of customer managed encryption key +// EncryptionState - Whether encryption is enabled or disabled type EncryptionState string const ( + // EncryptionStateDisabled - is disabled EncryptionStateDisabled EncryptionState = "Disabled" - EncryptionStateEnabled EncryptionState = "Enabled" + // EncryptionStateEnabled - is enabled + EncryptionStateEnabled EncryptionState = "Enabled" ) // PossibleEncryptionStateValues returns the possible values for the EncryptionState const type. @@ -309,12 +434,14 @@ func PossibleEncryptionStateValues() []EncryptionState { } } -// EncryptionVersionType - Property of the key if user provided or auto detected +// EncryptionVersionType - Whether the encryption version is fixed or auto-detected type EncryptionVersionType string const ( + // EncryptionVersionTypeAutoDetected - is auto-detected EncryptionVersionTypeAutoDetected EncryptionVersionType = "AutoDetected" - EncryptionVersionTypeFixed EncryptionVersionType = "Fixed" + // EncryptionVersionTypeFixed - is fixed + EncryptionVersionTypeFixed EncryptionVersionType = "Fixed" ) // PossibleEncryptionVersionTypeValues returns the possible values for the EncryptionVersionType const type. @@ -325,14 +452,18 @@ func PossibleEncryptionVersionTypeValues() []EncryptionVersionType { } } -// ExpressRouteAuthorizationProvisioningState - The state of the ExpressRoute Circuit Authorization provisioning +// ExpressRouteAuthorizationProvisioningState - Express Route Circuit Authorization provisioning state type ExpressRouteAuthorizationProvisioningState string const ( - ExpressRouteAuthorizationProvisioningStateCanceled ExpressRouteAuthorizationProvisioningState = "Canceled" - ExpressRouteAuthorizationProvisioningStateFailed ExpressRouteAuthorizationProvisioningState = "Failed" + // ExpressRouteAuthorizationProvisioningStateCanceled - Resource creation was canceled. + ExpressRouteAuthorizationProvisioningStateCanceled ExpressRouteAuthorizationProvisioningState = "Canceled" + // ExpressRouteAuthorizationProvisioningStateFailed - Resource creation failed. + ExpressRouteAuthorizationProvisioningStateFailed ExpressRouteAuthorizationProvisioningState = "Failed" + // ExpressRouteAuthorizationProvisioningStateSucceeded - Resource has been created. ExpressRouteAuthorizationProvisioningStateSucceeded ExpressRouteAuthorizationProvisioningState = "Succeeded" - ExpressRouteAuthorizationProvisioningStateUpdating ExpressRouteAuthorizationProvisioningState = "Updating" + // ExpressRouteAuthorizationProvisioningStateUpdating - is updating + ExpressRouteAuthorizationProvisioningStateUpdating ExpressRouteAuthorizationProvisioningState = "Updating" ) // PossibleExpressRouteAuthorizationProvisioningStateValues returns the possible values for the ExpressRouteAuthorizationProvisioningState const type. @@ -345,14 +476,18 @@ func PossibleExpressRouteAuthorizationProvisioningStateValues() []ExpressRouteAu } } -// GlobalReachConnectionProvisioningState - The state of the ExpressRoute Circuit Authorization provisioning +// GlobalReachConnectionProvisioningState - Global Reach Connection provisioning state type GlobalReachConnectionProvisioningState string const ( - GlobalReachConnectionProvisioningStateCanceled GlobalReachConnectionProvisioningState = "Canceled" - GlobalReachConnectionProvisioningStateFailed GlobalReachConnectionProvisioningState = "Failed" + // GlobalReachConnectionProvisioningStateCanceled - Resource creation was canceled. + GlobalReachConnectionProvisioningStateCanceled GlobalReachConnectionProvisioningState = "Canceled" + // GlobalReachConnectionProvisioningStateFailed - Resource creation failed. + GlobalReachConnectionProvisioningStateFailed GlobalReachConnectionProvisioningState = "Failed" + // GlobalReachConnectionProvisioningStateSucceeded - Resource has been created. GlobalReachConnectionProvisioningStateSucceeded GlobalReachConnectionProvisioningState = "Succeeded" - GlobalReachConnectionProvisioningStateUpdating GlobalReachConnectionProvisioningState = "Updating" + // GlobalReachConnectionProvisioningStateUpdating - is updating + GlobalReachConnectionProvisioningStateUpdating GlobalReachConnectionProvisioningState = "Updating" ) // PossibleGlobalReachConnectionProvisioningStateValues returns the possible values for the GlobalReachConnectionProvisioningState const type. @@ -365,12 +500,15 @@ func PossibleGlobalReachConnectionProvisioningStateValues() []GlobalReachConnect } } -// GlobalReachConnectionStatus - The connection status of the global reach connection +// GlobalReachConnectionStatus - Global Reach Connection status type GlobalReachConnectionStatus string const ( - GlobalReachConnectionStatusConnected GlobalReachConnectionStatus = "Connected" - GlobalReachConnectionStatusConnecting GlobalReachConnectionStatus = "Connecting" + // GlobalReachConnectionStatusConnected - is connected + GlobalReachConnectionStatusConnected GlobalReachConnectionStatus = "Connected" + // GlobalReachConnectionStatusConnecting - is connecting + GlobalReachConnectionStatusConnecting GlobalReachConnectionStatus = "Connecting" + // GlobalReachConnectionStatusDisconnected - is disconnected GlobalReachConnectionStatusDisconnected GlobalReachConnectionStatus = "Disconnected" ) @@ -383,14 +521,39 @@ func PossibleGlobalReachConnectionStatusValues() []GlobalReachConnectionStatus { } } -// HcxEnterpriseSiteStatus - The status of the HCX Enterprise Site +// HcxEnterpriseSiteProvisioningState - HCX Enterprise Site provisioning state +type HcxEnterpriseSiteProvisioningState string + +const ( + // HcxEnterpriseSiteProvisioningStateCanceled - Resource creation was canceled. + HcxEnterpriseSiteProvisioningStateCanceled HcxEnterpriseSiteProvisioningState = "Canceled" + // HcxEnterpriseSiteProvisioningStateFailed - Resource creation failed. + HcxEnterpriseSiteProvisioningStateFailed HcxEnterpriseSiteProvisioningState = "Failed" + // HcxEnterpriseSiteProvisioningStateSucceeded - Resource has been created. + HcxEnterpriseSiteProvisioningStateSucceeded HcxEnterpriseSiteProvisioningState = "Succeeded" +) + +// PossibleHcxEnterpriseSiteProvisioningStateValues returns the possible values for the HcxEnterpriseSiteProvisioningState const type. +func PossibleHcxEnterpriseSiteProvisioningStateValues() []HcxEnterpriseSiteProvisioningState { + return []HcxEnterpriseSiteProvisioningState{ + HcxEnterpriseSiteProvisioningStateCanceled, + HcxEnterpriseSiteProvisioningStateFailed, + HcxEnterpriseSiteProvisioningStateSucceeded, + } +} + +// HcxEnterpriseSiteStatus - HCX Enterprise Site status type HcxEnterpriseSiteStatus string const ( - HcxEnterpriseSiteStatusAvailable HcxEnterpriseSiteStatus = "Available" - HcxEnterpriseSiteStatusConsumed HcxEnterpriseSiteStatus = "Consumed" + // HcxEnterpriseSiteStatusAvailable - is available + HcxEnterpriseSiteStatusAvailable HcxEnterpriseSiteStatus = "Available" + // HcxEnterpriseSiteStatusConsumed - is consumed + HcxEnterpriseSiteStatusConsumed HcxEnterpriseSiteStatus = "Consumed" + // HcxEnterpriseSiteStatusDeactivated - is deactivated HcxEnterpriseSiteStatusDeactivated HcxEnterpriseSiteStatus = "Deactivated" - HcxEnterpriseSiteStatusDeleted HcxEnterpriseSiteStatus = "Deleted" + // HcxEnterpriseSiteStatusDeleted - is deleted + HcxEnterpriseSiteStatusDeleted HcxEnterpriseSiteStatus = "Deleted" ) // PossibleHcxEnterpriseSiteStatusValues returns the possible values for the HcxEnterpriseSiteStatus const type. @@ -403,12 +566,14 @@ func PossibleHcxEnterpriseSiteStatusValues() []HcxEnterpriseSiteStatus { } } -// InternetEnum - Connectivity to internet is enabled or disabled +// InternetEnum - Whether internet is enabled or disabled type InternetEnum string const ( + // InternetEnumDisabled - is disabled InternetEnumDisabled InternetEnum = "Disabled" - InternetEnumEnabled InternetEnum = "Enabled" + // InternetEnumEnabled - is enabled + InternetEnumEnabled InternetEnum = "Enabled" ) // PossibleInternetEnumValues returns the possible values for the InternetEnum const type. @@ -419,12 +584,47 @@ func PossibleInternetEnumValues() []InternetEnum { } } +// IscsiPathProvisioningState - private cloud provisioning state +type IscsiPathProvisioningState string + +const ( + // IscsiPathProvisioningStateBuilding - is building + IscsiPathProvisioningStateBuilding IscsiPathProvisioningState = "Building" + // IscsiPathProvisioningStateCanceled - Resource creation was canceled. + IscsiPathProvisioningStateCanceled IscsiPathProvisioningState = "Canceled" + // IscsiPathProvisioningStateDeleting - is deleting + IscsiPathProvisioningStateDeleting IscsiPathProvisioningState = "Deleting" + // IscsiPathProvisioningStateFailed - Resource creation failed. + IscsiPathProvisioningStateFailed IscsiPathProvisioningState = "Failed" + // IscsiPathProvisioningStatePending - is pending + IscsiPathProvisioningStatePending IscsiPathProvisioningState = "Pending" + // IscsiPathProvisioningStateSucceeded - Resource has been created. + IscsiPathProvisioningStateSucceeded IscsiPathProvisioningState = "Succeeded" + // IscsiPathProvisioningStateUpdating - is updating + IscsiPathProvisioningStateUpdating IscsiPathProvisioningState = "Updating" +) + +// PossibleIscsiPathProvisioningStateValues returns the possible values for the IscsiPathProvisioningState const type. +func PossibleIscsiPathProvisioningStateValues() []IscsiPathProvisioningState { + return []IscsiPathProvisioningState{ + IscsiPathProvisioningStateBuilding, + IscsiPathProvisioningStateCanceled, + IscsiPathProvisioningStateDeleting, + IscsiPathProvisioningStateFailed, + IscsiPathProvisioningStatePending, + IscsiPathProvisioningStateSucceeded, + IscsiPathProvisioningStateUpdating, + } +} + // MountOptionEnum - Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN type MountOptionEnum string const ( + // MountOptionEnumATTACH - is attach MountOptionEnumATTACH MountOptionEnum = "ATTACH" - MountOptionEnumMOUNT MountOptionEnum = "MOUNT" + // MountOptionEnumMOUNT - is mount + MountOptionEnumMOUNT MountOptionEnum = "MOUNT" ) // PossibleMountOptionEnumValues returns the possible values for the MountOptionEnum const type. @@ -435,13 +635,14 @@ func PossibleMountOptionEnumValues() []MountOptionEnum { } } -// NsxPublicIPQuotaRaisedEnum - Flag to indicate whether the private cloud has the quota for provisioned NSX Public IP count -// raised from 64 to 1024 +// NsxPublicIPQuotaRaisedEnum - NSX public IP quota raised type NsxPublicIPQuotaRaisedEnum string const ( + // NsxPublicIPQuotaRaisedEnumDisabled - is disabled NsxPublicIPQuotaRaisedEnumDisabled NsxPublicIPQuotaRaisedEnum = "Disabled" - NsxPublicIPQuotaRaisedEnumEnabled NsxPublicIPQuotaRaisedEnum = "Enabled" + // NsxPublicIPQuotaRaisedEnumEnabled - is enabled + NsxPublicIPQuotaRaisedEnumEnabled NsxPublicIPQuotaRaisedEnum = "Enabled" ) // PossibleNsxPublicIPQuotaRaisedEnumValues returns the possible values for the NsxPublicIPQuotaRaisedEnum const type. @@ -452,11 +653,13 @@ func PossibleNsxPublicIPQuotaRaisedEnumValues() []NsxPublicIPQuotaRaisedEnum { } } -// OptionalParamEnum - Is this parameter required or optional +// OptionalParamEnum - Optional Param type OptionalParamEnum string const ( + // OptionalParamEnumOptional - is optional OptionalParamEnumOptional OptionalParamEnum = "Optional" + // OptionalParamEnumRequired - is required OptionalParamEnumRequired OptionalParamEnum = "Required" ) @@ -468,16 +671,41 @@ func PossibleOptionalParamEnumValues() []OptionalParamEnum { } } -// PlacementPolicyProvisioningState - The provisioning state +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string + +const ( + OriginSystem Origin = "system" + OriginUser Origin = "user" + OriginUserSystem Origin = "user,system" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, + } +} + +// PlacementPolicyProvisioningState - Placement Policy provisioning state type PlacementPolicyProvisioningState string const ( - PlacementPolicyProvisioningStateBuilding PlacementPolicyProvisioningState = "Building" - PlacementPolicyProvisioningStateCanceled PlacementPolicyProvisioningState = "Canceled" - PlacementPolicyProvisioningStateDeleting PlacementPolicyProvisioningState = "Deleting" - PlacementPolicyProvisioningStateFailed PlacementPolicyProvisioningState = "Failed" + // PlacementPolicyProvisioningStateBuilding - is building + PlacementPolicyProvisioningStateBuilding PlacementPolicyProvisioningState = "Building" + // PlacementPolicyProvisioningStateCanceled - Resource creation was canceled. + PlacementPolicyProvisioningStateCanceled PlacementPolicyProvisioningState = "Canceled" + // PlacementPolicyProvisioningStateDeleting - is deleting + PlacementPolicyProvisioningStateDeleting PlacementPolicyProvisioningState = "Deleting" + // PlacementPolicyProvisioningStateFailed - Resource creation failed. + PlacementPolicyProvisioningStateFailed PlacementPolicyProvisioningState = "Failed" + // PlacementPolicyProvisioningStateSucceeded - Resource has been created. PlacementPolicyProvisioningStateSucceeded PlacementPolicyProvisioningState = "Succeeded" - PlacementPolicyProvisioningStateUpdating PlacementPolicyProvisioningState = "Updating" + // PlacementPolicyProvisioningStateUpdating - is updating + PlacementPolicyProvisioningStateUpdating PlacementPolicyProvisioningState = "Updating" ) // PossiblePlacementPolicyProvisioningStateValues returns the possible values for the PlacementPolicyProvisioningState const type. @@ -492,12 +720,14 @@ func PossiblePlacementPolicyProvisioningStateValues() []PlacementPolicyProvision } } -// PlacementPolicyState - Whether the placement policy is enabled or disabled +// PlacementPolicyState - Placement Policy state type PlacementPolicyState string const ( + // PlacementPolicyStateDisabled - is disabled PlacementPolicyStateDisabled PlacementPolicyState = "Disabled" - PlacementPolicyStateEnabled PlacementPolicyState = "Enabled" + // PlacementPolicyStateEnabled - is enabled + PlacementPolicyStateEnabled PlacementPolicyState = "Enabled" ) // PossiblePlacementPolicyStateValues returns the possible values for the PlacementPolicyState const type. @@ -508,7 +738,7 @@ func PossiblePlacementPolicyStateValues() []PlacementPolicyState { } } -// PlacementPolicyType - placement policy type +// PlacementPolicyType - Placement Policy type type PlacementPolicyType string const ( @@ -524,13 +754,16 @@ func PossiblePlacementPolicyTypeValues() []PlacementPolicyType { } } -// PortMirroringDirectionEnum - Direction of port mirroring profile. +// PortMirroringDirectionEnum - Port Mirroring Direction type PortMirroringDirectionEnum string const ( + // PortMirroringDirectionEnumBIDIRECTIONAL - is bidirectional PortMirroringDirectionEnumBIDIRECTIONAL PortMirroringDirectionEnum = "BIDIRECTIONAL" - PortMirroringDirectionEnumEGRESS PortMirroringDirectionEnum = "EGRESS" - PortMirroringDirectionEnumINGRESS PortMirroringDirectionEnum = "INGRESS" + // PortMirroringDirectionEnumEGRESS - is egress + PortMirroringDirectionEnumEGRESS PortMirroringDirectionEnum = "EGRESS" + // PortMirroringDirectionEnumINGRESS - is ingress + PortMirroringDirectionEnumINGRESS PortMirroringDirectionEnum = "INGRESS" ) // PossiblePortMirroringDirectionEnumValues returns the possible values for the PortMirroringDirectionEnum const type. @@ -542,11 +775,13 @@ func PossiblePortMirroringDirectionEnumValues() []PortMirroringDirectionEnum { } } -// PortMirroringStatusEnum - Port Mirroring Status. +// PortMirroringStatusEnum - Port Mirroring status type PortMirroringStatusEnum string const ( + // PortMirroringStatusEnumFAILURE - is failure PortMirroringStatusEnumFAILURE PortMirroringStatusEnum = "FAILURE" + // PortMirroringStatusEnumSUCCESS - is success PortMirroringStatusEnumSUCCESS PortMirroringStatusEnum = "SUCCESS" ) @@ -558,18 +793,26 @@ func PossiblePortMirroringStatusEnumValues() []PortMirroringStatusEnum { } } -// PrivateCloudProvisioningState - The provisioning state +// PrivateCloudProvisioningState - private cloud provisioning state type PrivateCloudProvisioningState string const ( - PrivateCloudProvisioningStateBuilding PrivateCloudProvisioningState = "Building" - PrivateCloudProvisioningStateCanceled PrivateCloudProvisioningState = "Canceled" + // PrivateCloudProvisioningStateBuilding - is building + PrivateCloudProvisioningStateBuilding PrivateCloudProvisioningState = "Building" + // PrivateCloudProvisioningStateCanceled - Resource creation was canceled. + PrivateCloudProvisioningStateCanceled PrivateCloudProvisioningState = "Canceled" + // PrivateCloudProvisioningStateCancelled - is cancelled PrivateCloudProvisioningStateCancelled PrivateCloudProvisioningState = "Cancelled" - PrivateCloudProvisioningStateDeleting PrivateCloudProvisioningState = "Deleting" - PrivateCloudProvisioningStateFailed PrivateCloudProvisioningState = "Failed" - PrivateCloudProvisioningStatePending PrivateCloudProvisioningState = "Pending" + // PrivateCloudProvisioningStateDeleting - is deleting + PrivateCloudProvisioningStateDeleting PrivateCloudProvisioningState = "Deleting" + // PrivateCloudProvisioningStateFailed - Resource creation failed. + PrivateCloudProvisioningStateFailed PrivateCloudProvisioningState = "Failed" + // PrivateCloudProvisioningStatePending - is pending + PrivateCloudProvisioningStatePending PrivateCloudProvisioningState = "Pending" + // PrivateCloudProvisioningStateSucceeded - Resource has been created. PrivateCloudProvisioningStateSucceeded PrivateCloudProvisioningState = "Succeeded" - PrivateCloudProvisioningStateUpdating PrivateCloudProvisioningState = "Updating" + // PrivateCloudProvisioningStateUpdating - is updating + PrivateCloudProvisioningStateUpdating PrivateCloudProvisioningState = "Updating" ) // PossiblePrivateCloudProvisioningStateValues returns the possible values for the PrivateCloudProvisioningState const type. @@ -586,12 +829,14 @@ func PossiblePrivateCloudProvisioningStateValues() []PrivateCloudProvisioningSta } } -// QuotaEnabled - Host quota is active for current subscription +// QuotaEnabled - quota enabled type QuotaEnabled string const ( + // QuotaEnabledDisabled - is disabled QuotaEnabledDisabled QuotaEnabled = "Disabled" - QuotaEnabledEnabled QuotaEnabled = "Enabled" + // QuotaEnabledEnabled - is enabled + QuotaEnabledEnabled QuotaEnabled = "Enabled" ) // PossibleQuotaEnabledValues returns the possible values for the QuotaEnabled const type. @@ -602,29 +847,35 @@ func PossibleQuotaEnabledValues() []QuotaEnabled { } } -// ResourceIdentityType - 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. -type ResourceIdentityType string +// SKUTier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but +// is not required on a PUT. +type SKUTier string const ( - ResourceIdentityTypeNone ResourceIdentityType = "None" - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + SKUTierBasic SKUTier = "Basic" + SKUTierFree SKUTier = "Free" + SKUTierPremium SKUTier = "Premium" + SKUTierStandard SKUTier = "Standard" ) -// PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ - ResourceIdentityTypeNone, - ResourceIdentityTypeSystemAssigned, +// PossibleSKUTierValues returns the possible values for the SKUTier const type. +func PossibleSKUTierValues() []SKUTier { + return []SKUTier{ + SKUTierBasic, + SKUTierFree, + SKUTierPremium, + SKUTierStandard, } } -// SSLEnum - Protect LDAP communication using SSL certificate (LDAPS) +// SSLEnum - Whether SSL is enabled or disabled type SSLEnum string const ( + // SSLEnumDisabled - is disabled SSLEnumDisabled SSLEnum = "Disabled" - SSLEnumEnabled SSLEnum = "Enabled" + // SSLEnumEnabled - is enabled + SSLEnumEnabled SSLEnum = "Enabled" ) // PossibleSSLEnumValues returns the possible values for the SSLEnum const type. @@ -635,7 +886,47 @@ func PossibleSSLEnumValues() []SSLEnum { } } -// ScriptExecutionParameterType - The type of execution parameter +// ScriptCmdletAudience - Specifies whether a script cmdlet is intended to be invoked only through automation or visible to +// customers +type ScriptCmdletAudience string + +const ( + // ScriptCmdletAudienceAny - is any + ScriptCmdletAudienceAny ScriptCmdletAudience = "Any" + // ScriptCmdletAudienceAutomation - is automation + ScriptCmdletAudienceAutomation ScriptCmdletAudience = "Automation" +) + +// PossibleScriptCmdletAudienceValues returns the possible values for the ScriptCmdletAudience const type. +func PossibleScriptCmdletAudienceValues() []ScriptCmdletAudience { + return []ScriptCmdletAudience{ + ScriptCmdletAudienceAny, + ScriptCmdletAudienceAutomation, + } +} + +// ScriptCmdletProvisioningState - A script cmdlet provisioning state +type ScriptCmdletProvisioningState string + +const ( + // ScriptCmdletProvisioningStateCanceled - Resource creation was canceled. + ScriptCmdletProvisioningStateCanceled ScriptCmdletProvisioningState = "Canceled" + // ScriptCmdletProvisioningStateFailed - Resource creation failed. + ScriptCmdletProvisioningStateFailed ScriptCmdletProvisioningState = "Failed" + // ScriptCmdletProvisioningStateSucceeded - Resource has been created. + ScriptCmdletProvisioningStateSucceeded ScriptCmdletProvisioningState = "Succeeded" +) + +// PossibleScriptCmdletProvisioningStateValues returns the possible values for the ScriptCmdletProvisioningState const type. +func PossibleScriptCmdletProvisioningStateValues() []ScriptCmdletProvisioningState { + return []ScriptCmdletProvisioningState{ + ScriptCmdletProvisioningStateCanceled, + ScriptCmdletProvisioningStateFailed, + ScriptCmdletProvisioningStateSucceeded, + } +} + +// ScriptExecutionParameterType - script execution parameter type type ScriptExecutionParameterType string const ( @@ -653,18 +944,26 @@ func PossibleScriptExecutionParameterTypeValues() []ScriptExecutionParameterType } } -// ScriptExecutionProvisioningState - The state of the script execution resource +// ScriptExecutionProvisioningState - Script Execution provisioning state type ScriptExecutionProvisioningState string const ( - ScriptExecutionProvisioningStateCanceled ScriptExecutionProvisioningState = "Canceled" - ScriptExecutionProvisioningStateCancelled ScriptExecutionProvisioningState = "Cancelled" + // ScriptExecutionProvisioningStateCanceled - Resource creation was canceled. + ScriptExecutionProvisioningStateCanceled ScriptExecutionProvisioningState = "Canceled" + // ScriptExecutionProvisioningStateCancelled - is cancelled + ScriptExecutionProvisioningStateCancelled ScriptExecutionProvisioningState = "Cancelled" + // ScriptExecutionProvisioningStateCancelling - is cancelling ScriptExecutionProvisioningStateCancelling ScriptExecutionProvisioningState = "Cancelling" - ScriptExecutionProvisioningStateDeleting ScriptExecutionProvisioningState = "Deleting" - ScriptExecutionProvisioningStateFailed ScriptExecutionProvisioningState = "Failed" - ScriptExecutionProvisioningStatePending ScriptExecutionProvisioningState = "Pending" - ScriptExecutionProvisioningStateRunning ScriptExecutionProvisioningState = "Running" - ScriptExecutionProvisioningStateSucceeded ScriptExecutionProvisioningState = "Succeeded" + // ScriptExecutionProvisioningStateDeleting - is deleting + ScriptExecutionProvisioningStateDeleting ScriptExecutionProvisioningState = "Deleting" + // ScriptExecutionProvisioningStateFailed - Resource creation failed. + ScriptExecutionProvisioningStateFailed ScriptExecutionProvisioningState = "Failed" + // ScriptExecutionProvisioningStatePending - is pending + ScriptExecutionProvisioningStatePending ScriptExecutionProvisioningState = "Pending" + // ScriptExecutionProvisioningStateRunning - is running + ScriptExecutionProvisioningStateRunning ScriptExecutionProvisioningState = "Running" + // ScriptExecutionProvisioningStateSucceeded - Resource has been created. + ScriptExecutionProvisioningStateSucceeded ScriptExecutionProvisioningState = "Succeeded" ) // PossibleScriptExecutionProvisioningStateValues returns the possible values for the ScriptExecutionProvisioningState const type. @@ -681,13 +980,18 @@ func PossibleScriptExecutionProvisioningStateValues() []ScriptExecutionProvision } } +// ScriptOutputStreamType - Script Output Stream type type ScriptOutputStreamType string const ( - ScriptOutputStreamTypeError ScriptOutputStreamType = "Error" + // ScriptOutputStreamTypeError - is error + ScriptOutputStreamTypeError ScriptOutputStreamType = "Error" + // ScriptOutputStreamTypeInformation - is information ScriptOutputStreamTypeInformation ScriptOutputStreamType = "Information" - ScriptOutputStreamTypeOutput ScriptOutputStreamType = "Output" - ScriptOutputStreamTypeWarning ScriptOutputStreamType = "Warning" + // ScriptOutputStreamTypeOutput - is output + ScriptOutputStreamTypeOutput ScriptOutputStreamType = "Output" + // ScriptOutputStreamTypeWarning - is warning + ScriptOutputStreamTypeWarning ScriptOutputStreamType = "Warning" ) // PossibleScriptOutputStreamTypeValues returns the possible values for the ScriptOutputStreamType const type. @@ -700,16 +1004,43 @@ func PossibleScriptOutputStreamTypeValues() []ScriptOutputStreamType { } } -// ScriptParameterTypes - The type of parameter the script is expecting. psCredential is a PSCredentialObject +// ScriptPackageProvisioningState - Script Package provisioning state +type ScriptPackageProvisioningState string + +const ( + // ScriptPackageProvisioningStateCanceled - Resource creation was canceled. + ScriptPackageProvisioningStateCanceled ScriptPackageProvisioningState = "Canceled" + // ScriptPackageProvisioningStateFailed - Resource creation failed. + ScriptPackageProvisioningStateFailed ScriptPackageProvisioningState = "Failed" + // ScriptPackageProvisioningStateSucceeded - Resource has been created. + ScriptPackageProvisioningStateSucceeded ScriptPackageProvisioningState = "Succeeded" +) + +// PossibleScriptPackageProvisioningStateValues returns the possible values for the ScriptPackageProvisioningState const type. +func PossibleScriptPackageProvisioningStateValues() []ScriptPackageProvisioningState { + return []ScriptPackageProvisioningState{ + ScriptPackageProvisioningStateCanceled, + ScriptPackageProvisioningStateFailed, + ScriptPackageProvisioningStateSucceeded, + } +} + +// ScriptParameterTypes - Script Parameter types type ScriptParameterTypes string const ( - ScriptParameterTypesBool ScriptParameterTypes = "Bool" - ScriptParameterTypesCredential ScriptParameterTypes = "Credential" - ScriptParameterTypesFloat ScriptParameterTypes = "Float" - ScriptParameterTypesInt ScriptParameterTypes = "Int" + // ScriptParameterTypesBool - is bool + ScriptParameterTypesBool ScriptParameterTypes = "Bool" + // ScriptParameterTypesCredential - is credential + ScriptParameterTypesCredential ScriptParameterTypes = "Credential" + // ScriptParameterTypesFloat - is float + ScriptParameterTypesFloat ScriptParameterTypes = "Float" + // ScriptParameterTypesInt - is int + ScriptParameterTypesInt ScriptParameterTypes = "Int" + // ScriptParameterTypesSecureString - is secure string ScriptParameterTypesSecureString ScriptParameterTypes = "SecureString" - ScriptParameterTypesString ScriptParameterTypes = "String" + // ScriptParameterTypesString - is string + ScriptParameterTypesString ScriptParameterTypes = "String" ) // PossibleScriptParameterTypesValues returns the possible values for the ScriptParameterTypes const type. @@ -724,11 +1055,13 @@ func PossibleScriptParameterTypesValues() []ScriptParameterTypes { } } -// SegmentStatusEnum - Segment status. +// SegmentStatusEnum - Segment status type SegmentStatusEnum string const ( + // SegmentStatusEnumFAILURE - is failure SegmentStatusEnumFAILURE SegmentStatusEnum = "FAILURE" + // SegmentStatusEnumSUCCESS - is success SegmentStatusEnumSUCCESS SegmentStatusEnum = "SUCCESS" ) @@ -740,13 +1073,32 @@ func PossibleSegmentStatusEnumValues() []SegmentStatusEnum { } } -// TrialStatus - Trial status +// SystemAssignedServiceIdentityType - Type of managed service identity (either system assigned, or none). +type SystemAssignedServiceIdentityType string + +const ( + SystemAssignedServiceIdentityTypeNone SystemAssignedServiceIdentityType = "None" + SystemAssignedServiceIdentityTypeSystemAssigned SystemAssignedServiceIdentityType = "SystemAssigned" +) + +// PossibleSystemAssignedServiceIdentityTypeValues returns the possible values for the SystemAssignedServiceIdentityType const type. +func PossibleSystemAssignedServiceIdentityTypeValues() []SystemAssignedServiceIdentityType { + return []SystemAssignedServiceIdentityType{ + SystemAssignedServiceIdentityTypeNone, + SystemAssignedServiceIdentityTypeSystemAssigned, + } +} + +// TrialStatus - trial status type TrialStatus string const ( + // TrialStatusTrialAvailable - is available TrialStatusTrialAvailable TrialStatus = "TrialAvailable" - TrialStatusTrialDisabled TrialStatus = "TrialDisabled" - TrialStatusTrialUsed TrialStatus = "TrialUsed" + // TrialStatusTrialDisabled - is disabled + TrialStatusTrialDisabled TrialStatus = "TrialDisabled" + // TrialStatusTrialUsed - is used + TrialStatusTrialUsed TrialStatus = "TrialUsed" ) // PossibleTrialStatusValues returns the possible values for the TrialStatus const type. @@ -758,11 +1110,13 @@ func PossibleTrialStatusValues() []TrialStatus { } } -// VMGroupStatusEnum - VM Group status. +// VMGroupStatusEnum - VM group status type VMGroupStatusEnum string const ( + // VMGroupStatusEnumFAILURE - is failure VMGroupStatusEnumFAILURE VMGroupStatusEnum = "FAILURE" + // VMGroupStatusEnumSUCCESS - is success VMGroupStatusEnumSUCCESS VMGroupStatusEnum = "SUCCESS" ) @@ -774,12 +1128,15 @@ func PossibleVMGroupStatusEnumValues() []VMGroupStatusEnum { } } -// VMTypeEnum - Virtual machine type. +// VMTypeEnum - VM type type VMTypeEnum string const ( - VMTypeEnumEDGE VMTypeEnum = "EDGE" + // VMTypeEnumEDGE - is edge + VMTypeEnumEDGE VMTypeEnum = "EDGE" + // VMTypeEnumREGULAR - is regular VMTypeEnumREGULAR VMTypeEnum = "REGULAR" + // VMTypeEnumSERVICE - is service VMTypeEnumSERVICE VMTypeEnum = "SERVICE" ) @@ -792,12 +1149,35 @@ func PossibleVMTypeEnumValues() []VMTypeEnum { } } -// VirtualMachineRestrictMovementState - Whether VM DRS-driven movement is restricted (enabled) or not (disabled) +// VirtualMachineProvisioningState - Virtual Machine provisioning state +type VirtualMachineProvisioningState string + +const ( + // VirtualMachineProvisioningStateCanceled - Resource creation was canceled. + VirtualMachineProvisioningStateCanceled VirtualMachineProvisioningState = "Canceled" + // VirtualMachineProvisioningStateFailed - Resource creation failed. + VirtualMachineProvisioningStateFailed VirtualMachineProvisioningState = "Failed" + // VirtualMachineProvisioningStateSucceeded - Resource has been created. + VirtualMachineProvisioningStateSucceeded VirtualMachineProvisioningState = "Succeeded" +) + +// PossibleVirtualMachineProvisioningStateValues returns the possible values for the VirtualMachineProvisioningState const type. +func PossibleVirtualMachineProvisioningStateValues() []VirtualMachineProvisioningState { + return []VirtualMachineProvisioningState{ + VirtualMachineProvisioningStateCanceled, + VirtualMachineProvisioningStateFailed, + VirtualMachineProvisioningStateSucceeded, + } +} + +// VirtualMachineRestrictMovementState - Virtual Machine Restrict Movement state type VirtualMachineRestrictMovementState string const ( + // VirtualMachineRestrictMovementStateDisabled - is disabled VirtualMachineRestrictMovementStateDisabled VirtualMachineRestrictMovementState = "Disabled" - VirtualMachineRestrictMovementStateEnabled VirtualMachineRestrictMovementState = "Enabled" + // VirtualMachineRestrictMovementStateEnabled - is enabled + VirtualMachineRestrictMovementStateEnabled VirtualMachineRestrictMovementState = "Enabled" ) // PossibleVirtualMachineRestrictMovementStateValues returns the possible values for the VirtualMachineRestrictMovementState const type. @@ -808,11 +1188,13 @@ func PossibleVirtualMachineRestrictMovementStateValues() []VirtualMachineRestric } } -// VisibilityParameterEnum - Should this parameter be visible to arm and passed in the parameters argument when executing +// VisibilityParameterEnum - Visibility Parameter type VisibilityParameterEnum string const ( - VisibilityParameterEnumHidden VisibilityParameterEnum = "Hidden" + // VisibilityParameterEnumHidden - is hidden + VisibilityParameterEnumHidden VisibilityParameterEnum = "Hidden" + // VisibilityParameterEnumVisible - is visible VisibilityParameterEnumVisible VisibilityParameterEnum = "Visible" ) @@ -824,16 +1206,22 @@ func PossibleVisibilityParameterEnumValues() []VisibilityParameterEnum { } } -// WorkloadNetworkDNSServiceProvisioningState - The provisioning state +// WorkloadNetworkDNSServiceProvisioningState - Workload Network DNS Service provisioning state type WorkloadNetworkDNSServiceProvisioningState string const ( - WorkloadNetworkDNSServiceProvisioningStateBuilding WorkloadNetworkDNSServiceProvisioningState = "Building" - WorkloadNetworkDNSServiceProvisioningStateCanceled WorkloadNetworkDNSServiceProvisioningState = "Canceled" - WorkloadNetworkDNSServiceProvisioningStateDeleting WorkloadNetworkDNSServiceProvisioningState = "Deleting" - WorkloadNetworkDNSServiceProvisioningStateFailed WorkloadNetworkDNSServiceProvisioningState = "Failed" + // WorkloadNetworkDNSServiceProvisioningStateBuilding - is building + WorkloadNetworkDNSServiceProvisioningStateBuilding WorkloadNetworkDNSServiceProvisioningState = "Building" + // WorkloadNetworkDNSServiceProvisioningStateCanceled - Resource creation was canceled. + WorkloadNetworkDNSServiceProvisioningStateCanceled WorkloadNetworkDNSServiceProvisioningState = "Canceled" + // WorkloadNetworkDNSServiceProvisioningStateDeleting - is deleting + WorkloadNetworkDNSServiceProvisioningStateDeleting WorkloadNetworkDNSServiceProvisioningState = "Deleting" + // WorkloadNetworkDNSServiceProvisioningStateFailed - Resource creation failed. + WorkloadNetworkDNSServiceProvisioningStateFailed WorkloadNetworkDNSServiceProvisioningState = "Failed" + // WorkloadNetworkDNSServiceProvisioningStateSucceeded - Resource has been created. WorkloadNetworkDNSServiceProvisioningStateSucceeded WorkloadNetworkDNSServiceProvisioningState = "Succeeded" - WorkloadNetworkDNSServiceProvisioningStateUpdating WorkloadNetworkDNSServiceProvisioningState = "Updating" + // WorkloadNetworkDNSServiceProvisioningStateUpdating - is updating + WorkloadNetworkDNSServiceProvisioningStateUpdating WorkloadNetworkDNSServiceProvisioningState = "Updating" ) // PossibleWorkloadNetworkDNSServiceProvisioningStateValues returns the possible values for the WorkloadNetworkDNSServiceProvisioningState const type. @@ -848,16 +1236,22 @@ func PossibleWorkloadNetworkDNSServiceProvisioningStateValues() []WorkloadNetwor } } -// WorkloadNetworkDNSZoneProvisioningState - The provisioning state +// WorkloadNetworkDNSZoneProvisioningState - Workload Network DNS Zone provisioning state type WorkloadNetworkDNSZoneProvisioningState string const ( - WorkloadNetworkDNSZoneProvisioningStateBuilding WorkloadNetworkDNSZoneProvisioningState = "Building" - WorkloadNetworkDNSZoneProvisioningStateCanceled WorkloadNetworkDNSZoneProvisioningState = "Canceled" - WorkloadNetworkDNSZoneProvisioningStateDeleting WorkloadNetworkDNSZoneProvisioningState = "Deleting" - WorkloadNetworkDNSZoneProvisioningStateFailed WorkloadNetworkDNSZoneProvisioningState = "Failed" + // WorkloadNetworkDNSZoneProvisioningStateBuilding - is building + WorkloadNetworkDNSZoneProvisioningStateBuilding WorkloadNetworkDNSZoneProvisioningState = "Building" + // WorkloadNetworkDNSZoneProvisioningStateCanceled - Resource creation was canceled. + WorkloadNetworkDNSZoneProvisioningStateCanceled WorkloadNetworkDNSZoneProvisioningState = "Canceled" + // WorkloadNetworkDNSZoneProvisioningStateDeleting - is deleting + WorkloadNetworkDNSZoneProvisioningStateDeleting WorkloadNetworkDNSZoneProvisioningState = "Deleting" + // WorkloadNetworkDNSZoneProvisioningStateFailed - Resource creation failed. + WorkloadNetworkDNSZoneProvisioningStateFailed WorkloadNetworkDNSZoneProvisioningState = "Failed" + // WorkloadNetworkDNSZoneProvisioningStateSucceeded - Resource has been created. WorkloadNetworkDNSZoneProvisioningStateSucceeded WorkloadNetworkDNSZoneProvisioningState = "Succeeded" - WorkloadNetworkDNSZoneProvisioningStateUpdating WorkloadNetworkDNSZoneProvisioningState = "Updating" + // WorkloadNetworkDNSZoneProvisioningStateUpdating - is updating + WorkloadNetworkDNSZoneProvisioningStateUpdating WorkloadNetworkDNSZoneProvisioningState = "Updating" ) // PossibleWorkloadNetworkDNSZoneProvisioningStateValues returns the possible values for the WorkloadNetworkDNSZoneProvisioningState const type. @@ -872,16 +1266,22 @@ func PossibleWorkloadNetworkDNSZoneProvisioningStateValues() []WorkloadNetworkDN } } -// WorkloadNetworkDhcpProvisioningState - The provisioning state +// WorkloadNetworkDhcpProvisioningState - Workload Network DHCP provisioning state type WorkloadNetworkDhcpProvisioningState string const ( - WorkloadNetworkDhcpProvisioningStateBuilding WorkloadNetworkDhcpProvisioningState = "Building" - WorkloadNetworkDhcpProvisioningStateCanceled WorkloadNetworkDhcpProvisioningState = "Canceled" - WorkloadNetworkDhcpProvisioningStateDeleting WorkloadNetworkDhcpProvisioningState = "Deleting" - WorkloadNetworkDhcpProvisioningStateFailed WorkloadNetworkDhcpProvisioningState = "Failed" + // WorkloadNetworkDhcpProvisioningStateBuilding - is building + WorkloadNetworkDhcpProvisioningStateBuilding WorkloadNetworkDhcpProvisioningState = "Building" + // WorkloadNetworkDhcpProvisioningStateCanceled - Resource creation was canceled. + WorkloadNetworkDhcpProvisioningStateCanceled WorkloadNetworkDhcpProvisioningState = "Canceled" + // WorkloadNetworkDhcpProvisioningStateDeleting - is deleting + WorkloadNetworkDhcpProvisioningStateDeleting WorkloadNetworkDhcpProvisioningState = "Deleting" + // WorkloadNetworkDhcpProvisioningStateFailed - Resource creation failed. + WorkloadNetworkDhcpProvisioningStateFailed WorkloadNetworkDhcpProvisioningState = "Failed" + // WorkloadNetworkDhcpProvisioningStateSucceeded - Resource has been created. WorkloadNetworkDhcpProvisioningStateSucceeded WorkloadNetworkDhcpProvisioningState = "Succeeded" - WorkloadNetworkDhcpProvisioningStateUpdating WorkloadNetworkDhcpProvisioningState = "Updating" + // WorkloadNetworkDhcpProvisioningStateUpdating - is updating + WorkloadNetworkDhcpProvisioningStateUpdating WorkloadNetworkDhcpProvisioningState = "Updating" ) // PossibleWorkloadNetworkDhcpProvisioningStateValues returns the possible values for the WorkloadNetworkDhcpProvisioningState const type. @@ -896,29 +1296,22 @@ func PossibleWorkloadNetworkDhcpProvisioningStateValues() []WorkloadNetworkDhcpP } } -type WorkloadNetworkName string - -const ( - WorkloadNetworkNameDefault WorkloadNetworkName = "default" -) - -// PossibleWorkloadNetworkNameValues returns the possible values for the WorkloadNetworkName const type. -func PossibleWorkloadNetworkNameValues() []WorkloadNetworkName { - return []WorkloadNetworkName{ - WorkloadNetworkNameDefault, - } -} - -// WorkloadNetworkPortMirroringProvisioningState - The provisioning state +// WorkloadNetworkPortMirroringProvisioningState - Workload Network Port Mirroring provisioning state type WorkloadNetworkPortMirroringProvisioningState string const ( - WorkloadNetworkPortMirroringProvisioningStateBuilding WorkloadNetworkPortMirroringProvisioningState = "Building" - WorkloadNetworkPortMirroringProvisioningStateCanceled WorkloadNetworkPortMirroringProvisioningState = "Canceled" - WorkloadNetworkPortMirroringProvisioningStateDeleting WorkloadNetworkPortMirroringProvisioningState = "Deleting" - WorkloadNetworkPortMirroringProvisioningStateFailed WorkloadNetworkPortMirroringProvisioningState = "Failed" + // WorkloadNetworkPortMirroringProvisioningStateBuilding - is building + WorkloadNetworkPortMirroringProvisioningStateBuilding WorkloadNetworkPortMirroringProvisioningState = "Building" + // WorkloadNetworkPortMirroringProvisioningStateCanceled - Resource creation was canceled. + WorkloadNetworkPortMirroringProvisioningStateCanceled WorkloadNetworkPortMirroringProvisioningState = "Canceled" + // WorkloadNetworkPortMirroringProvisioningStateDeleting - is deleting + WorkloadNetworkPortMirroringProvisioningStateDeleting WorkloadNetworkPortMirroringProvisioningState = "Deleting" + // WorkloadNetworkPortMirroringProvisioningStateFailed - Resource creation failed. + WorkloadNetworkPortMirroringProvisioningStateFailed WorkloadNetworkPortMirroringProvisioningState = "Failed" + // WorkloadNetworkPortMirroringProvisioningStateSucceeded - Resource has been created. WorkloadNetworkPortMirroringProvisioningStateSucceeded WorkloadNetworkPortMirroringProvisioningState = "Succeeded" - WorkloadNetworkPortMirroringProvisioningStateUpdating WorkloadNetworkPortMirroringProvisioningState = "Updating" + // WorkloadNetworkPortMirroringProvisioningStateUpdating - is updating + WorkloadNetworkPortMirroringProvisioningStateUpdating WorkloadNetworkPortMirroringProvisioningState = "Updating" ) // PossibleWorkloadNetworkPortMirroringProvisioningStateValues returns the possible values for the WorkloadNetworkPortMirroringProvisioningState const type. @@ -933,16 +1326,52 @@ func PossibleWorkloadNetworkPortMirroringProvisioningStateValues() []WorkloadNet } } -// WorkloadNetworkPublicIPProvisioningState - The provisioning state +// WorkloadNetworkProvisioningState - base Workload Network provisioning state +type WorkloadNetworkProvisioningState string + +const ( + // WorkloadNetworkProvisioningStateBuilding - is building + WorkloadNetworkProvisioningStateBuilding WorkloadNetworkProvisioningState = "Building" + // WorkloadNetworkProvisioningStateCanceled - Resource creation was canceled. + WorkloadNetworkProvisioningStateCanceled WorkloadNetworkProvisioningState = "Canceled" + // WorkloadNetworkProvisioningStateDeleting - is deleting + WorkloadNetworkProvisioningStateDeleting WorkloadNetworkProvisioningState = "Deleting" + // WorkloadNetworkProvisioningStateFailed - Resource creation failed. + WorkloadNetworkProvisioningStateFailed WorkloadNetworkProvisioningState = "Failed" + // WorkloadNetworkProvisioningStateSucceeded - Resource has been created. + WorkloadNetworkProvisioningStateSucceeded WorkloadNetworkProvisioningState = "Succeeded" + // WorkloadNetworkProvisioningStateUpdating - is updating + WorkloadNetworkProvisioningStateUpdating WorkloadNetworkProvisioningState = "Updating" +) + +// PossibleWorkloadNetworkProvisioningStateValues returns the possible values for the WorkloadNetworkProvisioningState const type. +func PossibleWorkloadNetworkProvisioningStateValues() []WorkloadNetworkProvisioningState { + return []WorkloadNetworkProvisioningState{ + WorkloadNetworkProvisioningStateBuilding, + WorkloadNetworkProvisioningStateCanceled, + WorkloadNetworkProvisioningStateDeleting, + WorkloadNetworkProvisioningStateFailed, + WorkloadNetworkProvisioningStateSucceeded, + WorkloadNetworkProvisioningStateUpdating, + } +} + +// WorkloadNetworkPublicIPProvisioningState - Workload Network Public IP provisioning state type WorkloadNetworkPublicIPProvisioningState string const ( - WorkloadNetworkPublicIPProvisioningStateBuilding WorkloadNetworkPublicIPProvisioningState = "Building" - WorkloadNetworkPublicIPProvisioningStateCanceled WorkloadNetworkPublicIPProvisioningState = "Canceled" - WorkloadNetworkPublicIPProvisioningStateDeleting WorkloadNetworkPublicIPProvisioningState = "Deleting" - WorkloadNetworkPublicIPProvisioningStateFailed WorkloadNetworkPublicIPProvisioningState = "Failed" + // WorkloadNetworkPublicIPProvisioningStateBuilding - is building + WorkloadNetworkPublicIPProvisioningStateBuilding WorkloadNetworkPublicIPProvisioningState = "Building" + // WorkloadNetworkPublicIPProvisioningStateCanceled - Resource creation was canceled. + WorkloadNetworkPublicIPProvisioningStateCanceled WorkloadNetworkPublicIPProvisioningState = "Canceled" + // WorkloadNetworkPublicIPProvisioningStateDeleting - is deleting + WorkloadNetworkPublicIPProvisioningStateDeleting WorkloadNetworkPublicIPProvisioningState = "Deleting" + // WorkloadNetworkPublicIPProvisioningStateFailed - Resource creation failed. + WorkloadNetworkPublicIPProvisioningStateFailed WorkloadNetworkPublicIPProvisioningState = "Failed" + // WorkloadNetworkPublicIPProvisioningStateSucceeded - Resource has been created. WorkloadNetworkPublicIPProvisioningStateSucceeded WorkloadNetworkPublicIPProvisioningState = "Succeeded" - WorkloadNetworkPublicIPProvisioningStateUpdating WorkloadNetworkPublicIPProvisioningState = "Updating" + // WorkloadNetworkPublicIPProvisioningStateUpdating - is updating + WorkloadNetworkPublicIPProvisioningStateUpdating WorkloadNetworkPublicIPProvisioningState = "Updating" ) // PossibleWorkloadNetworkPublicIPProvisioningStateValues returns the possible values for the WorkloadNetworkPublicIPProvisioningState const type. @@ -957,16 +1386,22 @@ func PossibleWorkloadNetworkPublicIPProvisioningStateValues() []WorkloadNetworkP } } -// WorkloadNetworkSegmentProvisioningState - The provisioning state +// WorkloadNetworkSegmentProvisioningState - Workload Network Segment provisioning state type WorkloadNetworkSegmentProvisioningState string const ( - WorkloadNetworkSegmentProvisioningStateBuilding WorkloadNetworkSegmentProvisioningState = "Building" - WorkloadNetworkSegmentProvisioningStateCanceled WorkloadNetworkSegmentProvisioningState = "Canceled" - WorkloadNetworkSegmentProvisioningStateDeleting WorkloadNetworkSegmentProvisioningState = "Deleting" - WorkloadNetworkSegmentProvisioningStateFailed WorkloadNetworkSegmentProvisioningState = "Failed" + // WorkloadNetworkSegmentProvisioningStateBuilding - is building + WorkloadNetworkSegmentProvisioningStateBuilding WorkloadNetworkSegmentProvisioningState = "Building" + // WorkloadNetworkSegmentProvisioningStateCanceled - Resource creation was canceled. + WorkloadNetworkSegmentProvisioningStateCanceled WorkloadNetworkSegmentProvisioningState = "Canceled" + // WorkloadNetworkSegmentProvisioningStateDeleting - is deleting + WorkloadNetworkSegmentProvisioningStateDeleting WorkloadNetworkSegmentProvisioningState = "Deleting" + // WorkloadNetworkSegmentProvisioningStateFailed - Resource creation failed. + WorkloadNetworkSegmentProvisioningStateFailed WorkloadNetworkSegmentProvisioningState = "Failed" + // WorkloadNetworkSegmentProvisioningStateSucceeded - Resource has been created. WorkloadNetworkSegmentProvisioningStateSucceeded WorkloadNetworkSegmentProvisioningState = "Succeeded" - WorkloadNetworkSegmentProvisioningStateUpdating WorkloadNetworkSegmentProvisioningState = "Updating" + // WorkloadNetworkSegmentProvisioningStateUpdating - is updating + WorkloadNetworkSegmentProvisioningStateUpdating WorkloadNetworkSegmentProvisioningState = "Updating" ) // PossibleWorkloadNetworkSegmentProvisioningStateValues returns the possible values for the WorkloadNetworkSegmentProvisioningState const type. @@ -981,16 +1416,22 @@ func PossibleWorkloadNetworkSegmentProvisioningStateValues() []WorkloadNetworkSe } } -// WorkloadNetworkVMGroupProvisioningState - The provisioning state +// WorkloadNetworkVMGroupProvisioningState - Workload Network VM Group provisioning state type WorkloadNetworkVMGroupProvisioningState string const ( - WorkloadNetworkVMGroupProvisioningStateBuilding WorkloadNetworkVMGroupProvisioningState = "Building" - WorkloadNetworkVMGroupProvisioningStateCanceled WorkloadNetworkVMGroupProvisioningState = "Canceled" - WorkloadNetworkVMGroupProvisioningStateDeleting WorkloadNetworkVMGroupProvisioningState = "Deleting" - WorkloadNetworkVMGroupProvisioningStateFailed WorkloadNetworkVMGroupProvisioningState = "Failed" + // WorkloadNetworkVMGroupProvisioningStateBuilding - is building + WorkloadNetworkVMGroupProvisioningStateBuilding WorkloadNetworkVMGroupProvisioningState = "Building" + // WorkloadNetworkVMGroupProvisioningStateCanceled - Resource creation was canceled. + WorkloadNetworkVMGroupProvisioningStateCanceled WorkloadNetworkVMGroupProvisioningState = "Canceled" + // WorkloadNetworkVMGroupProvisioningStateDeleting - is deleting + WorkloadNetworkVMGroupProvisioningStateDeleting WorkloadNetworkVMGroupProvisioningState = "Deleting" + // WorkloadNetworkVMGroupProvisioningStateFailed - Resource creation failed. + WorkloadNetworkVMGroupProvisioningStateFailed WorkloadNetworkVMGroupProvisioningState = "Failed" + // WorkloadNetworkVMGroupProvisioningStateSucceeded - Resource has been created. WorkloadNetworkVMGroupProvisioningStateSucceeded WorkloadNetworkVMGroupProvisioningState = "Succeeded" - WorkloadNetworkVMGroupProvisioningStateUpdating WorkloadNetworkVMGroupProvisioningState = "Updating" + // WorkloadNetworkVMGroupProvisioningStateUpdating - is updating + WorkloadNetworkVMGroupProvisioningStateUpdating WorkloadNetworkVMGroupProvisioningState = "Updating" ) // PossibleWorkloadNetworkVMGroupProvisioningStateValues returns the possible values for the WorkloadNetworkVMGroupProvisioningState const type. diff --git a/sdk/resourcemanager/avs/armavs/datastores_client.go b/sdk/resourcemanager/avs/armavs/datastores_client.go index a1a99ebc4098..6ed9579caddd 100644 --- a/sdk/resourcemanager/avs/armavs/datastores_client.go +++ b/sdk/resourcemanager/avs/armavs/datastores_client.go @@ -43,15 +43,15 @@ func NewDatastoresClient(subscriptionID string, credential azcore.TokenCredentia return client, nil } -// BeginCreateOrUpdate - Create or update a datastore in a private cloud cluster +// BeginCreateOrUpdate - Create a Datastore // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud -// - datastoreName - Name of the datastore in the private cloud cluster -// - datastore - A datastore in a private cloud cluster +// - clusterName - Name of the cluster +// - datastoreName - Name of the datastore +// - datastore - Resource create parameters. // - options - DatastoresClientBeginCreateOrUpdateOptions contains the optional parameters for the DatastoresClient.BeginCreateOrUpdate // method. func (client *DatastoresClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, datastoreName string, datastore Datastore, options *DatastoresClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatastoresClientCreateOrUpdateResponse], error) { @@ -61,7 +61,8 @@ func (client *DatastoresClient) BeginCreateOrUpdate(ctx context.Context, resourc return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatastoresClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,10 +72,10 @@ func (client *DatastoresClient) BeginCreateOrUpdate(ctx context.Context, resourc } } -// CreateOrUpdate - Create or update a datastore in a private cloud cluster +// CreateOrUpdate - Create a Datastore // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *DatastoresClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, datastoreName string, datastore Datastore, options *DatastoresClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DatastoresClient.BeginCreateOrUpdate" @@ -124,7 +125,7 @@ func (client *DatastoresClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, datastore); err != nil { @@ -133,14 +134,14 @@ func (client *DatastoresClient) createOrUpdateCreateRequest(ctx context.Context, return req, nil } -// BeginDelete - Delete a datastore in a private cloud cluster +// BeginDelete - Delete a Datastore // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud -// - datastoreName - Name of the datastore in the private cloud cluster +// - clusterName - Name of the cluster +// - datastoreName - Name of the datastore // - options - DatastoresClientBeginDeleteOptions contains the optional parameters for the DatastoresClient.BeginDelete method. func (client *DatastoresClient) BeginDelete(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, datastoreName string, options *DatastoresClientBeginDeleteOptions) (*runtime.Poller[DatastoresClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -149,7 +150,8 @@ func (client *DatastoresClient) BeginDelete(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatastoresClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -159,10 +161,10 @@ func (client *DatastoresClient) BeginDelete(ctx context.Context, resourceGroupNa } } -// Delete - Delete a datastore in a private cloud cluster +// Delete - Delete a Datastore // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *DatastoresClient) deleteOperation(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, datastoreName string, options *DatastoresClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DatastoresClient.BeginDelete" @@ -212,20 +214,20 @@ func (client *DatastoresClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get a datastore in a private cloud cluster +// Get - Get a Datastore // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud -// - datastoreName - Name of the datastore in the private cloud cluster +// - clusterName - Name of the cluster +// - datastoreName - Name of the datastore // - options - DatastoresClientGetOptions contains the optional parameters for the DatastoresClient.Get method. func (client *DatastoresClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, datastoreName string, options *DatastoresClientGetOptions) (DatastoresClientGetResponse, error) { var err error @@ -277,7 +279,7 @@ func (client *DatastoresClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,12 +294,12 @@ func (client *DatastoresClient) getHandleResponse(resp *http.Response) (Datastor return result, nil } -// NewListPager - List datastores in a private cloud cluster +// NewListPager - List Datastore resources by Cluster // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud +// - clusterName - Name of the cluster // - options - DatastoresClientListOptions contains the optional parameters for the DatastoresClient.NewListPager method. func (client *DatastoresClient) NewListPager(resourceGroupName string, privateCloudName string, clusterName string, options *DatastoresClientListOptions) *runtime.Pager[DatastoresClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DatastoresClientListResponse]{ @@ -346,7 +348,7 @@ func (client *DatastoresClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -355,7 +357,7 @@ func (client *DatastoresClient) listCreateRequest(ctx context.Context, resourceG // listHandleResponse handles the List response. func (client *DatastoresClient) listHandleResponse(resp *http.Response) (DatastoresClientListResponse, error) { result := DatastoresClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DatastoreList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.DatastoreListResult); err != nil { return DatastoresClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/avs/armavs/datastores_client_example_test.go b/sdk/resourcemanager/avs/armavs/datastores_client_example_test.go deleted file mode 100644 index 52007837a0dc..000000000000 --- a/sdk/resourcemanager/avs/armavs/datastores_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Datastores_List.json -func ExampleDatastoresClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatastoresClient().NewListPager("group1", "cloud1", "cluster1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatastoreList = armavs.DatastoreList{ - // Value: []*armavs.Datastore{ - // { - // Name: to.Ptr("datastore1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters/datastores"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1"), - // Properties: &armavs.DatastoreProperties{ - // NetAppVolume: &armavs.NetAppVolume{ - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"), - // }, - // ProvisioningState: to.Ptr(armavs.DatastoreProvisioningStateSucceeded), - // Status: to.Ptr(armavs.DatastoreStatusAccessible), - // }, - // }, - // { - // Name: to.Ptr("datastore2"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters/datastores"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore2"), - // Properties: &armavs.DatastoreProperties{ - // DiskPoolVolume: &armavs.DiskPoolVolume{ - // Path: to.Ptr("/vmfs/devices/disks/naa.6001405f75f6bdf7f6f49db8b4b21723"), - // LunName: to.Ptr("lun0"), - // MountOption: to.Ptr(armavs.MountOptionEnumMOUNT), - // TargetID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.StoragePool/diskPools/DiskPool1/targets/Target1"), - // }, - // ProvisioningState: to.Ptr(armavs.DatastoreProvisioningStateSucceeded), - // Status: to.Ptr(armavs.DatastoreStatusAccessible), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Datastores_Get.json -func ExampleDatastoresClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatastoresClient().Get(ctx, "group1", "cloud1", "cluster1", "datastore1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Datastore = armavs.Datastore{ - // Name: to.Ptr("datastore1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters/datastores"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1"), - // Properties: &armavs.DatastoreProperties{ - // NetAppVolume: &armavs.NetAppVolume{ - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"), - // }, - // ProvisioningState: to.Ptr(armavs.DatastoreProvisioningStateSucceeded), - // Status: to.Ptr(armavs.DatastoreStatusAccessible), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Datastores_CreateOrUpdate.json -func ExampleDatastoresClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatastoresClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "cluster1", "datastore1", armavs.Datastore{ - Properties: &armavs.DatastoreProperties{ - NetAppVolume: &armavs.NetAppVolume{ - ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Datastore = armavs.Datastore{ - // Name: to.Ptr("datastore1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters/datastores"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1"), - // Properties: &armavs.DatastoreProperties{ - // NetAppVolume: &armavs.NetAppVolume{ - // ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1"), - // }, - // ProvisioningState: to.Ptr(armavs.DatastoreProvisioningStateSucceeded), - // Status: to.Ptr(armavs.DatastoreStatusAccessible), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Datastores_Delete.json -func ExampleDatastoresClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatastoresClient().BeginDelete(ctx, "group1", "cloud1", "cluster1", "datastore1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/avs/armavs/fake/addons_server.go b/sdk/resourcemanager/avs/armavs/fake/addons_server.go index 74bed3adbced..f02eb3ccb5b7 100644 --- a/sdk/resourcemanager/avs/armavs/fake/addons_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/addons_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/authorizations_server.go b/sdk/resourcemanager/avs/armavs/fake/authorizations_server.go index 8f0045c3a663..8853faa85a4e 100644 --- a/sdk/resourcemanager/avs/armavs/fake/authorizations_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/authorizations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/cloudlinks_server.go b/sdk/resourcemanager/avs/armavs/fake/cloudlinks_server.go index 018bc8da0f06..8b43af090577 100644 --- a/sdk/resourcemanager/avs/armavs/fake/cloudlinks_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/cloudlinks_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/clusters_server.go b/sdk/resourcemanager/avs/armavs/fake/clusters_server.go index c466f27fcca1..0823086d444b 100644 --- a/sdk/resourcemanager/avs/armavs/fake/clusters_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/clusters_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/datastores_server.go b/sdk/resourcemanager/avs/armavs/fake/datastores_server.go index 69bc61ea58a7..d46e4c178ecd 100644 --- a/sdk/resourcemanager/avs/armavs/fake/datastores_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/datastores_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/globalreachconnections_server.go b/sdk/resourcemanager/avs/armavs/fake/globalreachconnections_server.go index 5c3cc78ed56a..6cd62c4988a1 100644 --- a/sdk/resourcemanager/avs/armavs/fake/globalreachconnections_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/globalreachconnections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/hcxenterprisesites_server.go b/sdk/resourcemanager/avs/armavs/fake/hcxenterprisesites_server.go index e2034d2931a4..783d81e9dafa 100644 --- a/sdk/resourcemanager/avs/armavs/fake/hcxenterprisesites_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/hcxenterprisesites_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/internal.go b/sdk/resourcemanager/avs/armavs/fake/internal.go index be04ff43d678..5f75802a569e 100644 --- a/sdk/resourcemanager/avs/armavs/fake/internal.go +++ b/sdk/resourcemanager/avs/armavs/fake/internal.go @@ -31,14 +31,6 @@ func contains[T comparable](s []T, v T) bool { return false } -func parseWithCast[T any](v string, parse func(v string) (T, error)) (T, error) { - t, err := parse(v) - if err != nil { - return *new(T), err - } - return t, err -} - func newTracker[T any]() *tracker[T] { return &tracker[T]{ items: map[string]*T{}, diff --git a/sdk/resourcemanager/avs/armavs/fake/iscsipaths_server.go b/sdk/resourcemanager/avs/armavs/fake/iscsipaths_server.go new file mode 100644 index 000000000000..62f30783f427 --- /dev/null +++ b/sdk/resourcemanager/avs/armavs/fake/iscsipaths_server.go @@ -0,0 +1,260 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" + "net/http" + "net/url" + "regexp" +) + +// IscsiPathsServer is a fake server for instances of the armavs.IscsiPathsClient type. +type IscsiPathsServer struct { + // BeginCreateOrUpdate is the fake for method IscsiPathsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, privateCloudName string, resource armavs.IscsiPath, options *armavs.IscsiPathsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armavs.IscsiPathsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method IscsiPathsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, privateCloudName string, options *armavs.IscsiPathsClientBeginDeleteOptions) (resp azfake.PollerResponder[armavs.IscsiPathsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method IscsiPathsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, privateCloudName string, options *armavs.IscsiPathsClientGetOptions) (resp azfake.Responder[armavs.IscsiPathsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByPrivateCloudPager is the fake for method IscsiPathsClient.NewListByPrivateCloudPager + // HTTP status codes to indicate success: http.StatusOK + NewListByPrivateCloudPager func(resourceGroupName string, privateCloudName string, options *armavs.IscsiPathsClientListByPrivateCloudOptions) (resp azfake.PagerResponder[armavs.IscsiPathsClientListByPrivateCloudResponse]) +} + +// NewIscsiPathsServerTransport creates a new instance of IscsiPathsServerTransport with the provided implementation. +// The returned IscsiPathsServerTransport instance is connected to an instance of armavs.IscsiPathsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewIscsiPathsServerTransport(srv *IscsiPathsServer) *IscsiPathsServerTransport { + return &IscsiPathsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armavs.IscsiPathsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armavs.IscsiPathsClientDeleteResponse]](), + newListByPrivateCloudPager: newTracker[azfake.PagerResponder[armavs.IscsiPathsClientListByPrivateCloudResponse]](), + } +} + +// IscsiPathsServerTransport connects instances of armavs.IscsiPathsClient to instances of IscsiPathsServer. +// Don't use this type directly, use NewIscsiPathsServerTransport instead. +type IscsiPathsServerTransport struct { + srv *IscsiPathsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armavs.IscsiPathsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armavs.IscsiPathsClientDeleteResponse]] + newListByPrivateCloudPager *tracker[azfake.PagerResponder[armavs.IscsiPathsClientListByPrivateCloudResponse]] +} + +// Do implements the policy.Transporter interface for IscsiPathsServerTransport. +func (i *IscsiPathsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "IscsiPathsClient.BeginCreateOrUpdate": + resp, err = i.dispatchBeginCreateOrUpdate(req) + case "IscsiPathsClient.BeginDelete": + resp, err = i.dispatchBeginDelete(req) + case "IscsiPathsClient.Get": + resp, err = i.dispatchGet(req) + case "IscsiPathsClient.NewListByPrivateCloudPager": + resp, err = i.dispatchNewListByPrivateCloudPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (i *IscsiPathsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if i.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := i.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AVS/privateClouds/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/iscsiPaths/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armavs.IscsiPath](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + privateCloudNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateCloudName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, privateCloudNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + i.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + i.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + i.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (i *IscsiPathsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if i.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := i.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AVS/privateClouds/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/iscsiPaths/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + privateCloudNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateCloudName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginDelete(req.Context(), resourceGroupNameParam, privateCloudNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + i.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + i.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + i.beginDelete.remove(req) + } + + return resp, nil +} + +func (i *IscsiPathsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if i.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AVS/privateClouds/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/iscsiPaths/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + privateCloudNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateCloudName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.Get(req.Context(), resourceGroupNameParam, privateCloudNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).IscsiPath, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (i *IscsiPathsServerTransport) dispatchNewListByPrivateCloudPager(req *http.Request) (*http.Response, error) { + if i.srv.NewListByPrivateCloudPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByPrivateCloudPager not implemented")} + } + newListByPrivateCloudPager := i.newListByPrivateCloudPager.get(req) + if newListByPrivateCloudPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AVS/privateClouds/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/iscsiPaths` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + privateCloudNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateCloudName")]) + if err != nil { + return nil, err + } + resp := i.srv.NewListByPrivateCloudPager(resourceGroupNameParam, privateCloudNameParam, nil) + newListByPrivateCloudPager = &resp + i.newListByPrivateCloudPager.add(req, newListByPrivateCloudPager) + server.PagerResponderInjectNextLinks(newListByPrivateCloudPager, req, func(page *armavs.IscsiPathsClientListByPrivateCloudResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByPrivateCloudPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + i.newListByPrivateCloudPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByPrivateCloudPager) { + i.newListByPrivateCloudPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/avs/armavs/fake/locations_server.go b/sdk/resourcemanager/avs/armavs/fake/locations_server.go index dc58636403d1..0aee39aced66 100644 --- a/sdk/resourcemanager/avs/armavs/fake/locations_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/locations_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/avs/armavs/fake/operations_server.go b/sdk/resourcemanager/avs/armavs/fake/operations_server.go index 83a2969788e3..3dbb131299e1 100644 --- a/sdk/resourcemanager/avs/armavs/fake/operations_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/operations_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" ) diff --git a/sdk/resourcemanager/avs/armavs/fake/placementpolicies_server.go b/sdk/resourcemanager/avs/armavs/fake/placementpolicies_server.go index 3fd579fa7ae1..21390dfe89ee 100644 --- a/sdk/resourcemanager/avs/armavs/fake/placementpolicies_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/placementpolicies_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/privateclouds_server.go b/sdk/resourcemanager/avs/armavs/fake/privateclouds_server.go index 88bdd3d70b08..74a8b99f6250 100644 --- a/sdk/resourcemanager/avs/armavs/fake/privateclouds_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/privateclouds_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/scriptcmdlets_server.go b/sdk/resourcemanager/avs/armavs/fake/scriptcmdlets_server.go index 896d492594b5..c9c6ccb3a4dd 100644 --- a/sdk/resourcemanager/avs/armavs/fake/scriptcmdlets_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/scriptcmdlets_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/scriptexecutions_server.go b/sdk/resourcemanager/avs/armavs/fake/scriptexecutions_server.go index 5d21a212d937..a33312dda42e 100644 --- a/sdk/resourcemanager/avs/armavs/fake/scriptexecutions_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/scriptexecutions_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/scriptpackages_server.go b/sdk/resourcemanager/avs/armavs/fake/scriptpackages_server.go index c211b47b201a..1c4a8b89decf 100644 --- a/sdk/resourcemanager/avs/armavs/fake/scriptpackages_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/scriptpackages_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/server_factory.go b/sdk/resourcemanager/avs/armavs/fake/server_factory.go index 0e284cc76653..9e0196453d51 100644 --- a/sdk/resourcemanager/avs/armavs/fake/server_factory.go +++ b/sdk/resourcemanager/avs/armavs/fake/server_factory.go @@ -26,6 +26,7 @@ type ServerFactory struct { DatastoresServer DatastoresServer GlobalReachConnectionsServer GlobalReachConnectionsServer HcxEnterpriseSitesServer HcxEnterpriseSitesServer + IscsiPathsServer IscsiPathsServer LocationsServer LocationsServer OperationsServer OperationsServer PlacementPoliciesServer PlacementPoliciesServer @@ -58,6 +59,7 @@ type ServerFactoryTransport struct { trDatastoresServer *DatastoresServerTransport trGlobalReachConnectionsServer *GlobalReachConnectionsServerTransport trHcxEnterpriseSitesServer *HcxEnterpriseSitesServerTransport + trIscsiPathsServer *IscsiPathsServerTransport trLocationsServer *LocationsServerTransport trOperationsServer *OperationsServerTransport trPlacementPoliciesServer *PlacementPoliciesServerTransport @@ -109,6 +111,9 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewHcxEnterpriseSitesServerTransport(&s.srv.HcxEnterpriseSitesServer) }) resp, err = s.trHcxEnterpriseSitesServer.Do(req) + case "IscsiPathsClient": + initServer(s, &s.trIscsiPathsServer, func() *IscsiPathsServerTransport { return NewIscsiPathsServerTransport(&s.srv.IscsiPathsServer) }) + resp, err = s.trIscsiPathsServer.Do(req) case "LocationsClient": initServer(s, &s.trLocationsServer, func() *LocationsServerTransport { return NewLocationsServerTransport(&s.srv.LocationsServer) }) resp, err = s.trLocationsServer.Do(req) diff --git a/sdk/resourcemanager/avs/armavs/fake/time_rfc3339.go b/sdk/resourcemanager/avs/armavs/fake/time_rfc3339.go index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/avs/armavs/fake/time_rfc3339.go +++ b/sdk/resourcemanager/avs/armavs/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/avs/armavs/fake/virtualmachines_server.go b/sdk/resourcemanager/avs/armavs/fake/virtualmachines_server.go index c2cf2df610a5..e9ebb8453978 100644 --- a/sdk/resourcemanager/avs/armavs/fake/virtualmachines_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/virtualmachines_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/avs/armavs/fake/workloadnetworks_server.go b/sdk/resourcemanager/avs/armavs/fake/workloadnetworks_server.go index 4341228fd4ae..0055aee8584f 100644 --- a/sdk/resourcemanager/avs/armavs/fake/workloadnetworks_server.go +++ b/sdk/resourcemanager/avs/armavs/fake/workloadnetworks_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2" "net/http" "net/url" "regexp" @@ -82,7 +82,7 @@ type WorkloadNetworksServer struct { // Get is the fake for method WorkloadNetworksClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, privateCloudName string, workloadNetworkName armavs.WorkloadNetworkName, options *armavs.WorkloadNetworksClientGetOptions) (resp azfake.Responder[armavs.WorkloadNetworksClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceGroupName string, privateCloudName string, options *armavs.WorkloadNetworksClientGetOptions) (resp azfake.Responder[armavs.WorkloadNetworksClientGetResponse], errResp azfake.ErrorResponder) // GetDNSService is the fake for method WorkloadNetworksClient.GetDNSService // HTTP status codes to indicate success: http.StatusOK @@ -162,27 +162,27 @@ type WorkloadNetworksServer struct { // BeginUpdateDNSService is the fake for method WorkloadNetworksClient.BeginUpdateDNSService // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdateDNSService func(ctx context.Context, resourceGroupName string, privateCloudName string, dnsServiceID string, workloadNetworkDNSService armavs.WorkloadNetworkDNSService, options *armavs.WorkloadNetworksClientBeginUpdateDNSServiceOptions) (resp azfake.PollerResponder[armavs.WorkloadNetworksClientUpdateDNSServiceResponse], errResp azfake.ErrorResponder) + BeginUpdateDNSService func(ctx context.Context, resourceGroupName string, privateCloudName string, dnsServiceID string, workloadNetworkDNSService armavs.WorkloadNetworkDNSServiceUpdate, options *armavs.WorkloadNetworksClientBeginUpdateDNSServiceOptions) (resp azfake.PollerResponder[armavs.WorkloadNetworksClientUpdateDNSServiceResponse], errResp azfake.ErrorResponder) // BeginUpdateDNSZone is the fake for method WorkloadNetworksClient.BeginUpdateDNSZone // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdateDNSZone func(ctx context.Context, resourceGroupName string, privateCloudName string, dnsZoneID string, workloadNetworkDNSZone armavs.WorkloadNetworkDNSZone, options *armavs.WorkloadNetworksClientBeginUpdateDNSZoneOptions) (resp azfake.PollerResponder[armavs.WorkloadNetworksClientUpdateDNSZoneResponse], errResp azfake.ErrorResponder) + BeginUpdateDNSZone func(ctx context.Context, resourceGroupName string, privateCloudName string, dnsZoneID string, workloadNetworkDNSZone armavs.WorkloadNetworkDNSZoneUpdate, options *armavs.WorkloadNetworksClientBeginUpdateDNSZoneOptions) (resp azfake.PollerResponder[armavs.WorkloadNetworksClientUpdateDNSZoneResponse], errResp azfake.ErrorResponder) // BeginUpdateDhcp is the fake for method WorkloadNetworksClient.BeginUpdateDhcp // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdateDhcp func(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp armavs.WorkloadNetworkDhcp, options *armavs.WorkloadNetworksClientBeginUpdateDhcpOptions) (resp azfake.PollerResponder[armavs.WorkloadNetworksClientUpdateDhcpResponse], errResp azfake.ErrorResponder) + BeginUpdateDhcp func(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp armavs.WorkloadNetworkDhcpUpdate, options *armavs.WorkloadNetworksClientBeginUpdateDhcpOptions) (resp azfake.PollerResponder[armavs.WorkloadNetworksClientUpdateDhcpResponse], errResp azfake.ErrorResponder) // BeginUpdatePortMirroring is the fake for method WorkloadNetworksClient.BeginUpdatePortMirroring // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdatePortMirroring func(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring armavs.WorkloadNetworkPortMirroring, options *armavs.WorkloadNetworksClientBeginUpdatePortMirroringOptions) (resp azfake.PollerResponder[armavs.WorkloadNetworksClientUpdatePortMirroringResponse], errResp azfake.ErrorResponder) + BeginUpdatePortMirroring func(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring armavs.WorkloadNetworkPortMirroringUpdate, options *armavs.WorkloadNetworksClientBeginUpdatePortMirroringOptions) (resp azfake.PollerResponder[armavs.WorkloadNetworksClientUpdatePortMirroringResponse], errResp azfake.ErrorResponder) // BeginUpdateSegments is the fake for method WorkloadNetworksClient.BeginUpdateSegments // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdateSegments func(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment armavs.WorkloadNetworkSegment, options *armavs.WorkloadNetworksClientBeginUpdateSegmentsOptions) (resp azfake.PollerResponder[armavs.WorkloadNetworksClientUpdateSegmentsResponse], errResp azfake.ErrorResponder) + BeginUpdateSegments func(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment armavs.WorkloadNetworkSegmentUpdate, options *armavs.WorkloadNetworksClientBeginUpdateSegmentsOptions) (resp azfake.PollerResponder[armavs.WorkloadNetworksClientUpdateSegmentsResponse], errResp azfake.ErrorResponder) // BeginUpdateVMGroup is the fake for method WorkloadNetworksClient.BeginUpdateVMGroup // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdateVMGroup func(ctx context.Context, resourceGroupName string, privateCloudName string, vmGroupID string, workloadNetworkVMGroup armavs.WorkloadNetworkVMGroup, options *armavs.WorkloadNetworksClientBeginUpdateVMGroupOptions) (resp azfake.PollerResponder[armavs.WorkloadNetworksClientUpdateVMGroupResponse], errResp azfake.ErrorResponder) + BeginUpdateVMGroup func(ctx context.Context, resourceGroupName string, privateCloudName string, vmGroupID string, workloadNetworkVMGroup armavs.WorkloadNetworkVMGroupUpdate, options *armavs.WorkloadNetworksClientBeginUpdateVMGroupOptions) (resp azfake.PollerResponder[armavs.WorkloadNetworksClientUpdateVMGroupResponse], errResp azfake.ErrorResponder) } // NewWorkloadNetworksServerTransport creates a new instance of WorkloadNetworksServerTransport with the provided implementation. @@ -1067,10 +1067,10 @@ func (w *WorkloadNetworksServerTransport) dispatchGet(req *http.Request) (*http. if w.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AVS/privateClouds/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/workloadNetworks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AVS/privateClouds/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/workloadNetworks/default` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -1081,17 +1081,7 @@ func (w *WorkloadNetworksServerTransport) dispatchGet(req *http.Request) (*http. if err != nil { return nil, err } - workloadNetworkNameParam, err := parseWithCast(matches[regex.SubexpIndex("workloadNetworkName")], func(v string) (armavs.WorkloadNetworkName, error) { - p, unescapeErr := url.PathUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armavs.WorkloadNetworkName(p), nil - }) - if err != nil { - return nil, err - } - respr, errRespr := w.srv.Get(req.Context(), resourceGroupNameParam, privateCloudNameParam, workloadNetworkNameParam, nil) + respr, errRespr := w.srv.Get(req.Context(), resourceGroupNameParam, privateCloudNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -1861,7 +1851,7 @@ func (w *WorkloadNetworksServerTransport) dispatchBeginUpdateDNSService(req *htt if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armavs.WorkloadNetworkDNSService](req) + body, err := server.UnmarshalRequestAsJSON[armavs.WorkloadNetworkDNSServiceUpdate](req) if err != nil { return nil, err } @@ -1913,7 +1903,7 @@ func (w *WorkloadNetworksServerTransport) dispatchBeginUpdateDNSZone(req *http.R if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armavs.WorkloadNetworkDNSZone](req) + body, err := server.UnmarshalRequestAsJSON[armavs.WorkloadNetworkDNSZoneUpdate](req) if err != nil { return nil, err } @@ -1965,7 +1955,7 @@ func (w *WorkloadNetworksServerTransport) dispatchBeginUpdateDhcp(req *http.Requ if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armavs.WorkloadNetworkDhcp](req) + body, err := server.UnmarshalRequestAsJSON[armavs.WorkloadNetworkDhcpUpdate](req) if err != nil { return nil, err } @@ -2017,7 +2007,7 @@ func (w *WorkloadNetworksServerTransport) dispatchBeginUpdatePortMirroring(req * if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armavs.WorkloadNetworkPortMirroring](req) + body, err := server.UnmarshalRequestAsJSON[armavs.WorkloadNetworkPortMirroringUpdate](req) if err != nil { return nil, err } @@ -2069,7 +2059,7 @@ func (w *WorkloadNetworksServerTransport) dispatchBeginUpdateSegments(req *http. if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armavs.WorkloadNetworkSegment](req) + body, err := server.UnmarshalRequestAsJSON[armavs.WorkloadNetworkSegmentUpdate](req) if err != nil { return nil, err } @@ -2121,7 +2111,7 @@ func (w *WorkloadNetworksServerTransport) dispatchBeginUpdateVMGroup(req *http.R if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armavs.WorkloadNetworkVMGroup](req) + body, err := server.UnmarshalRequestAsJSON[armavs.WorkloadNetworkVMGroupUpdate](req) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/avs/armavs/globalreachconnections_client.go b/sdk/resourcemanager/avs/armavs/globalreachconnections_client.go index 5a042875e76e..114c13c7e8c2 100644 --- a/sdk/resourcemanager/avs/armavs/globalreachconnections_client.go +++ b/sdk/resourcemanager/avs/armavs/globalreachconnections_client.go @@ -43,14 +43,14 @@ func NewGlobalReachConnectionsClient(subscriptionID string, credential azcore.To return client, nil } -// BeginCreateOrUpdate - Create or update a global reach connection in a private cloud +// BeginCreateOrUpdate - Create a GlobalReachConnection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - privateCloudName - The name of the private cloud. -// - globalReachConnectionName - Name of the global reach connection in the private cloud -// - globalReachConnection - A global reach connection in the private cloud +// - privateCloudName - Name of the private cloud +// - globalReachConnectionName - Name of the global reach connection +// - globalReachConnection - Resource create parameters. // - options - GlobalReachConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GlobalReachConnectionsClient.BeginCreateOrUpdate // method. func (client *GlobalReachConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, globalReachConnectionName string, globalReachConnection GlobalReachConnection, options *GlobalReachConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GlobalReachConnectionsClientCreateOrUpdateResponse], error) { @@ -60,7 +60,8 @@ func (client *GlobalReachConnectionsClient) BeginCreateOrUpdate(ctx context.Cont return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalReachConnectionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,10 +71,10 @@ func (client *GlobalReachConnectionsClient) BeginCreateOrUpdate(ctx context.Cont } } -// CreateOrUpdate - Create or update a global reach connection in a private cloud +// CreateOrUpdate - Create a GlobalReachConnection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *GlobalReachConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, globalReachConnectionName string, globalReachConnection GlobalReachConnection, options *GlobalReachConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "GlobalReachConnectionsClient.BeginCreateOrUpdate" @@ -119,7 +120,7 @@ func (client *GlobalReachConnectionsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, globalReachConnection); err != nil { @@ -128,13 +129,13 @@ func (client *GlobalReachConnectionsClient) createOrUpdateCreateRequest(ctx cont return req, nil } -// BeginDelete - Delete a global reach connection in a private cloud +// BeginDelete - Delete a GlobalReachConnection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - globalReachConnectionName - Name of the global reach connection in the private cloud +// - globalReachConnectionName - Name of the global reach connection // - options - GlobalReachConnectionsClientBeginDeleteOptions contains the optional parameters for the GlobalReachConnectionsClient.BeginDelete // method. func (client *GlobalReachConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, privateCloudName string, globalReachConnectionName string, options *GlobalReachConnectionsClientBeginDeleteOptions) (*runtime.Poller[GlobalReachConnectionsClientDeleteResponse], error) { @@ -144,7 +145,8 @@ func (client *GlobalReachConnectionsClient) BeginDelete(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalReachConnectionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -154,10 +156,10 @@ func (client *GlobalReachConnectionsClient) BeginDelete(ctx context.Context, res } } -// Delete - Delete a global reach connection in a private cloud +// Delete - Delete a GlobalReachConnection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *GlobalReachConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateCloudName string, globalReachConnectionName string, options *GlobalReachConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "GlobalReachConnectionsClient.BeginDelete" @@ -203,19 +205,19 @@ func (client *GlobalReachConnectionsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get a global reach connection by name in a private cloud +// Get - Get a GlobalReachConnection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - globalReachConnectionName - Name of the global reach connection in the private cloud +// - globalReachConnectionName - Name of the global reach connection // - options - GlobalReachConnectionsClientGetOptions contains the optional parameters for the GlobalReachConnectionsClient.Get // method. func (client *GlobalReachConnectionsClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, globalReachConnectionName string, options *GlobalReachConnectionsClientGetOptions) (GlobalReachConnectionsClientGetResponse, error) { @@ -264,7 +266,7 @@ func (client *GlobalReachConnectionsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,9 +281,9 @@ func (client *GlobalReachConnectionsClient) getHandleResponse(resp *http.Respons return result, nil } -// NewListPager - List global reach connections in a private cloud +// NewListPager - List GlobalReachConnection resources by PrivateCloud // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - GlobalReachConnectionsClientListOptions contains the optional parameters for the GlobalReachConnectionsClient.NewListPager @@ -329,7 +331,7 @@ func (client *GlobalReachConnectionsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -338,7 +340,7 @@ func (client *GlobalReachConnectionsClient) listCreateRequest(ctx context.Contex // listHandleResponse handles the List response. func (client *GlobalReachConnectionsClient) listHandleResponse(resp *http.Response) (GlobalReachConnectionsClientListResponse, error) { result := GlobalReachConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GlobalReachConnectionList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.GlobalReachConnectionListResult); err != nil { return GlobalReachConnectionsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/avs/armavs/globalreachconnections_client_example_test.go b/sdk/resourcemanager/avs/armavs/globalreachconnections_client_example_test.go deleted file mode 100644 index 3192ad540d02..000000000000 --- a/sdk/resourcemanager/avs/armavs/globalreachconnections_client_example_test.go +++ /dev/null @@ -1,156 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/GlobalReachConnections_List.json -func ExampleGlobalReachConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGlobalReachConnectionsClient().NewListPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GlobalReachConnectionList = armavs.GlobalReachConnectionList{ - // Value: []*armavs.GlobalReachConnection{ - // { - // Name: to.Ptr("connection1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/globalReachConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1"), - // Properties: &armavs.GlobalReachConnectionProperties{ - // AddressPrefix: to.Ptr("10.2.3.16/29"), - // AuthorizationKey: to.Ptr("01010101-0101-0101-0101-010101010101"), - // CircuitConnectionStatus: to.Ptr(armavs.GlobalReachConnectionStatusConnected), - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // PeerExpressRouteCircuit: to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer"), - // ProvisioningState: to.Ptr(armavs.GlobalReachConnectionProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/GlobalReachConnections_Get.json -func ExampleGlobalReachConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGlobalReachConnectionsClient().Get(ctx, "group1", "cloud1", "connection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GlobalReachConnection = armavs.GlobalReachConnection{ - // Name: to.Ptr("connection1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/globalReachConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1"), - // Properties: &armavs.GlobalReachConnectionProperties{ - // AddressPrefix: to.Ptr("10.2.3.16/29"), - // AuthorizationKey: to.Ptr("01010101-0101-0101-0101-010101010101"), - // CircuitConnectionStatus: to.Ptr(armavs.GlobalReachConnectionStatusConnected), - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // PeerExpressRouteCircuit: to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer"), - // ProvisioningState: to.Ptr(armavs.GlobalReachConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/GlobalReachConnections_CreateOrUpdate.json -func ExampleGlobalReachConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGlobalReachConnectionsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "connection1", armavs.GlobalReachConnection{ - Properties: &armavs.GlobalReachConnectionProperties{ - AuthorizationKey: to.Ptr("01010101-0101-0101-0101-010101010101"), - PeerExpressRouteCircuit: to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GlobalReachConnection = armavs.GlobalReachConnection{ - // Name: to.Ptr("connection1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/globalReachConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1"), - // Properties: &armavs.GlobalReachConnectionProperties{ - // AddressPrefix: to.Ptr("10.2.3.16/29"), - // AuthorizationKey: to.Ptr("01010101-0101-0101-0101-010101010101"), - // CircuitConnectionStatus: to.Ptr(armavs.GlobalReachConnectionStatusConnected), - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // PeerExpressRouteCircuit: to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer"), - // ProvisioningState: to.Ptr(armavs.GlobalReachConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/GlobalReachConnections_Delete.json -func ExampleGlobalReachConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGlobalReachConnectionsClient().BeginDelete(ctx, "group1", "cloud1", "connection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/avs/armavs/go.mod b/sdk/resourcemanager/avs/armavs/go.mod index f9c6c5a1fef6..e9d1ddea341c 100644 --- a/sdk/resourcemanager/avs/armavs/go.mod +++ b/sdk/resourcemanager/avs/armavs/go.mod @@ -1,21 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect - github.com/golang-jwt/jwt/v5 v5.0.0 // indirect - github.com/google/uuid v1.3.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.19.0 // indirect golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect ) diff --git a/sdk/resourcemanager/avs/armavs/go.sum b/sdk/resourcemanager/avs/armavs/go.sum index 0766d184c256..8e1b70aaca5f 100644 --- a/sdk/resourcemanager/avs/armavs/go.sum +++ b/sdk/resourcemanager/avs/armavs/go.sum @@ -1,31 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 h1:c4k2FIYIh4xtwqrQwV0Ct1v5+ehlNXj5NI/MWVsiTkQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2/go.mod h1:5FDJtLEO/GxwNgUxbwrY3LP0pEoThTQJtk2oysdXHxM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 h1:LqbJ/WzJUwBf8UiaSzgX7aMclParm9/5Vgp+TY51uBQ= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2/go.mod h1:yInRyqWXAuaPrgI7p70+lDDgh3mlBohis29jGMISnmc= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/avs/armavs/hcxenterprisesites_client.go b/sdk/resourcemanager/avs/armavs/hcxenterprisesites_client.go index b9760a3cd4c5..6badd2bdf1f8 100644 --- a/sdk/resourcemanager/avs/armavs/hcxenterprisesites_client.go +++ b/sdk/resourcemanager/avs/armavs/hcxenterprisesites_client.go @@ -43,14 +43,14 @@ func NewHcxEnterpriseSitesClient(subscriptionID string, credential azcore.TokenC return client, nil } -// CreateOrUpdate - Create or update an activation key for on-premises HCX site +// CreateOrUpdate - Create a HcxEnterpriseSite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - privateCloudName - The name of the private cloud. -// - hcxEnterpriseSiteName - Name of the HCX Enterprise Site in the private cloud -// - hcxEnterpriseSite - The HCX Enterprise Site +// - privateCloudName - Name of the private cloud +// - hcxEnterpriseSiteName - Name of the HCX Enterprise Site +// - hcxEnterpriseSite - Resource create parameters. // - options - HcxEnterpriseSitesClientCreateOrUpdateOptions contains the optional parameters for the HcxEnterpriseSitesClient.CreateOrUpdate // method. func (client *HcxEnterpriseSitesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, hcxEnterpriseSiteName string, hcxEnterpriseSite HcxEnterpriseSite, options *HcxEnterpriseSitesClientCreateOrUpdateOptions) (HcxEnterpriseSitesClientCreateOrUpdateResponse, error) { @@ -99,7 +99,7 @@ func (client *HcxEnterpriseSitesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, hcxEnterpriseSite); err != nil { @@ -117,13 +117,13 @@ func (client *HcxEnterpriseSitesClient) createOrUpdateHandleResponse(resp *http. return result, nil } -// Delete - Delete HCX on-premises key in a private cloud +// Delete - Delete a HcxEnterpriseSite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - hcxEnterpriseSiteName - Name of the HCX Enterprise Site in the private cloud +// - hcxEnterpriseSiteName - Name of the HCX Enterprise Site // - options - HcxEnterpriseSitesClientDeleteOptions contains the optional parameters for the HcxEnterpriseSitesClient.Delete // method. func (client *HcxEnterpriseSitesClient) Delete(ctx context.Context, resourceGroupName string, privateCloudName string, hcxEnterpriseSiteName string, options *HcxEnterpriseSitesClientDeleteOptions) (HcxEnterpriseSitesClientDeleteResponse, error) { @@ -171,19 +171,19 @@ func (client *HcxEnterpriseSitesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get an HCX on-premises key by name in a private cloud +// Get - Get a HcxEnterpriseSite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - hcxEnterpriseSiteName - Name of the HCX Enterprise Site in the private cloud +// - hcxEnterpriseSiteName - Name of the HCX Enterprise Site // - options - HcxEnterpriseSitesClientGetOptions contains the optional parameters for the HcxEnterpriseSitesClient.Get method. func (client *HcxEnterpriseSitesClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, hcxEnterpriseSiteName string, options *HcxEnterpriseSitesClientGetOptions) (HcxEnterpriseSitesClientGetResponse, error) { var err error @@ -231,7 +231,7 @@ func (client *HcxEnterpriseSitesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,9 +246,9 @@ func (client *HcxEnterpriseSitesClient) getHandleResponse(resp *http.Response) ( return result, nil } -// NewListPager - List HCX on-premises key in a private cloud +// NewListPager - List HcxEnterpriseSite resources by PrivateCloud // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - HcxEnterpriseSitesClientListOptions contains the optional parameters for the HcxEnterpriseSitesClient.NewListPager @@ -296,7 +296,7 @@ func (client *HcxEnterpriseSitesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,7 +305,7 @@ func (client *HcxEnterpriseSitesClient) listCreateRequest(ctx context.Context, r // listHandleResponse handles the List response. func (client *HcxEnterpriseSitesClient) listHandleResponse(resp *http.Response) (HcxEnterpriseSitesClientListResponse, error) { result := HcxEnterpriseSitesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HcxEnterpriseSiteList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.HcxEnterpriseSiteListResult); err != nil { return HcxEnterpriseSitesClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/avs/armavs/hcxenterprisesites_client_example_test.go b/sdk/resourcemanager/avs/armavs/hcxenterprisesites_client_example_test.go deleted file mode 100644 index 69768a0a2c85..000000000000 --- a/sdk/resourcemanager/avs/armavs/hcxenterprisesites_client_example_test.go +++ /dev/null @@ -1,130 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/HcxEnterpriseSites_List.json -func ExampleHcxEnterpriseSitesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHcxEnterpriseSitesClient().NewListPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.HcxEnterpriseSiteList = armavs.HcxEnterpriseSiteList{ - // Value: []*armavs.HcxEnterpriseSite{ - // { - // Name: to.Ptr("site1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/hcxEnterpriseSites"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/hcxEnterpriseSites/site1"), - // Properties: &armavs.HcxEnterpriseSiteProperties{ - // ActivationKey: to.Ptr("0276EF1A9A1749A5A362BF73EA9F8D0D"), - // Status: to.Ptr(armavs.HcxEnterpriseSiteStatusAvailable), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/HcxEnterpriseSites_Get.json -func ExampleHcxEnterpriseSitesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHcxEnterpriseSitesClient().Get(ctx, "group1", "cloud1", "site1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HcxEnterpriseSite = armavs.HcxEnterpriseSite{ - // Name: to.Ptr("site1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/hcxEnterpriseSites"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/hcxEnterpriseSites/site1"), - // Properties: &armavs.HcxEnterpriseSiteProperties{ - // ActivationKey: to.Ptr("0276EF1A9A1749A5A362BF73EA9F8D0D"), - // Status: to.Ptr(armavs.HcxEnterpriseSiteStatusAvailable), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/HcxEnterpriseSites_CreateOrUpdate.json -func ExampleHcxEnterpriseSitesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHcxEnterpriseSitesClient().CreateOrUpdate(ctx, "group1", "cloud1", "site1", armavs.HcxEnterpriseSite{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HcxEnterpriseSite = armavs.HcxEnterpriseSite{ - // Name: to.Ptr("site1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/hcxEnterpriseSites"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/hcxEnterpriseSites/site1"), - // Properties: &armavs.HcxEnterpriseSiteProperties{ - // ActivationKey: to.Ptr("0276EF1A9A1749A5A362BF73EA9F8D0D"), - // Status: to.Ptr(armavs.HcxEnterpriseSiteStatusAvailable), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/HcxEnterpriseSites_Delete.json -func ExampleHcxEnterpriseSitesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewHcxEnterpriseSitesClient().Delete(ctx, "group1", "cloud1", "site1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/avs/armavs/interfaces.go b/sdk/resourcemanager/avs/armavs/interfaces.go index 8a304979cdf8..431f20be7b42 100644 --- a/sdk/resourcemanager/avs/armavs/interfaces.go +++ b/sdk/resourcemanager/avs/armavs/interfaces.go @@ -43,3 +43,12 @@ type WorkloadNetworkDhcpEntityClassification interface { // GetWorkloadNetworkDhcpEntity returns the WorkloadNetworkDhcpEntity content of the underlying type. GetWorkloadNetworkDhcpEntity() *WorkloadNetworkDhcpEntity } + +// WorkloadNetworkDhcpEntityUpdateClassification provides polymorphic access to related types. +// Call the interface's GetWorkloadNetworkDhcpEntityUpdate() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *WorkloadNetworkDhcpEntityUpdate, *WorkloadNetworkDhcpRelayUpdate, *WorkloadNetworkDhcpServerUpdate +type WorkloadNetworkDhcpEntityUpdateClassification interface { + // GetWorkloadNetworkDhcpEntityUpdate returns the WorkloadNetworkDhcpEntityUpdate content of the underlying type. + GetWorkloadNetworkDhcpEntityUpdate() *WorkloadNetworkDhcpEntityUpdate +} diff --git a/sdk/resourcemanager/avs/armavs/iscsipaths_client.go b/sdk/resourcemanager/avs/armavs/iscsipaths_client.go new file mode 100644 index 000000000000..358412ddcb0d --- /dev/null +++ b/sdk/resourcemanager/avs/armavs/iscsipaths_client.go @@ -0,0 +1,330 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armavs + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// IscsiPathsClient contains the methods for the IscsiPaths group. +// Don't use this type directly, use NewIscsiPathsClient() instead. +type IscsiPathsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewIscsiPathsClient creates a new instance of IscsiPathsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewIscsiPathsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IscsiPathsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &IscsiPathsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a IscsiPath +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - privateCloudName - Name of the private cloud +// - resource - Resource create parameters. +// - options - IscsiPathsClientBeginCreateOrUpdateOptions contains the optional parameters for the IscsiPathsClient.BeginCreateOrUpdate +// method. +func (client *IscsiPathsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, resource IscsiPath, options *IscsiPathsClientBeginCreateOrUpdateOptions) (*runtime.Poller[IscsiPathsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, privateCloudName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IscsiPathsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[IscsiPathsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create a IscsiPath +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *IscsiPathsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, resource IscsiPath, options *IscsiPathsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "IscsiPathsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, privateCloudName, resource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *IscsiPathsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, resource IscsiPath, options *IscsiPathsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if privateCloudName == "" { + return nil, errors.New("parameter privateCloudName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateCloudName}", url.PathEscape(privateCloudName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete a IscsiPath +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - privateCloudName - Name of the private cloud +// - options - IscsiPathsClientBeginDeleteOptions contains the optional parameters for the IscsiPathsClient.BeginDelete method. +func (client *IscsiPathsClient) BeginDelete(ctx context.Context, resourceGroupName string, privateCloudName string, options *IscsiPathsClientBeginDeleteOptions) (*runtime.Poller[IscsiPathsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, privateCloudName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IscsiPathsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[IscsiPathsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete a IscsiPath +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +func (client *IscsiPathsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateCloudName string, options *IscsiPathsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "IscsiPathsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, privateCloudName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *IscsiPathsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, options *IscsiPathsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if privateCloudName == "" { + return nil, errors.New("parameter privateCloudName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateCloudName}", url.PathEscape(privateCloudName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a IscsiPath +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - privateCloudName - Name of the private cloud +// - options - IscsiPathsClientGetOptions contains the optional parameters for the IscsiPathsClient.Get method. +func (client *IscsiPathsClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, options *IscsiPathsClientGetOptions) (IscsiPathsClientGetResponse, error) { + var err error + const operationName = "IscsiPathsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, privateCloudName, options) + if err != nil { + return IscsiPathsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return IscsiPathsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IscsiPathsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *IscsiPathsClient) getCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, options *IscsiPathsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if privateCloudName == "" { + return nil, errors.New("parameter privateCloudName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateCloudName}", url.PathEscape(privateCloudName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *IscsiPathsClient) getHandleResponse(resp *http.Response) (IscsiPathsClientGetResponse, error) { + result := IscsiPathsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IscsiPath); err != nil { + return IscsiPathsClientGetResponse{}, err + } + return result, nil +} + +// NewListByPrivateCloudPager - List IscsiPath resources by PrivateCloud +// +// Generated from API version 2023-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - privateCloudName - Name of the private cloud +// - options - IscsiPathsClientListByPrivateCloudOptions contains the optional parameters for the IscsiPathsClient.NewListByPrivateCloudPager +// method. +func (client *IscsiPathsClient) NewListByPrivateCloudPager(resourceGroupName string, privateCloudName string, options *IscsiPathsClientListByPrivateCloudOptions) *runtime.Pager[IscsiPathsClientListByPrivateCloudResponse] { + return runtime.NewPager(runtime.PagingHandler[IscsiPathsClientListByPrivateCloudResponse]{ + More: func(page IscsiPathsClientListByPrivateCloudResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *IscsiPathsClientListByPrivateCloudResponse) (IscsiPathsClientListByPrivateCloudResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "IscsiPathsClient.NewListByPrivateCloudPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByPrivateCloudCreateRequest(ctx, resourceGroupName, privateCloudName, options) + }, nil) + if err != nil { + return IscsiPathsClientListByPrivateCloudResponse{}, err + } + return client.listByPrivateCloudHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByPrivateCloudCreateRequest creates the ListByPrivateCloud request. +func (client *IscsiPathsClient) listByPrivateCloudCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, options *IscsiPathsClientListByPrivateCloudOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/iscsiPaths" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if privateCloudName == "" { + return nil, errors.New("parameter privateCloudName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateCloudName}", url.PathEscape(privateCloudName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByPrivateCloudHandleResponse handles the ListByPrivateCloud response. +func (client *IscsiPathsClient) listByPrivateCloudHandleResponse(resp *http.Response) (IscsiPathsClientListByPrivateCloudResponse, error) { + result := IscsiPathsClientListByPrivateCloudResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.IscsiPathListResult); err != nil { + return IscsiPathsClientListByPrivateCloudResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/avs/armavs/locations_client.go b/sdk/resourcemanager/avs/armavs/locations_client.go index 5d3e9938024d..47431b4535ba 100644 --- a/sdk/resourcemanager/avs/armavs/locations_client.go +++ b/sdk/resourcemanager/avs/armavs/locations_client.go @@ -46,8 +46,8 @@ func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential // CheckQuotaAvailability - Return quota for subscription by region // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 -// - location - Azure region +// Generated from API version 2023-09-01 +// - location - A location in a subscription // - options - LocationsClientCheckQuotaAvailabilityOptions contains the optional parameters for the LocationsClient.CheckQuotaAvailability // method. func (client *LocationsClient) CheckQuotaAvailability(ctx context.Context, location string, options *LocationsClientCheckQuotaAvailabilityOptions) (LocationsClientCheckQuotaAvailabilityResponse, error) { @@ -88,7 +88,7 @@ func (client *LocationsClient) checkQuotaAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,8 +106,8 @@ func (client *LocationsClient) checkQuotaAvailabilityHandleResponse(resp *http.R // CheckTrialAvailability - Return trial status for subscription by region // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 -// - location - Azure region +// Generated from API version 2023-09-01 +// - location - A location in a subscription // - options - LocationsClientCheckTrialAvailabilityOptions contains the optional parameters for the LocationsClient.CheckTrialAvailability // method. func (client *LocationsClient) CheckTrialAvailability(ctx context.Context, location string, options *LocationsClientCheckTrialAvailabilityOptions) (LocationsClientCheckTrialAvailabilityResponse, error) { @@ -148,7 +148,7 @@ func (client *LocationsClient) checkTrialAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SKU != nil { diff --git a/sdk/resourcemanager/avs/armavs/locations_client_example_test.go b/sdk/resourcemanager/avs/armavs/locations_client_example_test.go deleted file mode 100644 index dba1d0608853..000000000000 --- a/sdk/resourcemanager/avs/armavs/locations_client_example_test.go +++ /dev/null @@ -1,97 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Locations_CheckTrialAvailability.json -func ExampleLocationsClient_CheckTrialAvailability_locationsCheckTrialAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().CheckTrialAvailability(ctx, "eastus", &armavs.LocationsClientCheckTrialAvailabilityOptions{SKU: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Trial = armavs.Trial{ - // AvailableHosts: to.Ptr[int32](4), - // Status: to.Ptr(armavs.TrialStatusTrialAvailable), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Locations_CheckTrialAvailabilityWithSku.json -func ExampleLocationsClient_CheckTrialAvailability_locationsCheckTrialAvailabilityWithSku() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().CheckTrialAvailability(ctx, "eastus", &armavs.LocationsClientCheckTrialAvailabilityOptions{SKU: &armavs.SKU{ - Name: to.Ptr("avs52t"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Trial = armavs.Trial{ - // AvailableHosts: to.Ptr[int32](4), - // Status: to.Ptr(armavs.TrialStatusTrialAvailable), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Locations_CheckQuotaAvailability.json -func ExampleLocationsClient_CheckQuotaAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().CheckQuotaAvailability(ctx, "eastus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Quota = armavs.Quota{ - // HostsRemaining: map[string]*int32{ - // "AV20": to.Ptr[int32](0), - // "AV36": to.Ptr[int32](999), - // }, - // QuotaEnabled: to.Ptr(armavs.QuotaEnabledEnabled), - // } -} diff --git a/sdk/resourcemanager/avs/armavs/models.go b/sdk/resourcemanager/avs/armavs/models.go index 3f80f29e987a..314b830a57f3 100644 --- a/sdk/resourcemanager/avs/armavs/models.go +++ b/sdk/resourcemanager/avs/armavs/models.go @@ -12,22 +12,25 @@ import "time" // Addon - An addon resource type Addon struct { - // The properties of an addon resource + // The resource-specific properties for this resource. Properties AddonPropertiesClassification - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } // AddonArcProperties - The properties of an Arc addon type AddonArcProperties struct { - // REQUIRED; The type of private cloud addon + // REQUIRED; Addon type AddonType *AddonType // The VMware vCenter resource ID @@ -47,7 +50,7 @@ func (a *AddonArcProperties) GetAddonProperties() *AddonProperties { // AddonHcxProperties - The properties of an HCX addon type AddonHcxProperties struct { - // REQUIRED; The type of private cloud addon + // REQUIRED; Addon type AddonType *AddonType // REQUIRED; The HCX offer, example VMware MaaS Cloud Provider (Enterprise) @@ -65,18 +68,18 @@ func (a *AddonHcxProperties) GetAddonProperties() *AddonProperties { } } -// AddonList - A paged list of addons -type AddonList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on a page +// AddonListResult - The response of a Addon list operation. +type AddonListResult struct { + // REQUIRED; The Addon items on this page Value []*Addon + + // READ-ONLY; The link to the next page of items + NextLink *string } // AddonProperties - The properties of an addon type AddonProperties struct { - // REQUIRED; The type of private cloud addon + // REQUIRED; Addon type AddonType *AddonType // READ-ONLY; The state of the addon provisioning @@ -88,7 +91,7 @@ func (a *AddonProperties) GetAddonProperties() *AddonProperties { return a } // AddonSrmProperties - The properties of a Site Recovery Manager (SRM) addon type AddonSrmProperties struct { - // REQUIRED; The type of private cloud addon + // REQUIRED; Addon type AddonType *AddonType // The Site Recovery Manager (SRM) license @@ -108,7 +111,7 @@ func (a *AddonSrmProperties) GetAddonProperties() *AddonProperties { // AddonVrProperties - The properties of a vSphere Replication (VR) addon type AddonVrProperties struct { - // REQUIRED; The type of private cloud addon + // REQUIRED; Addon type AddonType *AddonType // REQUIRED; The vSphere Replication Server (VRS) count @@ -170,26 +173,29 @@ type Circuit struct { // CloudLink - A cloud link resource type CloudLink struct { - // The properties of a cloud link. + // The resource-specific properties for this resource. Properties *CloudLinkProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// CloudLinkList - A paged list of cloud links -type CloudLinkList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on a page +// CloudLinkListResult - The response of a CloudLink list operation. +type CloudLinkListResult struct { + // REQUIRED; The CloudLink items on this page Value []*CloudLink + + // READ-ONLY; The link to the next page of items + NextLink *string } // CloudLinkProperties - The properties of a cloud link. @@ -197,35 +203,41 @@ type CloudLinkProperties struct { // Identifier of the other private cloud participating in the link. LinkedCloud *string + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *CloudLinkProvisioningState + // READ-ONLY; The state of the cloud link. Status *CloudLinkStatus } // Cluster - A cluster resource type Cluster struct { - // REQUIRED; The cluster SKU + // REQUIRED; The SKU (Stock Keeping Unit) assigned to this resource. SKU *SKU - // The properties of a cluster resource + // The resource-specific properties for this resource. Properties *ClusterProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// ClusterList - A paged list of clusters -type ClusterList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on a page +// ClusterListResult - The response of a Cluster list operation. +type ClusterListResult struct { + // REQUIRED; The Cluster items on this page Value []*Cluster + + // READ-ONLY; The link to the next page of items + NextLink *string } // ClusterProperties - The properties of a cluster @@ -236,6 +248,9 @@ type ClusterProperties struct { // The hosts Hosts []*string + // Name of the vsan datastore associated with the cluster + VsanDatastoreName *string + // READ-ONLY; The identity ClusterID *int32 @@ -247,6 +262,9 @@ type ClusterProperties struct { type ClusterUpdate struct { // The properties of a cluster resource that may be updated Properties *ClusterUpdateProperties + + // The SKU (Stock Keeping Unit) assigned to this resource. + SKU *SKU } // ClusterUpdateProperties - The properties of a cluster that may be updated @@ -275,26 +293,29 @@ type ClusterZoneList struct { // Datastore - A datastore resource type Datastore struct { - // The properties of a datastore resource + // The resource-specific properties for this resource. Properties *DatastoreProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// DatastoreList - A paged list of datastores -type DatastoreList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on a page +// DatastoreListResult - The response of a Datastore list operation. +type DatastoreListResult struct { + // REQUIRED; The Datastore items on this page Value []*Datastore + + // READ-ONLY; The link to the next page of items + NextLink *string } // DatastoreProperties - The properties of a datastore @@ -302,6 +323,9 @@ type DatastoreProperties struct { // An iSCSI volume DiskPoolVolume *DiskPoolVolume + // An Elastic SAN volume + ElasticSanVolume *ElasticSanVolume + // An Azure NetApp Files volume NetAppVolume *NetAppVolume @@ -327,6 +351,12 @@ type DiskPoolVolume struct { Path *string } +// ElasticSanVolume - An Elastic SAN volume from Microsoft.ElasticSan provider +type ElasticSanVolume struct { + // REQUIRED; Azure resource ID of the Elastic SAN Volume + TargetID *string +} + // Encryption - The properties of customer managed encryption key type Encryption struct { // The key vault where the encryption key is stored @@ -359,38 +389,50 @@ type EncryptionKeyVaultProperties struct { // Endpoints - Endpoint addresses type Endpoints struct { - // READ-ONLY; Endpoint for the HCX Cloud Manager + // READ-ONLY; Endpoint FQDN for the HCX Cloud Manager HcxCloudManager *string - // READ-ONLY; Endpoint for the NSX-T Data Center manager + // READ-ONLY; Endpoint IP for the HCX Cloud Manager + HcxCloudManagerIP *string + + // READ-ONLY; Endpoint FQDN for the NSX-T Data Center manager NsxtManager *string - // READ-ONLY; Endpoint for Virtual Center Server Appliance + // READ-ONLY; Endpoint IP for the NSX-T Data Center manager + NsxtManagerIP *string + + // READ-ONLY; Endpoint IP for Virtual Center Server Appliance + VcenterIP *string + + // READ-ONLY; Endpoint FQDN for Virtual Center Server Appliance Vcsa *string } // ExpressRouteAuthorization - ExpressRoute Circuit Authorization type ExpressRouteAuthorization struct { - // READ-ONLY; Resource ID. + // The resource-specific properties for this resource. + Properties *ExpressRouteAuthorizationProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The properties of an ExpressRoute Circuit Authorization resource - Properties *ExpressRouteAuthorizationProperties + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData - // READ-ONLY; Resource type. + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// ExpressRouteAuthorizationList - A paged list of ExpressRoute Circuit Authorizations -type ExpressRouteAuthorizationList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on a page +// ExpressRouteAuthorizationListResult - The response of a ExpressRouteAuthorization list operation. +type ExpressRouteAuthorizationListResult struct { + // REQUIRED; The ExpressRouteAuthorization items on this page Value []*ExpressRouteAuthorization + + // READ-ONLY; The link to the next page of items + NextLink *string } // ExpressRouteAuthorizationProperties - The properties of an ExpressRoute Circuit Authorization resource @@ -410,26 +452,29 @@ type ExpressRouteAuthorizationProperties struct { // GlobalReachConnection - A global reach connection resource type GlobalReachConnection struct { - // The properties of a global reach connection resource + // The resource-specific properties for this resource. Properties *GlobalReachConnectionProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// GlobalReachConnectionList - A paged list of global reach connections -type GlobalReachConnectionList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on a page +// GlobalReachConnectionListResult - The response of a GlobalReachConnection list operation. +type GlobalReachConnectionListResult struct { + // REQUIRED; The GlobalReachConnection items on this page Value []*GlobalReachConnection + + // READ-ONLY; The link to the next page of items + NextLink *string } // GlobalReachConnectionProperties - The properties of a global reach connection @@ -455,26 +500,29 @@ type GlobalReachConnectionProperties struct { // HcxEnterpriseSite - An HCX Enterprise Site resource type HcxEnterpriseSite struct { - // READ-ONLY; Resource ID. + // The resource-specific properties for this resource. + Properties *HcxEnterpriseSiteProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; The properties of an HCX Enterprise Site resource - Properties *HcxEnterpriseSiteProperties + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData - // READ-ONLY; Resource type. + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// HcxEnterpriseSiteList - A paged list of HCX Enterprise Sites -type HcxEnterpriseSiteList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on a page +// HcxEnterpriseSiteListResult - The response of a HcxEnterpriseSite list operation. +type HcxEnterpriseSiteListResult struct { + // REQUIRED; The HcxEnterpriseSite items on this page Value []*HcxEnterpriseSite + + // READ-ONLY; The link to the next page of items + NextLink *string } // HcxEnterpriseSiteProperties - The properties of an HCX Enterprise Site @@ -482,6 +530,9 @@ type HcxEnterpriseSiteProperties struct { // READ-ONLY; The activation key ActivationKey *string + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *HcxEnterpriseSiteProvisioningState + // READ-ONLY; The status of the HCX Enterprise Site Status *HcxEnterpriseSiteStatus } @@ -519,16 +570,40 @@ type IdentitySource struct { Username *string } -// LogSpecification - Specifications of the Log for Azure Monitoring -type LogSpecification struct { - // Blob duration of the log - BlobDuration *string +// IscsiPath - An iSCSI path resource +type IscsiPath struct { + // The resource-specific properties for this resource. + Properties *IscsiPathProperties - // Localized friendly display name of the log - DisplayName *string + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string - // Name of the log + // READ-ONLY; The name of the resource Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// IscsiPathListResult - The response of a IscsiPath list operation. +type IscsiPathListResult struct { + // REQUIRED; The IscsiPath items on this page + Value []*IscsiPath + + // READ-ONLY; The link to the next page of items + NextLink *string +} + +// IscsiPathProperties - The properties of an iSCSI path resource +type IscsiPathProperties struct { + // REQUIRED; CIDR Block for iSCSI path. + NetworkBlock *string + + // READ-ONLY; The state of the iSCSI path provisioning + ProvisioningState *IscsiPathProvisioningState } // ManagementCluster - The properties of a management cluster @@ -539,6 +614,9 @@ type ManagementCluster struct { // The hosts Hosts []*string + // Name of the vsan datastore associated with the cluster + VsanDatastoreName *string + // READ-ONLY; The identity ClusterID *int32 @@ -546,123 +624,67 @@ type ManagementCluster struct { ProvisioningState *ClusterProvisioningState } -// MetricDimension - Specifications of the Dimension of metrics -type MetricDimension struct { - // Localized friendly display name of the dimension - DisplayName *string - - // Name of the dimension as it appears in MDM - InternalName *string - - // Name of the dimension - Name *string - - // A boolean flag indicating whether this dimension should be included for the shoebox export scenario - ToBeExportedForShoebox *bool -} - -// MetricSpecification - Specifications of the Metrics for Azure Monitoring -type MetricSpecification struct { - // Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. - AggregationType *string - - // Name of the metric category that the metric belongs to. A metric can only belong to a single category. - Category *string - - // Dimensions of the metric - Dimensions []*MetricDimension - - // Localized friendly description of the metric - DisplayDescription *string - - // Localized friendly display name of the metric - DisplayName *string - - // Whether or not the service is using regional MDM accounts. - EnableRegionalMdmAccount *string - - // Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. - FillGapWithZero *bool - - // Name of the metric - Name *string - - // The name of the MDM account. - SourceMdmAccount *string - - // The name of the MDM namespace. - SourceMdmNamespace *string - - // Supported aggregation types - SupportedAggregationTypes []*string - - // Supported time grain types - SupportedTimeGrainTypes []*string - - // Unit that makes sense for the metric - Unit *string -} - // NetAppVolume - An Azure NetApp Files volume from Microsoft.NetApp provider type NetAppVolume struct { // REQUIRED; Azure resource ID of the NetApp volume ID *string } -// Operation - A REST API operation +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { - // Gets or sets a value indicating whether the operation is a data action or not - IsDataAction *bool - - // Origin of the operation - Origin *string + // Localized display information for this particular operation. + Display *OperationDisplay - // Properties of the operation - Properties *OperationProperties + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType - // READ-ONLY; Contains the localized display information for this operation - Display *OperationDisplay + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane + // operations. + IsDataAction *bool - // READ-ONLY; Name of the operation being performed on this object + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + // "Microsoft.Compute/virtualMachines/capture/action" Name *string + + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + // value is "user,system" + Origin *Origin } -// OperationDisplay - Contains the localized display information for this operation +// OperationDisplay - Localized display information for this particular operation. type OperationDisplay struct { - // READ-ONLY; Localized friendly description for the operation + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. Description *string - // READ-ONLY; Localized friendly name for the operation + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + // Machine", "Restart Virtual Machine". Operation *string - // READ-ONLY; Localized friendly form of the resource provider name + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + // Compute". Provider *string - // READ-ONLY; Localized friendly form of the resource type related to this operation + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + // Schedule Collections". Resource *string } -// OperationList - Pageable list of operations -type OperationList struct { - // READ-ONLY; URL to get the next page if any +// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to +// get the next set of results. +type OperationListResult struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). NextLink *string - // READ-ONLY; List of operations + // READ-ONLY; List of operations supported by the resource provider Value []*Operation } -// OperationProperties - Extra Operation properties -type OperationProperties struct { - // Service specifications of the operation - ServiceSpecification *ServiceSpecification -} - // PSCredentialExecutionParameter - a powershell credential object type PSCredentialExecutionParameter struct { // REQUIRED; The parameter name Name *string - // REQUIRED; The type of execution parameter + // REQUIRED; script execution parameter type Type *ScriptExecutionParameterType // password for login @@ -680,33 +702,36 @@ func (p *PSCredentialExecutionParameter) GetScriptExecutionParameter() *ScriptEx } } -// PlacementPoliciesList - Represents list of placement policies -type PlacementPoliciesList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on the page - Value []*PlacementPolicy -} - // PlacementPolicy - A vSphere Distributed Resource Scheduler (DRS) placement policy type PlacementPolicy struct { - // placement policy properties + // The resource-specific properties for this resource. Properties PlacementPolicyPropertiesClassification - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// PlacementPolicyListResult - The response of a PlacementPolicy list operation. +type PlacementPolicyListResult struct { + // REQUIRED; The PlacementPolicy items on this page + Value []*PlacementPolicy + + // READ-ONLY; The link to the next page of items + NextLink *string +} + // PlacementPolicyProperties - Abstract placement policy properties type PlacementPolicyProperties struct { - // REQUIRED; placement policy type + // REQUIRED; Placement Policy type Type *PlacementPolicyType // Display name of the placement policy @@ -750,55 +775,48 @@ type PlacementPolicyUpdateProperties struct { // PrivateCloud - A private cloud resource type PrivateCloud struct { - // REQUIRED; The private cloud SKU - SKU *SKU + // REQUIRED; The geo-location where the resource lives + Location *string - // The identity of the private cloud, if configured. - Identity *PrivateCloudIdentity + // REQUIRED; The SKU (Stock Keeping Unit) assigned to this resource. + SKU *SKU - // Resource location - Location *string + // The managed service identities assigned to this resource. + Identity *SystemAssignedServiceIdentity - // The properties of a private cloud resource + // The resource-specific properties for this resource. Properties *PrivateCloudProperties - // Resource tags + // Resource tags. Tags map[string]*string - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// PrivateCloudIdentity - Identity for the virtual machine. -type PrivateCloudIdentity struct { - // 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. - Type *ResourceIdentityType - - // READ-ONLY; The principal ID of private cloud identity. This property will only be provided for a system assigned identity. - PrincipalID *string - - // READ-ONLY; The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity. - TenantID *string -} +// PrivateCloudListResult - The response of a PrivateCloud list operation. +type PrivateCloudListResult struct { + // REQUIRED; The PrivateCloud items on this page + Value []*PrivateCloud -// PrivateCloudList - A paged list of private clouds -type PrivateCloudList struct { - // READ-ONLY; URL to get the next page if any + // READ-ONLY; The link to the next page of items NextLink *string - - // READ-ONLY; The items on the page - Value []*PrivateCloud } // PrivateCloudProperties - The properties of a private cloud resource type PrivateCloudProperties struct { + // REQUIRED; The default cluster used for management + ManagementCluster *ManagementCluster + // REQUIRED; 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 @@ -810,6 +828,9 @@ type PrivateCloudProperties struct { // An ExpressRoute Circuit Circuit *Circuit + // The type of DNS zone to use. + DNSZoneType *DNSZoneType + // Customer managed key encryption, can be enabled or disabled Encryption *Encryption @@ -824,9 +845,6 @@ type PrivateCloudProperties struct { // Connectivity to internet is enabled or disabled Internet *InternetEnum - // The default cluster used for management - ManagementCluster *ManagementCluster - // Optionally, set the NSX-T Manager password when the private cloud is created NsxtPassword *string @@ -836,6 +854,9 @@ type PrivateCloudProperties struct { // Optionally, set the vCenter admin password when the private cloud is created VcenterPassword *string + // Azure resource ID of the virtual network + VirtualNetworkID *string + // READ-ONLY; The endpoints Endpoints *Endpoints @@ -867,13 +888,16 @@ type PrivateCloudProperties struct { // PrivateCloudUpdate - An update to a private cloud resource type PrivateCloudUpdate struct { - // The identity of the private cloud, if configured. - Identity *PrivateCloudIdentity + // The managed service identities assigned to this resource. + Identity *SystemAssignedServiceIdentity // The updatable properties of a private cloud resource Properties *PrivateCloudUpdateProperties - // Resource tags + // The SKU (Stock Keeping Unit) assigned to this resource. + SKU *SKU + + // Resource tags. Tags map[string]*string } @@ -882,6 +906,9 @@ type PrivateCloudUpdateProperties struct { // Properties describing how the cloud is distributed across availability zones Availability *AvailabilityProperties + // The type of DNS zone to use. + DNSZoneType *DNSZoneType + // Customer managed key encryption, can be enabled or disabled Encryption *Encryption @@ -911,67 +938,102 @@ type Quota struct { // SKU - The resource model definition representing SKU type SKU struct { - // REQUIRED; The name of the SKU. + // REQUIRED; The name of the SKU. Ex - P3. It is typically a letter+number code Name *string + + // 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. + Capacity *int32 + + // If the service has different generations of hardware, for the same SKU, then that can be captured here. + Family *string + + // The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + Size *string + + // This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required + // on a PUT. + Tier *SKUTier } // ScriptCmdlet - A cmdlet available for script execution type ScriptCmdlet struct { - // The properties of a script cmdlet resource + // The resource-specific properties for this resource. Properties *ScriptCmdletProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// ScriptCmdletListResult - The response of a ScriptCmdlet list operation. +type ScriptCmdletListResult struct { + // REQUIRED; The ScriptCmdlet items on this page + Value []*ScriptCmdlet + + // READ-ONLY; The link to the next page of items + NextLink *string +} + // ScriptCmdletProperties - Properties of a pre-canned script type ScriptCmdletProperties struct { + // READ-ONLY; Specifies whether a script cmdlet is intended to be invoked only through automation or visible to customers + Audience *ScriptCmdletAudience + // READ-ONLY; Description of the scripts functionality Description *string // READ-ONLY; Parameters the script will accept Parameters []*ScriptParameter + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ScriptCmdletProvisioningState + // READ-ONLY; Recommended time limit for execution Timeout *string } -// ScriptCmdletsList - Pageable list of scripts/cmdlets -type ScriptCmdletsList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; List of scripts - Value []*ScriptCmdlet -} - // ScriptExecution - An instance of a script executed by a user - custom or AVS type ScriptExecution struct { - // The properties of a script execution resource + // The resource-specific properties for this resource. Properties *ScriptExecutionProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// ScriptExecutionListResult - The response of a ScriptExecution list operation. +type ScriptExecutionListResult struct { + // REQUIRED; The ScriptExecution items on this page + Value []*ScriptExecution + + // READ-ONLY; The link to the next page of items + NextLink *string +} + // ScriptExecutionParameter - The arguments passed in to the execution type ScriptExecutionParameter struct { // REQUIRED; The parameter name Name *string - // REQUIRED; The type of execution parameter + // REQUIRED; script execution parameter type Type *ScriptExecutionParameterType } @@ -1026,30 +1088,33 @@ type ScriptExecutionProperties struct { Warnings []*string } -// ScriptExecutionsList - Pageable list of script executions -type ScriptExecutionsList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; List of scripts - Value []*ScriptExecution -} - // ScriptPackage - Script Package resources available for execution type ScriptPackage struct { - // ScriptPackage resource properties + // The resource-specific properties for this resource. Properties *ScriptPackageProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// ScriptPackageListResult - The response of a ScriptPackage list operation. +type ScriptPackageListResult struct { + // REQUIRED; The ScriptPackage items on this page + Value []*ScriptPackage + + // READ-ONLY; The link to the next page of items + NextLink *string +} + // ScriptPackageProperties - Properties of a Script Package subresource type ScriptPackageProperties struct { // READ-ONLY; Company that created and supports the package @@ -1058,6 +1123,9 @@ type ScriptPackageProperties struct { // READ-ONLY; User friendly description of the package Description *string + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *ScriptPackageProvisioningState + // READ-ONLY; Link to support by the package vendor URI *string @@ -1065,15 +1133,6 @@ type ScriptPackageProperties struct { Version *string } -// ScriptPackagesList - A list of the available script packages -type ScriptPackagesList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; List of script package resources - Value []*ScriptPackage -} - // ScriptParameter - An parameter that the script will accept type ScriptParameter struct { // The parameter name that the script will expect a parameter value for @@ -1097,7 +1156,7 @@ type ScriptSecureStringExecutionParameter struct { // REQUIRED; The parameter name Name *string - // REQUIRED; The type of execution parameter + // REQUIRED; script execution parameter type Type *ScriptExecutionParameterType // A secure value for the passed parameter, not to be stored in logs @@ -1117,7 +1176,7 @@ type ScriptStringExecutionParameter struct { // REQUIRED; The parameter name Name *string - // REQUIRED; The type of execution parameter + // REQUIRED; script execution parameter type Type *ScriptExecutionParameterType // The value for the passed parameter @@ -1132,13 +1191,38 @@ func (s *ScriptStringExecutionParameter) GetScriptExecutionParameter() *ScriptEx } } -// ServiceSpecification - Service specification payload -type ServiceSpecification struct { - // Specifications of the Log for Azure Monitoring - LogSpecifications []*LogSpecification +// SystemAssignedServiceIdentity - Managed service identity (either system assigned, or none) +type SystemAssignedServiceIdentity struct { + // REQUIRED; Type of managed service identity (either system assigned, or none). + Type *SystemAssignedServiceIdentityType - // Specifications of the Metrics for Azure Monitoring - MetricSpecifications []*MetricSpecification + // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned + // identity. + PrincipalID *string + + // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string +} + +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time + + // The identity that created the resource. + CreatedBy *string + + // The type of identity that created the resource. + CreatedByType *CreatedByType + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time + + // The identity that last modified the resource. + LastModifiedBy *string + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType } // Trial - Subscription trial availability @@ -1158,7 +1242,7 @@ type VMHostPlacementPolicyProperties struct { // REQUIRED; Host members list HostMembers []*string - // REQUIRED; placement policy type + // REQUIRED; Placement Policy type Type *PlacementPolicyType // REQUIRED; Virtual machine members list @@ -1195,7 +1279,7 @@ type VMPlacementPolicyProperties struct { // REQUIRED; placement policy affinity type AffinityType *AffinityType - // REQUIRED; placement policy type + // REQUIRED; Placement Policy type Type *PlacementPolicyType // REQUIRED; Virtual machine members list @@ -1223,19 +1307,31 @@ func (v *VMPlacementPolicyProperties) GetPlacementPolicyProperties() *PlacementP // VirtualMachine - Virtual Machine type VirtualMachine struct { - // Virtual machine properties. + // The resource-specific properties for this resource. Properties *VirtualMachineProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// VirtualMachineListResult - The response of a VirtualMachine list operation. +type VirtualMachineListResult struct { + // REQUIRED; The VirtualMachine items on this page + Value []*VirtualMachine + + // READ-ONLY; The link to the next page of items + NextLink *string +} + // VirtualMachineProperties - Virtual Machine Properties type VirtualMachineProperties struct { // READ-ONLY; Display name of the VM. @@ -1247,6 +1343,9 @@ type VirtualMachineProperties struct { // READ-ONLY; Virtual machine managed object reference id MoRefID *string + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *VirtualMachineProvisioningState + // READ-ONLY; Whether VM DRS-driven movement is restricted (enabled) or not (disabled) RestrictMovement *VirtualMachineRestrictMovementState } @@ -1257,42 +1356,51 @@ type VirtualMachineRestrictMovement struct { RestrictMovement *VirtualMachineRestrictMovementState } -// VirtualMachinesList - A list of Virtual Machines -type VirtualMachinesList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items to be displayed on the page - Value []*VirtualMachine -} - // WorkloadNetwork - Workload Network type WorkloadNetwork struct { - // READ-ONLY; Resource ID. + // The resource-specific properties for this resource. + Properties *WorkloadNetworkProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } // WorkloadNetworkDNSService - NSX DNS Service type WorkloadNetworkDNSService struct { - // DNS Service properties + // The resource-specific properties for this resource. Properties *WorkloadNetworkDNSServiceProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// WorkloadNetworkDNSServiceListResult - The response of a WorkloadNetworkDnsService list operation. +type WorkloadNetworkDNSServiceListResult struct { + // REQUIRED; The WorkloadNetworkDnsService items on this page + Value []*WorkloadNetworkDNSService + + // READ-ONLY; The link to the next page of items + NextLink *string +} + // WorkloadNetworkDNSServiceProperties - NSX DNS Service Properties type WorkloadNetworkDNSServiceProperties struct { // DNS service IP of the DNS Service. @@ -1320,37 +1428,46 @@ type WorkloadNetworkDNSServiceProperties struct { Status *DNSServiceStatusEnum } -// WorkloadNetworkDNSServicesList - A list of NSX DNS Services -type WorkloadNetworkDNSServicesList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on the page - Value []*WorkloadNetworkDNSService +// WorkloadNetworkDNSServiceUpdate - NSX DNS Service update +type WorkloadNetworkDNSServiceUpdate struct { + // The updatable properties of a DNS Service update + Properties *WorkloadNetworkDNSServiceProperties } // WorkloadNetworkDNSZone - NSX DNS Zone type WorkloadNetworkDNSZone struct { - // DNS Zone properties + // The resource-specific properties for this resource. Properties *WorkloadNetworkDNSZoneProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// WorkloadNetworkDNSZoneListResult - The response of a WorkloadNetworkDnsZone list operation. +type WorkloadNetworkDNSZoneListResult struct { + // REQUIRED; The WorkloadNetworkDnsZone items on this page + Value []*WorkloadNetworkDNSZone + + // READ-ONLY; The link to the next page of items + NextLink *string +} + // WorkloadNetworkDNSZoneProperties - NSX DNS Zone Properties type WorkloadNetworkDNSZoneProperties struct { // DNS Server IP array of the DNS Zone. DNSServerIPs []*string // Number of DNS Services using the DNS zone. - DNSServices *int64 + DNSServices *int32 // Display name of the DNS Zone. DisplayName *string @@ -1368,27 +1485,27 @@ type WorkloadNetworkDNSZoneProperties struct { ProvisioningState *WorkloadNetworkDNSZoneProvisioningState } -// WorkloadNetworkDNSZonesList - A list of NSX DNS Zones -type WorkloadNetworkDNSZonesList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on the page - Value []*WorkloadNetworkDNSZone +// WorkloadNetworkDNSZoneUpdate - NSX DNS Zone update +type WorkloadNetworkDNSZoneUpdate struct { + // The updatable properties of a DNS Zone update + Properties *WorkloadNetworkDNSZoneProperties } // WorkloadNetworkDhcp - NSX DHCP type WorkloadNetworkDhcp struct { - // DHCP properties. + // The resource-specific properties for this resource. Properties WorkloadNetworkDhcpEntityClassification - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -1415,13 +1532,30 @@ func (w *WorkloadNetworkDhcpEntity) GetWorkloadNetworkDhcpEntity() *WorkloadNetw return w } -// WorkloadNetworkDhcpList - A list of NSX dhcp entities -type WorkloadNetworkDhcpList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string +// WorkloadNetworkDhcpEntityUpdate - Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to inherit from +type WorkloadNetworkDhcpEntityUpdate struct { + // REQUIRED; Type of DHCP: SERVER or RELAY. + DhcpType *DhcpTypeEnum + + // Display name of the DHCP entity. + DisplayName *string + + // NSX revision number. + Revision *int64 +} - // READ-ONLY; The items on the page +// GetWorkloadNetworkDhcpEntityUpdate implements the WorkloadNetworkDhcpEntityUpdateClassification interface for type WorkloadNetworkDhcpEntityUpdate. +func (w *WorkloadNetworkDhcpEntityUpdate) GetWorkloadNetworkDhcpEntityUpdate() *WorkloadNetworkDhcpEntityUpdate { + return w +} + +// WorkloadNetworkDhcpListResult - The response of a WorkloadNetworkDhcp list operation. +type WorkloadNetworkDhcpListResult struct { + // REQUIRED; The WorkloadNetworkDhcp items on this page Value []*WorkloadNetworkDhcp + + // READ-ONLY; The link to the next page of items + NextLink *string } // WorkloadNetworkDhcpRelay - NSX DHCP Relay @@ -1456,6 +1590,30 @@ func (w *WorkloadNetworkDhcpRelay) GetWorkloadNetworkDhcpEntity() *WorkloadNetwo } } +// WorkloadNetworkDhcpRelayUpdate - NSX DHCP Relay +type WorkloadNetworkDhcpRelayUpdate struct { + // REQUIRED; Type of DHCP: SERVER or RELAY. + DhcpType *DhcpTypeEnum + + // Display name of the DHCP entity. + DisplayName *string + + // NSX revision number. + Revision *int64 + + // DHCP Relay Addresses. Max 3. + ServerAddresses []*string +} + +// GetWorkloadNetworkDhcpEntityUpdate implements the WorkloadNetworkDhcpEntityUpdateClassification interface for type WorkloadNetworkDhcpRelayUpdate. +func (w *WorkloadNetworkDhcpRelayUpdate) GetWorkloadNetworkDhcpEntityUpdate() *WorkloadNetworkDhcpEntityUpdate { + return &WorkloadNetworkDhcpEntityUpdate{ + DhcpType: w.DhcpType, + DisplayName: w.DisplayName, + Revision: w.Revision, + } +} + // WorkloadNetworkDhcpServer - NSX DHCP Server type WorkloadNetworkDhcpServer struct { // REQUIRED; Type of DHCP: SERVER or RELAY. @@ -1465,7 +1623,7 @@ type WorkloadNetworkDhcpServer struct { DisplayName *string // DHCP Server Lease Time. - LeaseTime *int64 + LeaseTime *int32 // NSX revision number. Revision *int64 @@ -1491,28 +1649,64 @@ func (w *WorkloadNetworkDhcpServer) GetWorkloadNetworkDhcpEntity() *WorkloadNetw } } +// WorkloadNetworkDhcpServerUpdate - NSX DHCP Server +type WorkloadNetworkDhcpServerUpdate struct { + // REQUIRED; Type of DHCP: SERVER or RELAY. + DhcpType *DhcpTypeEnum + + // Display name of the DHCP entity. + DisplayName *string + + // DHCP Server Lease Time. + LeaseTime *int32 + + // NSX revision number. + Revision *int64 + + // DHCP Server Address. + ServerAddress *string +} + +// GetWorkloadNetworkDhcpEntityUpdate implements the WorkloadNetworkDhcpEntityUpdateClassification interface for type WorkloadNetworkDhcpServerUpdate. +func (w *WorkloadNetworkDhcpServerUpdate) GetWorkloadNetworkDhcpEntityUpdate() *WorkloadNetworkDhcpEntityUpdate { + return &WorkloadNetworkDhcpEntityUpdate{ + DhcpType: w.DhcpType, + DisplayName: w.DisplayName, + Revision: w.Revision, + } +} + +// WorkloadNetworkDhcpUpdate - NSX DHCP update +type WorkloadNetworkDhcpUpdate struct { + // The updatable properties of a DHCP update + Properties WorkloadNetworkDhcpEntityUpdateClassification +} + // WorkloadNetworkGateway - NSX Gateway. type WorkloadNetworkGateway struct { - // Gateway properties. + // The resource-specific properties for this resource. Properties *WorkloadNetworkGatewayProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// WorkloadNetworkGatewayList - A list of NSX Gateways -type WorkloadNetworkGatewayList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on the page +// WorkloadNetworkGatewayListResult - The response of a WorkloadNetworkGateway list operation. +type WorkloadNetworkGatewayListResult struct { + // REQUIRED; The WorkloadNetworkGateway items on this page Value []*WorkloadNetworkGateway + + // READ-ONLY; The link to the next page of items + NextLink *string } // WorkloadNetworkGatewayProperties - Properties of a NSX Gateway. @@ -1522,39 +1716,45 @@ type WorkloadNetworkGatewayProperties struct { // READ-ONLY; NSX Gateway Path. Path *string -} -// WorkloadNetworkList - A list of workload networks -type WorkloadNetworkList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *WorkloadNetworkProvisioningState +} - // READ-ONLY; The items on the page +// WorkloadNetworkListResult - The response of a WorkloadNetwork list operation. +type WorkloadNetworkListResult struct { + // REQUIRED; The WorkloadNetwork items on this page Value []*WorkloadNetwork + + // READ-ONLY; The link to the next page of items + NextLink *string } // WorkloadNetworkPortMirroring - NSX Port Mirroring type WorkloadNetworkPortMirroring struct { - // Port Mirroring Properties. + // The resource-specific properties for this resource. Properties *WorkloadNetworkPortMirroringProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// WorkloadNetworkPortMirroringList - A list of NSX Port Mirroring -type WorkloadNetworkPortMirroringList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on the page +// WorkloadNetworkPortMirroringListResult - The response of a WorkloadNetworkPortMirroring list operation. +type WorkloadNetworkPortMirroringListResult struct { + // REQUIRED; The WorkloadNetworkPortMirroring items on this page Value []*WorkloadNetworkPortMirroring + + // READ-ONLY; The link to the next page of items + NextLink *string } // WorkloadNetworkPortMirroringProperties - NSX Port Mirroring Properties @@ -1581,21 +1781,45 @@ type WorkloadNetworkPortMirroringProperties struct { Status *PortMirroringStatusEnum } +// WorkloadNetworkPortMirroringUpdate - NSX Port Mirroring update +type WorkloadNetworkPortMirroringUpdate struct { + // The updatable properties of a Port Mirroring update + Properties *WorkloadNetworkPortMirroringProperties +} + +// WorkloadNetworkProperties - The properties of a workload network +type WorkloadNetworkProperties struct { + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *WorkloadNetworkProvisioningState +} + // WorkloadNetworkPublicIP - NSX Public IP Block type WorkloadNetworkPublicIP struct { - // Public IP Block properties + // The resource-specific properties for this resource. Properties *WorkloadNetworkPublicIPProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// WorkloadNetworkPublicIPListResult - The response of a WorkloadNetworkPublicIP list operation. +type WorkloadNetworkPublicIPListResult struct { + // REQUIRED; The WorkloadNetworkPublicIP items on this page + Value []*WorkloadNetworkPublicIP + + // READ-ONLY; The link to the next page of items + NextLink *string +} + // WorkloadNetworkPublicIPProperties - NSX Public IP Block Properties type WorkloadNetworkPublicIPProperties struct { // Display name of the Public IP Block. @@ -1611,30 +1835,33 @@ type WorkloadNetworkPublicIPProperties struct { PublicIPBlock *string } -// WorkloadNetworkPublicIPsList - A list of NSX Public IP Blocks -type WorkloadNetworkPublicIPsList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on the page - Value []*WorkloadNetworkPublicIP -} - // WorkloadNetworkSegment - NSX Segment type WorkloadNetworkSegment struct { - // The properties of a Workload Segment proxy resource. + // The resource-specific properties for this resource. Properties *WorkloadNetworkSegmentProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// WorkloadNetworkSegmentListResult - The response of a WorkloadNetworkSegment list operation. +type WorkloadNetworkSegmentListResult struct { + // REQUIRED; The WorkloadNetworkSegment items on this page + Value []*WorkloadNetworkSegment + + // READ-ONLY; The link to the next page of items + NextLink *string +} + // WorkloadNetworkSegmentPortVif - Ports and any VIF attached to segment. type WorkloadNetworkSegmentPortVif struct { // Name of port or VIF attached to segment. @@ -1674,30 +1901,39 @@ type WorkloadNetworkSegmentSubnet struct { GatewayAddress *string } -// WorkloadNetworkSegmentsList - A list of NSX Segments -type WorkloadNetworkSegmentsList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on the page - Value []*WorkloadNetworkSegment +// WorkloadNetworkSegmentUpdate - NSX Segment update +type WorkloadNetworkSegmentUpdate struct { + // The updatable properties of a Segment update + Properties *WorkloadNetworkSegmentProperties } // WorkloadNetworkVMGroup - NSX VM Group type WorkloadNetworkVMGroup struct { - // VM Group properties. + // The resource-specific properties for this resource. Properties *WorkloadNetworkVMGroupProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// WorkloadNetworkVMGroupListResult - The response of a WorkloadNetworkVMGroup list operation. +type WorkloadNetworkVMGroupListResult struct { + // REQUIRED; The WorkloadNetworkVMGroup items on this page + Value []*WorkloadNetworkVMGroup + + // READ-ONLY; The link to the next page of items + NextLink *string +} + // WorkloadNetworkVMGroupProperties - NSX VM Group Properties type WorkloadNetworkVMGroupProperties struct { // Display name of the VM group. @@ -1716,44 +1952,47 @@ type WorkloadNetworkVMGroupProperties struct { Status *VMGroupStatusEnum } -// WorkloadNetworkVMGroupsList - A list of NSX VM Groups -type WorkloadNetworkVMGroupsList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on the page - Value []*WorkloadNetworkVMGroup +// WorkloadNetworkVMGroupUpdate - NSX VM Group update +type WorkloadNetworkVMGroupUpdate struct { + // The updatable properties of a VM Group update + Properties *WorkloadNetworkVMGroupProperties } // WorkloadNetworkVirtualMachine - NSX Virtual Machine type WorkloadNetworkVirtualMachine struct { - // Virtual machine properties. + // The resource-specific properties for this resource. Properties *WorkloadNetworkVirtualMachineProperties - // READ-ONLY; Resource ID. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Resource name. + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Resource type. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// WorkloadNetworkVirtualMachineListResult - The response of a WorkloadNetworkVirtualMachine list operation. +type WorkloadNetworkVirtualMachineListResult struct { + // REQUIRED; The WorkloadNetworkVirtualMachine items on this page + Value []*WorkloadNetworkVirtualMachine + + // READ-ONLY; The link to the next page of items + NextLink *string +} + // WorkloadNetworkVirtualMachineProperties - NSX Virtual Machine Properties type WorkloadNetworkVirtualMachineProperties struct { // Display name of the VM. DisplayName *string + // READ-ONLY; The provisioning state of the resource. + ProvisioningState *WorkloadNetworkProvisioningState + // READ-ONLY; Virtual machine type. VMType *VMTypeEnum } - -// WorkloadNetworkVirtualMachinesList - A list of NSX Virtual Machines -type WorkloadNetworkVirtualMachinesList struct { - // READ-ONLY; URL to get the next page if any - NextLink *string - - // READ-ONLY; The items on the page - Value []*WorkloadNetworkVirtualMachine -} diff --git a/sdk/resourcemanager/avs/armavs/models_serde.go b/sdk/resourcemanager/avs/armavs/models_serde.go index 78ea084190ce..62c017519265 100644 --- a/sdk/resourcemanager/avs/armavs/models_serde.go +++ b/sdk/resourcemanager/avs/armavs/models_serde.go @@ -21,6 +21,7 @@ func (a Addon) MarshalJSON() ([]byte, error) { populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } @@ -43,6 +44,9 @@ func (a *Addon) UnmarshalJSON(data []byte) error { case "properties": a.Properties, err = unmarshalAddonPropertiesClassification(val) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) @@ -124,16 +128,16 @@ func (a *AddonHcxProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AddonList. -func (a AddonList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AddonListResult. +func (a AddonListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AddonList. -func (a *AddonList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AddonListResult. +func (a *AddonListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -375,6 +379,7 @@ func (c CloudLink) MarshalJSON() ([]byte, error) { populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } @@ -397,6 +402,9 @@ func (c *CloudLink) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) @@ -408,16 +416,16 @@ func (c *CloudLink) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudLinkList. -func (c CloudLinkList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CloudLinkListResult. +func (c CloudLinkListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudLinkList. -func (c *CloudLinkList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudLinkListResult. +func (c *CloudLinkListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -443,6 +451,7 @@ func (c *CloudLinkList) UnmarshalJSON(data []byte) error { func (c CloudLinkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "linkedCloud", c.LinkedCloud) + populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "status", c.Status) return json.Marshal(objectMap) } @@ -459,6 +468,9 @@ func (c *CloudLinkProperties) UnmarshalJSON(data []byte) error { case "linkedCloud": err = unpopulate(val, "LinkedCloud", &c.LinkedCloud) delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &c.Status) delete(rawMsg, key) @@ -477,6 +489,7 @@ func (c Cluster) MarshalJSON() ([]byte, error) { populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) populate(objectMap, "sku", c.SKU) + populate(objectMap, "systemData", c.SystemData) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } @@ -502,6 +515,9 @@ func (c *Cluster) UnmarshalJSON(data []byte) error { case "sku": err = unpopulate(val, "SKU", &c.SKU) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) @@ -513,16 +529,16 @@ func (c *Cluster) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterList. -func (c ClusterList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterListResult. +func (c ClusterListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterList. -func (c *ClusterList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterListResult. +func (c *ClusterListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -551,6 +567,7 @@ func (c ClusterProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "clusterSize", c.ClusterSize) populate(objectMap, "hosts", c.Hosts) populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "vsanDatastoreName", c.VsanDatastoreName) return json.Marshal(objectMap) } @@ -575,6 +592,9 @@ func (c *ClusterProperties) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) + case "vsanDatastoreName": + err = unpopulate(val, "VsanDatastoreName", &c.VsanDatastoreName) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -587,6 +607,7 @@ func (c *ClusterProperties) UnmarshalJSON(data []byte) error { func (c ClusterUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", c.Properties) + populate(objectMap, "sku", c.SKU) return json.Marshal(objectMap) } @@ -602,6 +623,9 @@ func (c *ClusterUpdate) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &c.SKU) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -705,6 +729,7 @@ func (d Datastore) MarshalJSON() ([]byte, error) { populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } @@ -727,6 +752,9 @@ func (d *Datastore) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) @@ -738,16 +766,16 @@ func (d *Datastore) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatastoreList. -func (d DatastoreList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatastoreListResult. +func (d DatastoreListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatastoreList. -func (d *DatastoreList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatastoreListResult. +func (d *DatastoreListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -773,6 +801,7 @@ func (d *DatastoreList) UnmarshalJSON(data []byte) error { func (d DatastoreProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "diskPoolVolume", d.DiskPoolVolume) + populate(objectMap, "elasticSanVolume", d.ElasticSanVolume) populate(objectMap, "netAppVolume", d.NetAppVolume) populate(objectMap, "provisioningState", d.ProvisioningState) populate(objectMap, "status", d.Status) @@ -791,6 +820,9 @@ func (d *DatastoreProperties) UnmarshalJSON(data []byte) error { case "diskPoolVolume": err = unpopulate(val, "DiskPoolVolume", &d.DiskPoolVolume) delete(rawMsg, key) + case "elasticSanVolume": + err = unpopulate(val, "ElasticSanVolume", &d.ElasticSanVolume) + delete(rawMsg, key) case "netAppVolume": err = unpopulate(val, "NetAppVolume", &d.NetAppVolume) delete(rawMsg, key) @@ -847,6 +879,33 @@ func (d *DiskPoolVolume) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ElasticSanVolume. +func (e ElasticSanVolume) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetId", e.TargetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticSanVolume. +func (e *ElasticSanVolume) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "targetId": + err = unpopulate(val, "TargetID", &e.TargetID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Encryption. func (e Encryption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -929,7 +988,10 @@ func (e *EncryptionKeyVaultProperties) UnmarshalJSON(data []byte) error { func (e Endpoints) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "hcxCloudManager", e.HcxCloudManager) + populate(objectMap, "hcxCloudManagerIp", e.HcxCloudManagerIP) populate(objectMap, "nsxtManager", e.NsxtManager) + populate(objectMap, "nsxtManagerIp", e.NsxtManagerIP) + populate(objectMap, "vcenterIp", e.VcenterIP) populate(objectMap, "vcsa", e.Vcsa) return json.Marshal(objectMap) } @@ -946,9 +1008,18 @@ func (e *Endpoints) UnmarshalJSON(data []byte) error { case "hcxCloudManager": err = unpopulate(val, "HcxCloudManager", &e.HcxCloudManager) delete(rawMsg, key) + case "hcxCloudManagerIp": + err = unpopulate(val, "HcxCloudManagerIP", &e.HcxCloudManagerIP) + delete(rawMsg, key) case "nsxtManager": err = unpopulate(val, "NsxtManager", &e.NsxtManager) delete(rawMsg, key) + case "nsxtManagerIp": + err = unpopulate(val, "NsxtManagerIP", &e.NsxtManagerIP) + delete(rawMsg, key) + case "vcenterIp": + err = unpopulate(val, "VcenterIP", &e.VcenterIP) + delete(rawMsg, key) case "vcsa": err = unpopulate(val, "Vcsa", &e.Vcsa) delete(rawMsg, key) @@ -966,6 +1037,7 @@ func (e ExpressRouteAuthorization) MarshalJSON() ([]byte, error) { populate(objectMap, "id", e.ID) populate(objectMap, "name", e.Name) populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } @@ -988,6 +1060,9 @@ func (e *ExpressRouteAuthorization) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) @@ -999,16 +1074,16 @@ func (e *ExpressRouteAuthorization) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExpressRouteAuthorizationList. -func (e ExpressRouteAuthorizationList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExpressRouteAuthorizationListResult. +func (e ExpressRouteAuthorizationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", e.NextLink) populate(objectMap, "value", e.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteAuthorizationList. -func (e *ExpressRouteAuthorizationList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressRouteAuthorizationListResult. +func (e *ExpressRouteAuthorizationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -1075,6 +1150,7 @@ func (g GlobalReachConnection) MarshalJSON() ([]byte, error) { populate(objectMap, "id", g.ID) populate(objectMap, "name", g.Name) populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } @@ -1097,6 +1173,9 @@ func (g *GlobalReachConnection) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &g.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) @@ -1108,16 +1187,16 @@ func (g *GlobalReachConnection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GlobalReachConnectionList. -func (g GlobalReachConnectionList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GlobalReachConnectionListResult. +func (g GlobalReachConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", g.NextLink) populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalReachConnectionList. -func (g *GlobalReachConnectionList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalReachConnectionListResult. +func (g *GlobalReachConnectionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -1192,6 +1271,7 @@ func (h HcxEnterpriseSite) MarshalJSON() ([]byte, error) { populate(objectMap, "id", h.ID) populate(objectMap, "name", h.Name) populate(objectMap, "properties", h.Properties) + populate(objectMap, "systemData", h.SystemData) populate(objectMap, "type", h.Type) return json.Marshal(objectMap) } @@ -1214,6 +1294,9 @@ func (h *HcxEnterpriseSite) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &h.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &h.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &h.Type) delete(rawMsg, key) @@ -1225,16 +1308,16 @@ func (h *HcxEnterpriseSite) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type HcxEnterpriseSiteList. -func (h HcxEnterpriseSiteList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HcxEnterpriseSiteListResult. +func (h HcxEnterpriseSiteListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", h.NextLink) populate(objectMap, "value", h.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HcxEnterpriseSiteList. -func (h *HcxEnterpriseSiteList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HcxEnterpriseSiteListResult. +func (h *HcxEnterpriseSiteListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) @@ -1260,6 +1343,7 @@ func (h *HcxEnterpriseSiteList) UnmarshalJSON(data []byte) error { func (h HcxEnterpriseSiteProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "activationKey", h.ActivationKey) + populate(objectMap, "provisioningState", h.ProvisioningState) populate(objectMap, "status", h.Status) return json.Marshal(objectMap) } @@ -1276,6 +1360,9 @@ func (h *HcxEnterpriseSiteProperties) UnmarshalJSON(data []byte) error { case "activationKey": err = unpopulate(val, "ActivationKey", &h.ActivationKey) delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &h.Status) delete(rawMsg, key) @@ -1350,140 +1437,124 @@ func (i *IdentitySource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type LogSpecification. -func (l LogSpecification) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IscsiPath. +func (i IscsiPath) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "blobDuration", l.BlobDuration) - populate(objectMap, "displayName", l.DisplayName) - populate(objectMap, "name", l.Name) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LogSpecification. -func (l *LogSpecification) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IscsiPath. +func (i *IscsiPath) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "blobDuration": - err = unpopulate(val, "BlobDuration", &l.BlobDuration) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &l.DisplayName) + case "id": + err = unpopulate(val, "ID", &i.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &l.Name) + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagementCluster. -func (m ManagementCluster) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IscsiPathListResult. +func (i IscsiPathListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clusterId", m.ClusterID) - populate(objectMap, "clusterSize", m.ClusterSize) - populate(objectMap, "hosts", m.Hosts) - populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementCluster. -func (m *ManagementCluster) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IscsiPathListResult. +func (i *IscsiPathListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "clusterId": - err = unpopulate(val, "ClusterID", &m.ClusterID) - delete(rawMsg, key) - case "clusterSize": - err = unpopulate(val, "ClusterSize", &m.ClusterSize) - delete(rawMsg, key) - case "hosts": - err = unpopulate(val, "Hosts", &m.Hosts) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + case "value": + err = unpopulate(val, "Value", &i.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricDimension. -func (m MetricDimension) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IscsiPathProperties. +func (i IscsiPathProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "internalName", m.InternalName) - populate(objectMap, "name", m.Name) - populate(objectMap, "toBeExportedForShoebox", m.ToBeExportedForShoebox) + populate(objectMap, "networkBlock", i.NetworkBlock) + populate(objectMap, "provisioningState", i.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricDimension. -func (m *MetricDimension) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IscsiPathProperties. +func (i *IscsiPathProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &m.DisplayName) - delete(rawMsg, key) - case "internalName": - err = unpopulate(val, "InternalName", &m.InternalName) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "networkBlock": + err = unpopulate(val, "NetworkBlock", &i.NetworkBlock) delete(rawMsg, key) - case "toBeExportedForShoebox": - err = unpopulate(val, "ToBeExportedForShoebox", &m.ToBeExportedForShoebox) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricSpecification. -func (m MetricSpecification) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagementCluster. +func (m ManagementCluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "aggregationType", m.AggregationType) - populate(objectMap, "category", m.Category) - populate(objectMap, "dimensions", m.Dimensions) - populate(objectMap, "displayDescription", m.DisplayDescription) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "enableRegionalMdmAccount", m.EnableRegionalMdmAccount) - populate(objectMap, "fillGapWithZero", m.FillGapWithZero) - populate(objectMap, "name", m.Name) - populate(objectMap, "sourceMdmAccount", m.SourceMdmAccount) - populate(objectMap, "sourceMdmNamespace", m.SourceMdmNamespace) - populate(objectMap, "supportedAggregationTypes", m.SupportedAggregationTypes) - populate(objectMap, "supportedTimeGrainTypes", m.SupportedTimeGrainTypes) - populate(objectMap, "unit", m.Unit) + populate(objectMap, "clusterId", m.ClusterID) + populate(objectMap, "clusterSize", m.ClusterSize) + populate(objectMap, "hosts", m.Hosts) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "vsanDatastoreName", m.VsanDatastoreName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification. -func (m *MetricSpecification) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementCluster. +func (m *ManagementCluster) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -1491,44 +1562,20 @@ func (m *MetricSpecification) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "aggregationType": - err = unpopulate(val, "AggregationType", &m.AggregationType) - delete(rawMsg, key) - case "category": - err = unpopulate(val, "Category", &m.Category) - delete(rawMsg, key) - case "dimensions": - err = unpopulate(val, "Dimensions", &m.Dimensions) - delete(rawMsg, key) - case "displayDescription": - err = unpopulate(val, "DisplayDescription", &m.DisplayDescription) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &m.DisplayName) - delete(rawMsg, key) - case "enableRegionalMdmAccount": - err = unpopulate(val, "EnableRegionalMdmAccount", &m.EnableRegionalMdmAccount) - delete(rawMsg, key) - case "fillGapWithZero": - err = unpopulate(val, "FillGapWithZero", &m.FillGapWithZero) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "sourceMdmAccount": - err = unpopulate(val, "SourceMdmAccount", &m.SourceMdmAccount) + case "clusterId": + err = unpopulate(val, "ClusterID", &m.ClusterID) delete(rawMsg, key) - case "sourceMdmNamespace": - err = unpopulate(val, "SourceMdmNamespace", &m.SourceMdmNamespace) + case "clusterSize": + err = unpopulate(val, "ClusterSize", &m.ClusterSize) delete(rawMsg, key) - case "supportedAggregationTypes": - err = unpopulate(val, "SupportedAggregationTypes", &m.SupportedAggregationTypes) + case "hosts": + err = unpopulate(val, "Hosts", &m.Hosts) delete(rawMsg, key) - case "supportedTimeGrainTypes": - err = unpopulate(val, "SupportedTimeGrainTypes", &m.SupportedTimeGrainTypes) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) + case "vsanDatastoreName": + err = unpopulate(val, "VsanDatastoreName", &m.VsanDatastoreName) delete(rawMsg, key) } if err != nil { @@ -1568,11 +1615,11 @@ func (n *NetAppVolume) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "actionType", o.ActionType) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) populate(objectMap, "name", o.Name) populate(objectMap, "origin", o.Origin) - populate(objectMap, "properties", o.Properties) return json.Marshal(objectMap) } @@ -1585,6 +1632,9 @@ func (o *Operation) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, key) case "display": err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) @@ -1597,9 +1647,6 @@ func (o *Operation) UnmarshalJSON(data []byte) error { case "origin": err = unpopulate(val, "Origin", &o.Origin) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -1647,16 +1694,16 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationList. -func (o OperationList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationList. -func (o *OperationList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -1678,33 +1725,6 @@ func (o *OperationList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationProperties. -func (o OperationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "serviceSpecification", o.ServiceSpecification) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties. -func (o *OperationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "serviceSpecification": - err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type PSCredentialExecutionParameter. func (p PSCredentialExecutionParameter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1744,16 +1764,19 @@ func (p *PSCredentialExecutionParameter) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PlacementPoliciesList. -func (p PlacementPoliciesList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PlacementPolicy. +func (p PlacementPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PlacementPoliciesList. -func (p *PlacementPoliciesList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PlacementPolicy. +func (p *PlacementPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -1761,11 +1784,20 @@ func (p *PlacementPoliciesList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + p.Properties, err = unmarshalPlacementPolicyPropertiesClassification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { @@ -1775,18 +1807,16 @@ func (p *PlacementPoliciesList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PlacementPolicy. -func (p PlacementPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PlacementPolicyListResult. +func (p PlacementPolicyListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PlacementPolicy. -func (p *PlacementPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PlacementPolicyListResult. +func (p *PlacementPolicyListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -1794,17 +1824,11 @@ func (p *PlacementPolicy) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - p.Properties, err = unmarshalPlacementPolicyPropertiesClassification(val) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { @@ -1932,6 +1956,7 @@ func (p PrivateCloud) MarshalJSON() ([]byte, error) { populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) populate(objectMap, "sku", p.SKU) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "tags", p.Tags) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) @@ -1964,6 +1989,9 @@ func (p *PrivateCloud) UnmarshalJSON(data []byte) error { case "sku": err = unpopulate(val, "SKU", &p.SKU) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) @@ -1978,51 +2006,16 @@ func (p *PrivateCloud) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateCloudIdentity. -func (p PrivateCloudIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "principalId", p.PrincipalID) - populate(objectMap, "tenantId", p.TenantID) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateCloudIdentity. -func (p *PrivateCloudIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &p.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &p.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateCloudList. -func (p PrivateCloudList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateCloudListResult. +func (p PrivateCloudListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateCloudList. -func (p *PrivateCloudList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateCloudListResult. +func (p *PrivateCloudListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -2049,6 +2042,7 @@ func (p PrivateCloudProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "availability", p.Availability) populate(objectMap, "circuit", p.Circuit) + populate(objectMap, "dnsZoneType", p.DNSZoneType) populate(objectMap, "encryption", p.Encryption) populate(objectMap, "endpoints", p.Endpoints) populate(objectMap, "extendedNetworkBlocks", p.ExtendedNetworkBlocks) @@ -2066,6 +2060,7 @@ func (p PrivateCloudProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "secondaryCircuit", p.SecondaryCircuit) populate(objectMap, "vcenterCertificateThumbprint", p.VcenterCertificateThumbprint) populate(objectMap, "vcenterPassword", p.VcenterPassword) + populate(objectMap, "virtualNetworkId", p.VirtualNetworkID) populate(objectMap, "vmotionNetwork", p.VmotionNetwork) return json.Marshal(objectMap) } @@ -2085,6 +2080,9 @@ func (p *PrivateCloudProperties) UnmarshalJSON(data []byte) error { case "circuit": err = unpopulate(val, "Circuit", &p.Circuit) delete(rawMsg, key) + case "dnsZoneType": + err = unpopulate(val, "DNSZoneType", &p.DNSZoneType) + delete(rawMsg, key) case "encryption": err = unpopulate(val, "Encryption", &p.Encryption) delete(rawMsg, key) @@ -2136,6 +2134,9 @@ func (p *PrivateCloudProperties) UnmarshalJSON(data []byte) error { case "vcenterPassword": err = unpopulate(val, "VcenterPassword", &p.VcenterPassword) delete(rawMsg, key) + case "virtualNetworkId": + err = unpopulate(val, "VirtualNetworkID", &p.VirtualNetworkID) + delete(rawMsg, key) case "vmotionNetwork": err = unpopulate(val, "VmotionNetwork", &p.VmotionNetwork) delete(rawMsg, key) @@ -2152,6 +2153,7 @@ func (p PrivateCloudUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", p.Identity) populate(objectMap, "properties", p.Properties) + populate(objectMap, "sku", p.SKU) populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } @@ -2171,6 +2173,9 @@ func (p *PrivateCloudUpdate) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) @@ -2186,6 +2191,7 @@ func (p *PrivateCloudUpdate) UnmarshalJSON(data []byte) error { func (p PrivateCloudUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "availability", p.Availability) + populate(objectMap, "dnsZoneType", p.DNSZoneType) populate(objectMap, "encryption", p.Encryption) populate(objectMap, "extendedNetworkBlocks", p.ExtendedNetworkBlocks) populate(objectMap, "identitySources", p.IdentitySources) @@ -2206,6 +2212,9 @@ func (p *PrivateCloudUpdateProperties) UnmarshalJSON(data []byte) error { case "availability": err = unpopulate(val, "Availability", &p.Availability) delete(rawMsg, key) + case "dnsZoneType": + err = unpopulate(val, "DNSZoneType", &p.DNSZoneType) + delete(rawMsg, key) case "encryption": err = unpopulate(val, "Encryption", &p.Encryption) delete(rawMsg, key) @@ -2263,7 +2272,11 @@ func (q *Quota) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SKU. func (s SKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "family", s.Family) populate(objectMap, "name", s.Name) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) return json.Marshal(objectMap) } @@ -2276,9 +2289,21 @@ func (s *SKU) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &s.Family) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -2293,6 +2318,7 @@ func (s ScriptCmdlet) MarshalJSON() ([]byte, error) { populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -2315,6 +2341,9 @@ func (s *ScriptCmdlet) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) @@ -2326,17 +2355,16 @@ func (s *ScriptCmdlet) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScriptCmdletProperties. -func (s ScriptCmdletProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScriptCmdletListResult. +func (s ScriptCmdletListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", s.Description) - populate(objectMap, "parameters", s.Parameters) - populate(objectMap, "timeout", s.Timeout) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptCmdletProperties. -func (s *ScriptCmdletProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptCmdletListResult. +func (s *ScriptCmdletListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -2344,14 +2372,11 @@ func (s *ScriptCmdletProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &s.Parameters) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &s.Timeout) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -2361,28 +2386,40 @@ func (s *ScriptCmdletProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScriptCmdletsList. -func (s ScriptCmdletsList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScriptCmdletProperties. +func (s ScriptCmdletProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "audience", s.Audience) + populate(objectMap, "description", s.Description) + populate(objectMap, "parameters", s.Parameters) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "timeout", s.Timeout) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptCmdletsList. -func (s *ScriptCmdletsList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage +// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptCmdletProperties. +func (s *ScriptCmdletProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "audience": + err = unpopulate(val, "Audience", &s.Audience) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &s.Parameters) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &s.Timeout) delete(rawMsg, key) } if err != nil { @@ -2398,6 +2435,7 @@ func (s ScriptExecution) MarshalJSON() ([]byte, error) { populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -2420,6 +2458,9 @@ func (s *ScriptExecution) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) @@ -2431,6 +2472,37 @@ func (s *ScriptExecution) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ScriptExecutionListResult. +func (s ScriptExecutionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptExecutionListResult. +func (s *ScriptExecutionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ScriptExecutionParameter. func (s ScriptExecutionParameter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2545,43 +2617,13 @@ func (s *ScriptExecutionProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScriptExecutionsList. -func (s ScriptExecutionsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptExecutionsList. -func (s *ScriptExecutionsList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ScriptPackage. func (s ScriptPackage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -2604,6 +2646,9 @@ func (s *ScriptPackage) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) @@ -2615,18 +2660,16 @@ func (s *ScriptPackage) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScriptPackageProperties. -func (s ScriptPackageProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScriptPackageListResult. +func (s ScriptPackageListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "company", s.Company) - populate(objectMap, "description", s.Description) - populate(objectMap, "uri", s.URI) - populate(objectMap, "version", s.Version) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptPackageProperties. -func (s *ScriptPackageProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptPackageListResult. +func (s *ScriptPackageListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -2634,17 +2677,11 @@ func (s *ScriptPackageProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "company": - err = unpopulate(val, "Company", &s.Company) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &s.URI) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -2654,16 +2691,19 @@ func (s *ScriptPackageProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScriptPackagesList. -func (s ScriptPackagesList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScriptPackageProperties. +func (s ScriptPackageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "company", s.Company) + populate(objectMap, "description", s.Description) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "uri", s.URI) + populate(objectMap, "version", s.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptPackagesList. -func (s *ScriptPackagesList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptPackageProperties. +func (s *ScriptPackageProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -2671,11 +2711,20 @@ func (s *ScriptPackagesList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "company": + err = unpopulate(val, "Company", &s.Company) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &s.URI) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) delete(rawMsg, key) } if err != nil { @@ -2798,16 +2847,55 @@ func (s *ScriptStringExecutionParameter) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. -func (s ServiceSpecification) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SystemAssignedServiceIdentity. +func (s SystemAssignedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", s.PrincipalID) + populate(objectMap, "tenantId", s.TenantID) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemAssignedServiceIdentity. +func (s *SystemAssignedServiceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &s.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "logSpecifications", s.LogSpecifications) - populate(objectMap, "metricSpecifications", s.MetricSpecifications) + populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification. -func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -2815,11 +2903,23 @@ func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "logSpecifications": - err = unpopulate(val, "LogSpecifications", &s.LogSpecifications) + case "createdAt": + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) - case "metricSpecifications": - err = unpopulate(val, "MetricSpecifications", &s.MetricSpecifications) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { @@ -2972,6 +3072,7 @@ func (v VirtualMachine) MarshalJSON() ([]byte, error) { populate(objectMap, "id", v.ID) populate(objectMap, "name", v.Name) populate(objectMap, "properties", v.Properties) + populate(objectMap, "systemData", v.SystemData) populate(objectMap, "type", v.Type) return json.Marshal(objectMap) } @@ -2994,6 +3095,9 @@ func (v *VirtualMachine) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &v.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &v.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &v.Type) delete(rawMsg, key) @@ -3005,12 +3109,44 @@ func (v *VirtualMachine) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type VirtualMachineListResult. +func (v VirtualMachineListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineListResult. +func (v *VirtualMachineListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type VirtualMachineProperties. func (v VirtualMachineProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "displayName", v.DisplayName) populate(objectMap, "folderPath", v.FolderPath) populate(objectMap, "moRefId", v.MoRefID) + populate(objectMap, "provisioningState", v.ProvisioningState) populate(objectMap, "restrictMovement", v.RestrictMovement) return json.Marshal(objectMap) } @@ -3033,6 +3169,9 @@ func (v *VirtualMachineProperties) UnmarshalJSON(data []byte) error { case "moRefId": err = unpopulate(val, "MoRefID", &v.MoRefID) delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) + delete(rawMsg, key) case "restrictMovement": err = unpopulate(val, "RestrictMovement", &v.RestrictMovement) delete(rawMsg, key) @@ -3071,42 +3210,13 @@ func (v *VirtualMachineRestrictMovement) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VirtualMachinesList. -func (v VirtualMachinesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinesList. -func (v *VirtualMachinesList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type WorkloadNetwork. func (w WorkloadNetwork) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } @@ -3126,6 +3236,12 @@ func (w *WorkloadNetwork) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &w.Name) delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) @@ -3143,6 +3259,7 @@ func (w WorkloadNetworkDNSService) MarshalJSON() ([]byte, error) { populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } @@ -3165,6 +3282,9 @@ func (w *WorkloadNetworkDNSService) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) @@ -3176,6 +3296,37 @@ func (w *WorkloadNetworkDNSService) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDNSServiceListResult. +func (w WorkloadNetworkDNSServiceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkDNSServiceListResult. +func (w *WorkloadNetworkDNSServiceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDNSServiceProperties. func (w WorkloadNetworkDNSServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3231,16 +3382,15 @@ func (w *WorkloadNetworkDNSServiceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDNSServicesList. -func (w WorkloadNetworkDNSServicesList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDNSServiceUpdate. +func (w WorkloadNetworkDNSServiceUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) + populate(objectMap, "properties", w.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkDNSServicesList. -func (w *WorkloadNetworkDNSServicesList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkDNSServiceUpdate. +func (w *WorkloadNetworkDNSServiceUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -3248,11 +3398,8 @@ func (w *WorkloadNetworkDNSServicesList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &w.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &w.Value) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) } if err != nil { @@ -3268,6 +3415,7 @@ func (w WorkloadNetworkDNSZone) MarshalJSON() ([]byte, error) { populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } @@ -3290,6 +3438,9 @@ func (w *WorkloadNetworkDNSZone) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) @@ -3301,6 +3452,37 @@ func (w *WorkloadNetworkDNSZone) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDNSZoneListResult. +func (w WorkloadNetworkDNSZoneListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkDNSZoneListResult. +func (w *WorkloadNetworkDNSZoneListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDNSZoneProperties. func (w WorkloadNetworkDNSZoneProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3352,16 +3534,15 @@ func (w *WorkloadNetworkDNSZoneProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDNSZonesList. -func (w WorkloadNetworkDNSZonesList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDNSZoneUpdate. +func (w WorkloadNetworkDNSZoneUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) + populate(objectMap, "properties", w.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkDNSZonesList. -func (w *WorkloadNetworkDNSZonesList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkDNSZoneUpdate. +func (w *WorkloadNetworkDNSZoneUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -3369,11 +3550,8 @@ func (w *WorkloadNetworkDNSZonesList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &w.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &w.Value) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) } if err != nil { @@ -3389,6 +3567,7 @@ func (w WorkloadNetworkDhcp) MarshalJSON() ([]byte, error) { populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } @@ -3411,6 +3590,9 @@ func (w *WorkloadNetworkDhcp) UnmarshalJSON(data []byte) error { case "properties": w.Properties, err = unmarshalWorkloadNetworkDhcpEntityClassification(val) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) @@ -3465,16 +3647,51 @@ func (w *WorkloadNetworkDhcpEntity) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDhcpList. -func (w WorkloadNetworkDhcpList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDhcpEntityUpdate. +func (w WorkloadNetworkDhcpEntityUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["dhcpType"] = w.DhcpType + populate(objectMap, "displayName", w.DisplayName) + populate(objectMap, "revision", w.Revision) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkDhcpEntityUpdate. +func (w *WorkloadNetworkDhcpEntityUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dhcpType": + err = unpopulate(val, "DhcpType", &w.DhcpType) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &w.DisplayName) + delete(rawMsg, key) + case "revision": + err = unpopulate(val, "Revision", &w.Revision) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDhcpListResult. +func (w WorkloadNetworkDhcpListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", w.NextLink) populate(objectMap, "value", w.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkDhcpList. -func (w *WorkloadNetworkDhcpList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkDhcpListResult. +func (w *WorkloadNetworkDhcpListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -3543,6 +3760,45 @@ func (w *WorkloadNetworkDhcpRelay) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDhcpRelayUpdate. +func (w WorkloadNetworkDhcpRelayUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["dhcpType"] = DhcpTypeEnumRELAY + populate(objectMap, "displayName", w.DisplayName) + populate(objectMap, "revision", w.Revision) + populate(objectMap, "serverAddresses", w.ServerAddresses) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkDhcpRelayUpdate. +func (w *WorkloadNetworkDhcpRelayUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dhcpType": + err = unpopulate(val, "DhcpType", &w.DhcpType) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &w.DisplayName) + delete(rawMsg, key) + case "revision": + err = unpopulate(val, "Revision", &w.Revision) + delete(rawMsg, key) + case "serverAddresses": + err = unpopulate(val, "ServerAddresses", &w.ServerAddresses) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDhcpServer. func (w WorkloadNetworkDhcpServer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3594,12 +3850,83 @@ func (w *WorkloadNetworkDhcpServer) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDhcpServerUpdate. +func (w WorkloadNetworkDhcpServerUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["dhcpType"] = DhcpTypeEnumSERVER + populate(objectMap, "displayName", w.DisplayName) + populate(objectMap, "leaseTime", w.LeaseTime) + populate(objectMap, "revision", w.Revision) + populate(objectMap, "serverAddress", w.ServerAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkDhcpServerUpdate. +func (w *WorkloadNetworkDhcpServerUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dhcpType": + err = unpopulate(val, "DhcpType", &w.DhcpType) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &w.DisplayName) + delete(rawMsg, key) + case "leaseTime": + err = unpopulate(val, "LeaseTime", &w.LeaseTime) + delete(rawMsg, key) + case "revision": + err = unpopulate(val, "Revision", &w.Revision) + delete(rawMsg, key) + case "serverAddress": + err = unpopulate(val, "ServerAddress", &w.ServerAddress) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkDhcpUpdate. +func (w WorkloadNetworkDhcpUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", w.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkDhcpUpdate. +func (w *WorkloadNetworkDhcpUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + w.Properties, err = unmarshalWorkloadNetworkDhcpEntityUpdateClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkGateway. func (w WorkloadNetworkGateway) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } @@ -3622,6 +3949,9 @@ func (w *WorkloadNetworkGateway) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) @@ -3633,16 +3963,16 @@ func (w *WorkloadNetworkGateway) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkGatewayList. -func (w WorkloadNetworkGatewayList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkGatewayListResult. +func (w WorkloadNetworkGatewayListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", w.NextLink) populate(objectMap, "value", w.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkGatewayList. -func (w *WorkloadNetworkGatewayList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkGatewayListResult. +func (w *WorkloadNetworkGatewayListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -3669,6 +3999,7 @@ func (w WorkloadNetworkGatewayProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "displayName", w.DisplayName) populate(objectMap, "path", w.Path) + populate(objectMap, "provisioningState", w.ProvisioningState) return json.Marshal(objectMap) } @@ -3687,6 +4018,9 @@ func (w *WorkloadNetworkGatewayProperties) UnmarshalJSON(data []byte) error { case "path": err = unpopulate(val, "Path", &w.Path) delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -3695,16 +4029,16 @@ func (w *WorkloadNetworkGatewayProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkList. -func (w WorkloadNetworkList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkListResult. +func (w WorkloadNetworkListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", w.NextLink) populate(objectMap, "value", w.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkList. -func (w *WorkloadNetworkList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkListResult. +func (w *WorkloadNetworkListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -3732,6 +4066,7 @@ func (w WorkloadNetworkPortMirroring) MarshalJSON() ([]byte, error) { populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } @@ -3754,6 +4089,9 @@ func (w *WorkloadNetworkPortMirroring) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) @@ -3765,16 +4103,16 @@ func (w *WorkloadNetworkPortMirroring) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkPortMirroringList. -func (w WorkloadNetworkPortMirroringList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkPortMirroringListResult. +func (w WorkloadNetworkPortMirroringListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", w.NextLink) populate(objectMap, "value", w.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkPortMirroringList. -func (w *WorkloadNetworkPortMirroringList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkPortMirroringListResult. +func (w *WorkloadNetworkPortMirroringListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -3847,12 +4185,67 @@ func (w *WorkloadNetworkPortMirroringProperties) UnmarshalJSON(data []byte) erro return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkPortMirroringUpdate. +func (w WorkloadNetworkPortMirroringUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", w.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkPortMirroringUpdate. +func (w *WorkloadNetworkPortMirroringUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkProperties. +func (w WorkloadNetworkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", w.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkProperties. +func (w *WorkloadNetworkProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkPublicIP. func (w WorkloadNetworkPublicIP) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } @@ -3875,6 +4268,9 @@ func (w *WorkloadNetworkPublicIP) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) @@ -3886,18 +4282,16 @@ func (w *WorkloadNetworkPublicIP) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkPublicIPProperties. -func (w WorkloadNetworkPublicIPProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkPublicIPListResult. +func (w WorkloadNetworkPublicIPListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayName", w.DisplayName) - populate(objectMap, "numberOfPublicIPs", w.NumberOfPublicIPs) - populate(objectMap, "provisioningState", w.ProvisioningState) - populate(objectMap, "publicIPBlock", w.PublicIPBlock) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkPublicIPProperties. -func (w *WorkloadNetworkPublicIPProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkPublicIPListResult. +func (w *WorkloadNetworkPublicIPListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -3905,17 +4299,11 @@ func (w *WorkloadNetworkPublicIPProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &w.DisplayName) - delete(rawMsg, key) - case "numberOfPublicIPs": - err = unpopulate(val, "NumberOfPublicIPs", &w.NumberOfPublicIPs) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) delete(rawMsg, key) - case "publicIPBlock": - err = unpopulate(val, "PublicIPBlock", &w.PublicIPBlock) + case "value": + err = unpopulate(val, "Value", &w.Value) delete(rawMsg, key) } if err != nil { @@ -3925,16 +4313,18 @@ func (w *WorkloadNetworkPublicIPProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkPublicIPsList. -func (w WorkloadNetworkPublicIPsList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkPublicIPProperties. +func (w WorkloadNetworkPublicIPProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) + populate(objectMap, "displayName", w.DisplayName) + populate(objectMap, "numberOfPublicIPs", w.NumberOfPublicIPs) + populate(objectMap, "provisioningState", w.ProvisioningState) + populate(objectMap, "publicIPBlock", w.PublicIPBlock) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkPublicIPsList. -func (w *WorkloadNetworkPublicIPsList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkPublicIPProperties. +func (w *WorkloadNetworkPublicIPProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -3942,11 +4332,17 @@ func (w *WorkloadNetworkPublicIPsList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &w.NextLink) + case "displayName": + err = unpopulate(val, "DisplayName", &w.DisplayName) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &w.Value) + case "numberOfPublicIPs": + err = unpopulate(val, "NumberOfPublicIPs", &w.NumberOfPublicIPs) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) + delete(rawMsg, key) + case "publicIPBlock": + err = unpopulate(val, "PublicIPBlock", &w.PublicIPBlock) delete(rawMsg, key) } if err != nil { @@ -3962,6 +4358,7 @@ func (w WorkloadNetworkSegment) MarshalJSON() ([]byte, error) { populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } @@ -3984,6 +4381,9 @@ func (w *WorkloadNetworkSegment) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) @@ -3995,6 +4395,37 @@ func (w *WorkloadNetworkSegment) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkSegmentListResult. +func (w WorkloadNetworkSegmentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkSegmentListResult. +func (w *WorkloadNetworkSegmentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkSegmentPortVif. func (w WorkloadNetworkSegmentPortVif) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4104,16 +4535,15 @@ func (w *WorkloadNetworkSegmentSubnet) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkSegmentsList. -func (w WorkloadNetworkSegmentsList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkSegmentUpdate. +func (w WorkloadNetworkSegmentUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) + populate(objectMap, "properties", w.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkSegmentsList. -func (w *WorkloadNetworkSegmentsList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkSegmentUpdate. +func (w *WorkloadNetworkSegmentUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -4121,11 +4551,8 @@ func (w *WorkloadNetworkSegmentsList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &w.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &w.Value) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) } if err != nil { @@ -4141,6 +4568,7 @@ func (w WorkloadNetworkVMGroup) MarshalJSON() ([]byte, error) { populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } @@ -4163,6 +4591,9 @@ func (w *WorkloadNetworkVMGroup) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) @@ -4174,6 +4605,37 @@ func (w *WorkloadNetworkVMGroup) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkVMGroupListResult. +func (w WorkloadNetworkVMGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkVMGroupListResult. +func (w *WorkloadNetworkVMGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkVMGroupProperties. func (w WorkloadNetworkVMGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4217,16 +4679,15 @@ func (w *WorkloadNetworkVMGroupProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkVMGroupsList. -func (w WorkloadNetworkVMGroupsList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkVMGroupUpdate. +func (w WorkloadNetworkVMGroupUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) + populate(objectMap, "properties", w.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkVMGroupsList. -func (w *WorkloadNetworkVMGroupsList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkVMGroupUpdate. +func (w *WorkloadNetworkVMGroupUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -4234,11 +4695,8 @@ func (w *WorkloadNetworkVMGroupsList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &w.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &w.Value) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) } if err != nil { @@ -4254,6 +4712,7 @@ func (w WorkloadNetworkVirtualMachine) MarshalJSON() ([]byte, error) { populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } @@ -4276,6 +4735,9 @@ func (w *WorkloadNetworkVirtualMachine) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) @@ -4287,16 +4749,16 @@ func (w *WorkloadNetworkVirtualMachine) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkVirtualMachineProperties. -func (w WorkloadNetworkVirtualMachineProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkVirtualMachineListResult. +func (w WorkloadNetworkVirtualMachineListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayName", w.DisplayName) - populate(objectMap, "vmType", w.VMType) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkVirtualMachineProperties. -func (w *WorkloadNetworkVirtualMachineProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkVirtualMachineListResult. +func (w *WorkloadNetworkVirtualMachineListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -4304,11 +4766,11 @@ func (w *WorkloadNetworkVirtualMachineProperties) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &w.DisplayName) + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) delete(rawMsg, key) - case "vmType": - err = unpopulate(val, "VMType", &w.VMType) + case "value": + err = unpopulate(val, "Value", &w.Value) delete(rawMsg, key) } if err != nil { @@ -4318,16 +4780,17 @@ func (w *WorkloadNetworkVirtualMachineProperties) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkVirtualMachinesList. -func (w WorkloadNetworkVirtualMachinesList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadNetworkVirtualMachineProperties. +func (w WorkloadNetworkVirtualMachineProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) + populate(objectMap, "displayName", w.DisplayName) + populate(objectMap, "provisioningState", w.ProvisioningState) + populate(objectMap, "vmType", w.VMType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkVirtualMachinesList. -func (w *WorkloadNetworkVirtualMachinesList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadNetworkVirtualMachineProperties. +func (w *WorkloadNetworkVirtualMachineProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -4335,11 +4798,14 @@ func (w *WorkloadNetworkVirtualMachinesList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &w.NextLink) + case "displayName": + err = unpopulate(val, "DisplayName", &w.DisplayName) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &w.Value) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) + delete(rawMsg, key) + case "vmType": + err = unpopulate(val, "VMType", &w.VMType) delete(rawMsg, key) } if err != nil { @@ -4360,7 +4826,7 @@ func populate(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/avs/armavs/operations_client.go b/sdk/resourcemanager/avs/armavs/operations_client.go index 81b2e21b91b8..b1236ce7d4da 100644 --- a/sdk/resourcemanager/avs/armavs/operations_client.go +++ b/sdk/resourcemanager/avs/armavs/operations_client.go @@ -37,9 +37,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// NewListPager - Lists all of the available operations +// NewListPager - List the operations for the provider // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -81,7 +81,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OperationList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/avs/armavs/operations_client_example_test.go b/sdk/resourcemanager/avs/armavs/operations_client_example_test.go deleted file mode 100644 index 59c88081f4c3..000000000000 --- a/sdk/resourcemanager/avs/armavs/operations_client_example_test.go +++ /dev/null @@ -1,578 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationList = armavs.OperationList{ - // Value: []*armavs.Operation{ - // { - // Name: to.Ptr("Microsoft.AVS/operations/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Lists operations available on Microsoft.AVS resource provider."), - // Operation: to.Ptr("List available Microsoft.AVS operations"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("operations"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/register/action"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Register Subscription for Microsoft.AVS resource provider."), - // Operation: to.Ptr("Register Subscription for Microsoft.AVS"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr(""), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/unregister/action"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Unregister Subscription for Microsoft.AVS resource provider."), - // Operation: to.Ptr("Unregister Subscription for Microsoft.AVS"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr(""), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/checkNameAvailability/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Checks if the privateCloud Name is available"), - // Operation: to.Ptr("Check Name Availability"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("checkNameAvailability"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/locations/checkNameAvailability/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Checks if the privateCloud Name is available"), - // Operation: to.Ptr("Check Name Availability"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("locations/checkNameAvailability"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/locations/checkQuotaAvailability/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Checks if quota is available for the subscription"), - // Operation: to.Ptr("Check Quota Availability"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("locations/checkQuotaAvailability"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/locations/checkTrialAvailability/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Checks if trial is available for the subscription"), - // Operation: to.Ptr("Check Trial Availability"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("locations/checkTrialAvailability"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/register/action"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Registers the Microsoft Microsoft.AVS resource provider and enables creation of Private Clouds."), - // Operation: to.Ptr("Register Microsoft.AVS resource provider."), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/write"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Creates or updates a PrivateCloud resource."), - // Operation: to.Ptr("Create or update a PrivateCloud."), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Gets the settings for the specified PrivateCloud."), - // Operation: to.Ptr("Read PrivateCloud settings"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/delete"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Delete a specific PrivateCloud."), - // Operation: to.Ptr("Delete a PrivateCloud."), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/operationstatuses/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Reads privateClouds operationstatuses."), - // Operation: to.Ptr("Read privateClouds operationstatuses"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/operationstatuses"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/clusters/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Gets the cluster settings for a PrivateCloud cluster."), - // Operation: to.Ptr("Read Cluster settings."), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/clusters"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/clusters/write"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Create or update a PrivateCloud cluster resource."), - // Operation: to.Ptr("Create or update a PrivateCloud cluster."), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/clusters"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/clusters/delete"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Delete a specific PrivateCloud cluster."), - // Operation: to.Ptr("Delete a PriveCloud cluster."), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/clusters"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/clusters/operationstatuses/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Reads privateClouds/clusters operationstatuses."), - // Operation: to.Ptr("Read privateClouds/clusters operationstatuses"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/clusters/operationstatuses"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateclouds/clusters/operationresults/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Reads privateClouds/clusters operationresults."), - // Operation: to.Ptr("Read privateClouds/clusters operationresults"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateclouds/clusters/operationresults"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/operationresults/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Reads privateClouds operationresults."), - // Operation: to.Ptr("Read privateClouds operationresults"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/operationresults"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/authorizations/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Gets the authorization settings for a PrivateCloud cluster."), - // Operation: to.Ptr("Read Authorization settings."), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/authorizations"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/authorizations/write"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Create or update a PrivateCloud authorization resource."), - // Operation: to.Ptr("Create or update a PrivateCloud authorization."), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/authorizations"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/authorizations/delete"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Delete a specific PrivateCloud authorization."), - // Operation: to.Ptr("Delete a PriveCloud authorization."), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/authorizations"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/listAdminCredentials/action"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Lists the AdminCredentials for privateClouds."), - // Operation: to.Ptr("List privateClouds AdminCredentials"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/hcxEnterpriseSites/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Gets the hcxEnterpriseSites for a PrivateCloud."), - // Operation: to.Ptr("Read hcxEnterpriseSites"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/hcxEnterpriseSites"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/hcxEnterpriseSites/write"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Create or update a hcxEnterpriseSites."), - // Operation: to.Ptr("Create or update a hcxEnterpriseSites"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/hcxEnterpriseSites"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/hcxEnterpriseSites/delete"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Delete a specific hcxEnterpriseSites."), - // Operation: to.Ptr("Delete a hcxEnterpriseSites"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/hcxEnterpriseSites"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/hostInstances/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Gets the hostInstances for a PrivateCloud."), - // Operation: to.Ptr("Read hostInstances"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/hostInstances"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/hostInstances/write"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Create or update a hostInstances."), - // Operation: to.Ptr("Create or update a hostInstances"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/hostInstances"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/hostInstances/delete"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Delete a specific hostInstances."), - // Operation: to.Ptr("Delete a hostInstances"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds/hostInstances"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Gets the available metrics for Private Cloud"), - // Operation: to.Ptr("Read Private Cloud metric definitions"), - // Provider: to.Ptr("Microsoft Azure Dedicated"), - // Resource: to.Ptr("privateClouds"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // Properties: &armavs.OperationProperties{ - // ServiceSpecification: &armavs.ServiceSpecification{ - // MetricSpecifications: []*armavs.MetricSpecification{ - // { - // Name: to.Ptr("UsedLatest"), - // AggregationType: to.Ptr("Average"), - // DisplayDescription: to.Ptr("The total amount of disk used in SDDC"), - // DisplayName: to.Ptr("Datastore disk used"), - // EnableRegionalMdmAccount: to.Ptr("true"), - // SourceMdmAccount: to.Ptr("AVSShoebox2"), - // SourceMdmNamespace: to.Ptr("Vsphere.Datastore.Disk"), - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("CapacityLatest"), - // AggregationType: to.Ptr("Average"), - // DisplayDescription: to.Ptr("The total capacity of disk in SDDC"), - // DisplayName: to.Ptr("Datastore disk total capacity"), - // EnableRegionalMdmAccount: to.Ptr("true"), - // SourceMdmAccount: to.Ptr("AVSShoebox2"), - // SourceMdmNamespace: to.Ptr("Vsphere.Datastore.Disk"), - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("EffectiveMemAverage"), - // AggregationType: to.Ptr("Average"), - // DisplayDescription: to.Ptr("Total amount of machine memory in cluster that is available"), - // DisplayName: to.Ptr("Average Effective Memory"), - // EnableRegionalMdmAccount: to.Ptr("true"), - // SourceMdmAccount: to.Ptr("AVSShoebox2"), - // SourceMdmNamespace: to.Ptr("Vsphere.Cluster.ClusterServices"), - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("TotalMbAverage"), - // AggregationType: to.Ptr("Average"), - // DisplayDescription: to.Ptr("Total memory in cluster"), - // DisplayName: to.Ptr("Average Total Memory"), - // EnableRegionalMdmAccount: to.Ptr("true"), - // SourceMdmAccount: to.Ptr("AVSShoebox2"), - // SourceMdmNamespace: to.Ptr("Vsphere.Cluster.Mem"), - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("OverheadAverage"), - // AggregationType: to.Ptr("Average"), - // DisplayDescription: to.Ptr("Host physical memory consumed by the virtualization infrastructure"), - // DisplayName: to.Ptr("Average Memory Overhead"), - // EnableRegionalMdmAccount: to.Ptr("true"), - // SourceMdmAccount: to.Ptr("AVSShoebox2"), - // SourceMdmNamespace: to.Ptr("Vsphere.Cluster.Mem"), - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("UsageAverage"), - // AggregationType: to.Ptr("Average"), - // DisplayDescription: to.Ptr("Memory usage as percentage of total configured or available memory"), - // DisplayName: to.Ptr("Average Memory Usage"), - // EnableRegionalMdmAccount: to.Ptr("true"), - // SourceMdmAccount: to.Ptr("AVSShoebox2"), - // SourceMdmNamespace: to.Ptr("Vsphere.Cluster.Mem"), - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Percent"), - // }, - // { - // Name: to.Ptr("EffectiveCpuAverage"), - // AggregationType: to.Ptr("Average"), - // DisplayDescription: to.Ptr("Total available CPU resources in cluster"), - // DisplayName: to.Ptr("Effective CPU available"), - // EnableRegionalMdmAccount: to.Ptr("true"), - // SourceMdmAccount: to.Ptr("AVSShoebox2"), - // SourceMdmNamespace: to.Ptr("Vsphere.Cluster.ClusterServices"), - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Percent"), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Gets the diagnostic setting for the resource"), - // Operation: to.Ptr("Read diagnostic setting"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // Properties: &armavs.OperationProperties{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.AVS/privateClouds/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armavs.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), - // Operation: to.Ptr("Write diagnostic setting"), - // Provider: to.Ptr("Microsoft.AVS"), - // Resource: to.Ptr("privateClouds"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // Properties: &armavs.OperationProperties{ - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/avs/armavs/options.go b/sdk/resourcemanager/avs/armavs/options.go index be638b3441f7..143dd111845d 100644 --- a/sdk/resourcemanager/avs/armavs/options.go +++ b/sdk/resourcemanager/avs/armavs/options.go @@ -178,6 +178,30 @@ type HcxEnterpriseSitesClientListOptions struct { // placeholder for future optional parameters } +// IscsiPathsClientBeginCreateOrUpdateOptions contains the optional parameters for the IscsiPathsClient.BeginCreateOrUpdate +// method. +type IscsiPathsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IscsiPathsClientBeginDeleteOptions contains the optional parameters for the IscsiPathsClient.BeginDelete method. +type IscsiPathsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IscsiPathsClientGetOptions contains the optional parameters for the IscsiPathsClient.Get method. +type IscsiPathsClientGetOptions struct { + // placeholder for future optional parameters +} + +// IscsiPathsClientListByPrivateCloudOptions contains the optional parameters for the IscsiPathsClient.NewListByPrivateCloudPager +// method. +type IscsiPathsClientListByPrivateCloudOptions struct { + // placeholder for future optional parameters +} + // LocationsClientCheckQuotaAvailabilityOptions contains the optional parameters for the LocationsClient.CheckQuotaAvailability // method. type LocationsClientCheckQuotaAvailabilityOptions struct { @@ -187,7 +211,7 @@ type LocationsClientCheckQuotaAvailabilityOptions struct { // LocationsClientCheckTrialAvailabilityOptions contains the optional parameters for the LocationsClient.CheckTrialAvailability // method. type LocationsClientCheckTrialAvailabilityOptions struct { - // The sku to check for trial availability + // Optionally, check for a specific SKU SKU *SKU } @@ -308,7 +332,7 @@ type ScriptExecutionsClientBeginDeleteOptions struct { // ScriptExecutionsClientGetExecutionLogsOptions contains the optional parameters for the ScriptExecutionsClient.GetExecutionLogs // method. type ScriptExecutionsClientGetExecutionLogsOptions struct { - // Name of the desired output stream to return. If not provided, will return all. An empty array will return nothing + // Name of the desired output stream to return. If not provided, will return all. An empty array will return nothing. ScriptOutputStreamType []*ScriptOutputStreamType } diff --git a/sdk/resourcemanager/avs/armavs/placementpolicies_client.go b/sdk/resourcemanager/avs/armavs/placementpolicies_client.go index c5bebbad3d50..82e1e89abbd1 100644 --- a/sdk/resourcemanager/avs/armavs/placementpolicies_client.go +++ b/sdk/resourcemanager/avs/armavs/placementpolicies_client.go @@ -43,15 +43,15 @@ func NewPlacementPoliciesClient(subscriptionID string, credential azcore.TokenCr return client, nil } -// BeginCreateOrUpdate - Create or update a placement policy in a private cloud cluster +// BeginCreateOrUpdate - Create a PlacementPolicy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud -// - placementPolicyName - Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy -// - placementPolicy - A placement policy in the private cloud cluster +// - clusterName - Name of the cluster +// - placementPolicyName - Name of the placement policy. +// - placementPolicy - Resource create parameters. // - options - PlacementPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the PlacementPoliciesClient.BeginCreateOrUpdate // method. func (client *PlacementPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, placementPolicyName string, placementPolicy PlacementPolicy, options *PlacementPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PlacementPoliciesClientCreateOrUpdateResponse], error) { @@ -61,7 +61,8 @@ func (client *PlacementPoliciesClient) BeginCreateOrUpdate(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PlacementPoliciesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,10 +72,10 @@ func (client *PlacementPoliciesClient) BeginCreateOrUpdate(ctx context.Context, } } -// CreateOrUpdate - Create or update a placement policy in a private cloud cluster +// CreateOrUpdate - Create a PlacementPolicy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *PlacementPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, placementPolicyName string, placementPolicy PlacementPolicy, options *PlacementPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PlacementPoliciesClient.BeginCreateOrUpdate" @@ -124,7 +125,7 @@ func (client *PlacementPoliciesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, placementPolicy); err != nil { @@ -133,14 +134,14 @@ func (client *PlacementPoliciesClient) createOrUpdateCreateRequest(ctx context.C return req, nil } -// BeginDelete - Delete a placement policy in a private cloud cluster +// BeginDelete - Delete a PlacementPolicy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud -// - placementPolicyName - Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy +// - clusterName - Name of the cluster +// - placementPolicyName - Name of the placement policy. // - options - PlacementPoliciesClientBeginDeleteOptions contains the optional parameters for the PlacementPoliciesClient.BeginDelete // method. func (client *PlacementPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, placementPolicyName string, options *PlacementPoliciesClientBeginDeleteOptions) (*runtime.Poller[PlacementPoliciesClientDeleteResponse], error) { @@ -150,7 +151,8 @@ func (client *PlacementPoliciesClient) BeginDelete(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PlacementPoliciesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -160,10 +162,10 @@ func (client *PlacementPoliciesClient) BeginDelete(ctx context.Context, resource } } -// Delete - Delete a placement policy in a private cloud cluster +// Delete - Delete a PlacementPolicy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *PlacementPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, placementPolicyName string, options *PlacementPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PlacementPoliciesClient.BeginDelete" @@ -213,20 +215,20 @@ func (client *PlacementPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get a placement policy by name in a private cloud cluster +// Get - Get a PlacementPolicy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud -// - placementPolicyName - Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy +// - clusterName - Name of the cluster +// - placementPolicyName - Name of the placement policy. // - options - PlacementPoliciesClientGetOptions contains the optional parameters for the PlacementPoliciesClient.Get method. func (client *PlacementPoliciesClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, placementPolicyName string, options *PlacementPoliciesClientGetOptions) (PlacementPoliciesClientGetResponse, error) { var err error @@ -278,7 +280,7 @@ func (client *PlacementPoliciesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -293,12 +295,12 @@ func (client *PlacementPoliciesClient) getHandleResponse(resp *http.Response) (P return result, nil } -// NewListPager - List placement policies in a private cloud cluster +// NewListPager - List PlacementPolicy resources by Cluster // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud +// - clusterName - Name of the cluster // - options - PlacementPoliciesClientListOptions contains the optional parameters for the PlacementPoliciesClient.NewListPager // method. func (client *PlacementPoliciesClient) NewListPager(resourceGroupName string, privateCloudName string, clusterName string, options *PlacementPoliciesClientListOptions) *runtime.Pager[PlacementPoliciesClientListResponse] { @@ -348,7 +350,7 @@ func (client *PlacementPoliciesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -357,21 +359,21 @@ func (client *PlacementPoliciesClient) listCreateRequest(ctx context.Context, re // listHandleResponse handles the List response. func (client *PlacementPoliciesClient) listHandleResponse(resp *http.Response) (PlacementPoliciesClientListResponse, error) { result := PlacementPoliciesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PlacementPoliciesList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.PlacementPolicyListResult); err != nil { return PlacementPoliciesClientListResponse{}, err } return result, nil } -// BeginUpdate - Update a placement policy in a private cloud cluster +// BeginUpdate - Update a PlacementPolicy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud -// - placementPolicyName - Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy -// - placementPolicyUpdate - The placement policy properties that may be updated +// - clusterName - Name of the cluster +// - placementPolicyName - Name of the placement policy. +// - placementPolicyUpdate - The placement policy properties to be updated. // - options - PlacementPoliciesClientBeginUpdateOptions contains the optional parameters for the PlacementPoliciesClient.BeginUpdate // method. func (client *PlacementPoliciesClient) BeginUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, placementPolicyName string, placementPolicyUpdate PlacementPolicyUpdate, options *PlacementPoliciesClientBeginUpdateOptions) (*runtime.Poller[PlacementPoliciesClientUpdateResponse], error) { @@ -381,7 +383,8 @@ func (client *PlacementPoliciesClient) BeginUpdate(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PlacementPoliciesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -391,10 +394,10 @@ func (client *PlacementPoliciesClient) BeginUpdate(ctx context.Context, resource } } -// Update - Update a placement policy in a private cloud cluster +// Update - Update a PlacementPolicy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *PlacementPoliciesClient) update(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, placementPolicyName string, placementPolicyUpdate PlacementPolicyUpdate, options *PlacementPoliciesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "PlacementPoliciesClient.BeginUpdate" @@ -444,7 +447,7 @@ func (client *PlacementPoliciesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, placementPolicyUpdate); err != nil { diff --git a/sdk/resourcemanager/avs/armavs/placementpolicies_client_example_test.go b/sdk/resourcemanager/avs/armavs/placementpolicies_client_example_test.go deleted file mode 100644 index 99209cf3a0e3..000000000000 --- a/sdk/resourcemanager/avs/armavs/placementpolicies_client_example_test.go +++ /dev/null @@ -1,262 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_List.json -func ExamplePlacementPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPlacementPoliciesClient().NewListPager("group1", "cloud1", "cluster1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PlacementPoliciesList = armavs.PlacementPoliciesList{ - // Value: []*armavs.PlacementPolicy{ - // { - // Name: to.Ptr("policy1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters/placementPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1"), - // Properties: &armavs.VMHostPlacementPolicyProperties{ - // Type: to.Ptr(armavs.PlacementPolicyTypeVMHost), - // DisplayName: to.Ptr("policy1"), - // ProvisioningState: to.Ptr(armavs.PlacementPolicyProvisioningStateSucceeded), - // State: to.Ptr(armavs.PlacementPolicyStateEnabled), - // AffinityStrength: to.Ptr(armavs.AffinityStrengthMust), - // AffinityType: to.Ptr(armavs.AffinityTypeAntiAffinity), - // AzureHybridBenefitType: to.Ptr(armavs.AzureHybridBenefitTypeSQLHost), - // HostMembers: []*string{ - // to.Ptr("fakehost22.nyc1.kubernetes.center"), - // to.Ptr("fakehost23.nyc1.kubernetes.center"), - // to.Ptr("fakehost24.nyc1.kubernetes.center")}, - // VMMembers: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256")}, - // }, - // }, - // { - // Name: to.Ptr("policy2"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters/placementPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy2"), - // Properties: &armavs.VMPlacementPolicyProperties{ - // Type: to.Ptr(armavs.PlacementPolicyTypeVMVM), - // DisplayName: to.Ptr("policy2"), - // ProvisioningState: to.Ptr(armavs.PlacementPolicyProvisioningStateSucceeded), - // State: to.Ptr(armavs.PlacementPolicyStateEnabled), - // AffinityType: to.Ptr(armavs.AffinityTypeAffinity), - // VMMembers: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_Get.json -func ExamplePlacementPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPlacementPoliciesClient().Get(ctx, "group1", "cloud1", "cluster1", "policy1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PlacementPolicy = armavs.PlacementPolicy{ - // Name: to.Ptr("policy1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters/placementPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1"), - // Properties: &armavs.VMHostPlacementPolicyProperties{ - // Type: to.Ptr(armavs.PlacementPolicyTypeVMHost), - // DisplayName: to.Ptr("policy1"), - // ProvisioningState: to.Ptr(armavs.PlacementPolicyProvisioningStateSucceeded), - // State: to.Ptr(armavs.PlacementPolicyStateEnabled), - // AffinityStrength: to.Ptr(armavs.AffinityStrengthMust), - // AffinityType: to.Ptr(armavs.AffinityTypeAntiAffinity), - // AzureHybridBenefitType: to.Ptr(armavs.AzureHybridBenefitTypeSQLHost), - // HostMembers: []*string{ - // to.Ptr("fakehost22.nyc1.kubernetes.center"), - // to.Ptr("fakehost23.nyc1.kubernetes.center"), - // to.Ptr("fakehost24.nyc1.kubernetes.center")}, - // VMMembers: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_CreateOrUpdate.json -func ExamplePlacementPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPlacementPoliciesClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "cluster1", "policy1", armavs.PlacementPolicy{ - Properties: &armavs.VMHostPlacementPolicyProperties{ - Type: to.Ptr(armavs.PlacementPolicyTypeVMHost), - AffinityStrength: to.Ptr(armavs.AffinityStrengthMust), - AffinityType: to.Ptr(armavs.AffinityTypeAntiAffinity), - AzureHybridBenefitType: to.Ptr(armavs.AzureHybridBenefitTypeSQLHost), - HostMembers: []*string{ - to.Ptr("fakehost22.nyc1.kubernetes.center"), - to.Ptr("fakehost23.nyc1.kubernetes.center"), - to.Ptr("fakehost24.nyc1.kubernetes.center")}, - VMMembers: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128"), - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PlacementPolicy = armavs.PlacementPolicy{ - // Name: to.Ptr("policy1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters/placementPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1"), - // Properties: &armavs.VMHostPlacementPolicyProperties{ - // Type: to.Ptr(armavs.PlacementPolicyTypeVMHost), - // DisplayName: to.Ptr("policy1"), - // ProvisioningState: to.Ptr(armavs.PlacementPolicyProvisioningStateSucceeded), - // State: to.Ptr(armavs.PlacementPolicyStateEnabled), - // AffinityStrength: to.Ptr(armavs.AffinityStrengthMust), - // AffinityType: to.Ptr(armavs.AffinityTypeAntiAffinity), - // AzureHybridBenefitType: to.Ptr(armavs.AzureHybridBenefitTypeSQLHost), - // HostMembers: []*string{ - // to.Ptr("fakehost22.nyc1.kubernetes.center"), - // to.Ptr("fakehost23.nyc1.kubernetes.center"), - // to.Ptr("fakehost24.nyc1.kubernetes.center")}, - // VMMembers: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_Update.json -func ExamplePlacementPoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPlacementPoliciesClient().BeginUpdate(ctx, "group1", "cloud1", "cluster1", "policy1", armavs.PlacementPolicyUpdate{ - Properties: &armavs.PlacementPolicyUpdateProperties{ - AffinityStrength: to.Ptr(armavs.AffinityStrengthMust), - AzureHybridBenefitType: to.Ptr(armavs.AzureHybridBenefitTypeSQLHost), - HostMembers: []*string{ - to.Ptr("fakehost22.nyc1.kubernetes.center"), - to.Ptr("fakehost23.nyc1.kubernetes.center"), - to.Ptr("fakehost24.nyc1.kubernetes.center")}, - State: to.Ptr(armavs.PlacementPolicyStateDisabled), - VMMembers: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128"), - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PlacementPolicy = armavs.PlacementPolicy{ - // Name: to.Ptr("policy1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters/placementPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1"), - // Properties: &armavs.VMHostPlacementPolicyProperties{ - // Type: to.Ptr(armavs.PlacementPolicyTypeVMHost), - // DisplayName: to.Ptr("policy1"), - // ProvisioningState: to.Ptr(armavs.PlacementPolicyProvisioningStateSucceeded), - // State: to.Ptr(armavs.PlacementPolicyStateDisabled), - // AffinityStrength: to.Ptr(armavs.AffinityStrengthMust), - // AffinityType: to.Ptr(armavs.AffinityTypeAntiAffinity), - // AzureHybridBenefitType: to.Ptr(armavs.AzureHybridBenefitTypeSQLHost), - // HostMembers: []*string{ - // to.Ptr("fakehost22.nyc1.kubernetes.center"), - // to.Ptr("fakehost23.nyc1.kubernetes.center"), - // to.Ptr("fakehost24.nyc1.kubernetes.center")}, - // VMMembers: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PlacementPolicies_Delete.json -func ExamplePlacementPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPlacementPoliciesClient().BeginDelete(ctx, "group1", "cloud1", "cluster1", "policy1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/avs/armavs/polymorphic_helpers.go b/sdk/resourcemanager/avs/armavs/polymorphic_helpers.go index 63f2c5407c74..b1cd3f44fc49 100644 --- a/sdk/resourcemanager/avs/armavs/polymorphic_helpers.go +++ b/sdk/resourcemanager/avs/armavs/polymorphic_helpers.go @@ -11,7 +11,7 @@ package armavs import "encoding/json" func unmarshalAddonPropertiesClassification(rawMsg json.RawMessage) (AddonPropertiesClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -38,7 +38,7 @@ func unmarshalAddonPropertiesClassification(rawMsg json.RawMessage) (AddonProper } func unmarshalPlacementPolicyPropertiesClassification(rawMsg json.RawMessage) (PlacementPolicyPropertiesClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -61,7 +61,7 @@ func unmarshalPlacementPolicyPropertiesClassification(rawMsg json.RawMessage) (P } func unmarshalScriptExecutionParameterClassification(rawMsg json.RawMessage) (ScriptExecutionParameterClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -86,7 +86,7 @@ func unmarshalScriptExecutionParameterClassification(rawMsg json.RawMessage) (Sc } func unmarshalScriptExecutionParameterClassificationArray(rawMsg json.RawMessage) ([]ScriptExecutionParameterClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages []json.RawMessage @@ -105,7 +105,7 @@ func unmarshalScriptExecutionParameterClassificationArray(rawMsg json.RawMessage } func unmarshalWorkloadNetworkDhcpEntityClassification(rawMsg json.RawMessage) (WorkloadNetworkDhcpEntityClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -126,3 +126,26 @@ func unmarshalWorkloadNetworkDhcpEntityClassification(rawMsg json.RawMessage) (W } return b, nil } + +func unmarshalWorkloadNetworkDhcpEntityUpdateClassification(rawMsg json.RawMessage) (WorkloadNetworkDhcpEntityUpdateClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b WorkloadNetworkDhcpEntityUpdateClassification + switch m["dhcpType"] { + case string(DhcpTypeEnumRELAY): + b = &WorkloadNetworkDhcpRelayUpdate{} + case string(DhcpTypeEnumSERVER): + b = &WorkloadNetworkDhcpServerUpdate{} + default: + b = &WorkloadNetworkDhcpEntityUpdate{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} diff --git a/sdk/resourcemanager/avs/armavs/privateclouds_client.go b/sdk/resourcemanager/avs/armavs/privateclouds_client.go index 403280c6541f..c7739459048d 100644 --- a/sdk/resourcemanager/avs/armavs/privateclouds_client.go +++ b/sdk/resourcemanager/avs/armavs/privateclouds_client.go @@ -43,13 +43,13 @@ func NewPrivateCloudsClient(subscriptionID string, credential azcore.TokenCreden return client, nil } -// BeginCreateOrUpdate - Create or update a private cloud +// BeginCreateOrUpdate - Create a PrivateCloud // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - privateCloud - The private cloud +// - privateCloud - Resource create parameters. // - options - PrivateCloudsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateCloudsClient.BeginCreateOrUpdate // method. func (client *PrivateCloudsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, privateCloud PrivateCloud, options *PrivateCloudsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateCloudsClientCreateOrUpdateResponse], error) { @@ -59,7 +59,8 @@ func (client *PrivateCloudsClient) BeginCreateOrUpdate(ctx context.Context, reso return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateCloudsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -69,10 +70,10 @@ func (client *PrivateCloudsClient) BeginCreateOrUpdate(ctx context.Context, reso } } -// CreateOrUpdate - Create or update a private cloud +// CreateOrUpdate - Create a PrivateCloud // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *PrivateCloudsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, privateCloud PrivateCloud, options *PrivateCloudsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateCloudsClient.BeginCreateOrUpdate" @@ -114,7 +115,7 @@ func (client *PrivateCloudsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, privateCloud); err != nil { @@ -123,10 +124,10 @@ func (client *PrivateCloudsClient) createOrUpdateCreateRequest(ctx context.Conte return req, nil } -// BeginDelete - Delete a private cloud +// BeginDelete - Delete a PrivateCloud // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - PrivateCloudsClientBeginDeleteOptions contains the optional parameters for the PrivateCloudsClient.BeginDelete @@ -138,7 +139,8 @@ func (client *PrivateCloudsClient) BeginDelete(ctx context.Context, resourceGrou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateCloudsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -148,10 +150,10 @@ func (client *PrivateCloudsClient) BeginDelete(ctx context.Context, resourceGrou } } -// Delete - Delete a private cloud +// Delete - Delete a PrivateCloud // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *PrivateCloudsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateCloudName string, options *PrivateCloudsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateCloudsClient.BeginDelete" @@ -193,16 +195,16 @@ func (client *PrivateCloudsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get a private cloud +// Get - Get a PrivateCloud // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - PrivateCloudsClientGetOptions contains the optional parameters for the PrivateCloudsClient.Get method. @@ -248,7 +250,7 @@ func (client *PrivateCloudsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,9 +265,9 @@ func (client *PrivateCloudsClient) getHandleResponse(resp *http.Response) (Priva return result, nil } -// NewListPager - List private clouds in a resource group +// NewListPager - List PrivateCloud resources by resource group // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - PrivateCloudsClientListOptions contains the optional parameters for the PrivateCloudsClient.NewListPager method. func (client *PrivateCloudsClient) NewListPager(resourceGroupName string, options *PrivateCloudsClientListOptions) *runtime.Pager[PrivateCloudsClientListResponse] { @@ -307,7 +309,7 @@ func (client *PrivateCloudsClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,7 +318,7 @@ func (client *PrivateCloudsClient) listCreateRequest(ctx context.Context, resour // listHandleResponse handles the List response. func (client *PrivateCloudsClient) listHandleResponse(resp *http.Response) (PrivateCloudsClientListResponse, error) { result := PrivateCloudsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateCloudList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateCloudListResult); err != nil { return PrivateCloudsClientListResponse{}, err } return result, nil @@ -325,7 +327,7 @@ func (client *PrivateCloudsClient) listHandleResponse(resp *http.Response) (Priv // ListAdminCredentials - List the admin credentials for the private cloud // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - PrivateCloudsClientListAdminCredentialsOptions contains the optional parameters for the PrivateCloudsClient.ListAdminCredentials @@ -372,7 +374,7 @@ func (client *PrivateCloudsClient) listAdminCredentialsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,9 +389,9 @@ func (client *PrivateCloudsClient) listAdminCredentialsHandleResponse(resp *http return result, nil } -// NewListInSubscriptionPager - List private clouds in a subscription +// NewListInSubscriptionPager - List PrivateCloud resources by subscription ID // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - options - PrivateCloudsClientListInSubscriptionOptions contains the optional parameters for the PrivateCloudsClient.NewListInSubscriptionPager // method. func (client *PrivateCloudsClient) NewListInSubscriptionPager(options *PrivateCloudsClientListInSubscriptionOptions) *runtime.Pager[PrivateCloudsClientListInSubscriptionResponse] { @@ -427,7 +429,7 @@ func (client *PrivateCloudsClient) listInSubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -436,7 +438,7 @@ func (client *PrivateCloudsClient) listInSubscriptionCreateRequest(ctx context.C // listInSubscriptionHandleResponse handles the ListInSubscription response. func (client *PrivateCloudsClient) listInSubscriptionHandleResponse(resp *http.Response) (PrivateCloudsClientListInSubscriptionResponse, error) { result := PrivateCloudsClientListInSubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateCloudList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateCloudListResult); err != nil { return PrivateCloudsClientListInSubscriptionResponse{}, err } return result, nil @@ -445,7 +447,7 @@ func (client *PrivateCloudsClient) listInSubscriptionHandleResponse(resp *http.R // BeginRotateNsxtPassword - Rotate the NSX-T Manager password // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - PrivateCloudsClientBeginRotateNsxtPasswordOptions contains the optional parameters for the PrivateCloudsClient.BeginRotateNsxtPassword @@ -457,7 +459,8 @@ func (client *PrivateCloudsClient) BeginRotateNsxtPassword(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateCloudsClientRotateNsxtPasswordResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -470,7 +473,7 @@ func (client *PrivateCloudsClient) BeginRotateNsxtPassword(ctx context.Context, // RotateNsxtPassword - Rotate the NSX-T Manager password // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *PrivateCloudsClient) rotateNsxtPassword(ctx context.Context, resourceGroupName string, privateCloudName string, options *PrivateCloudsClientBeginRotateNsxtPasswordOptions) (*http.Response, error) { var err error const operationName = "PrivateCloudsClient.BeginRotateNsxtPassword" @@ -512,7 +515,7 @@ func (client *PrivateCloudsClient) rotateNsxtPasswordCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -521,7 +524,7 @@ func (client *PrivateCloudsClient) rotateNsxtPasswordCreateRequest(ctx context.C // BeginRotateVcenterPassword - Rotate the vCenter password // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - PrivateCloudsClientBeginRotateVcenterPasswordOptions contains the optional parameters for the PrivateCloudsClient.BeginRotateVcenterPassword @@ -533,7 +536,8 @@ func (client *PrivateCloudsClient) BeginRotateVcenterPassword(ctx context.Contex return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateCloudsClientRotateVcenterPasswordResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -546,7 +550,7 @@ func (client *PrivateCloudsClient) BeginRotateVcenterPassword(ctx context.Contex // RotateVcenterPassword - Rotate the vCenter password // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *PrivateCloudsClient) rotateVcenterPassword(ctx context.Context, resourceGroupName string, privateCloudName string, options *PrivateCloudsClientBeginRotateVcenterPasswordOptions) (*http.Response, error) { var err error const operationName = "PrivateCloudsClient.BeginRotateVcenterPassword" @@ -588,19 +592,19 @@ func (client *PrivateCloudsClient) rotateVcenterPasswordCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginUpdate - Update a private cloud +// BeginUpdate - Update a PrivateCloud // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - privateCloudUpdate - The private cloud properties to be updated +// - privateCloudUpdate - The private cloud properties to be updated. // - options - PrivateCloudsClientBeginUpdateOptions contains the optional parameters for the PrivateCloudsClient.BeginUpdate // method. func (client *PrivateCloudsClient) BeginUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, privateCloudUpdate PrivateCloudUpdate, options *PrivateCloudsClientBeginUpdateOptions) (*runtime.Poller[PrivateCloudsClientUpdateResponse], error) { @@ -610,7 +614,8 @@ func (client *PrivateCloudsClient) BeginUpdate(ctx context.Context, resourceGrou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateCloudsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -620,10 +625,10 @@ func (client *PrivateCloudsClient) BeginUpdate(ctx context.Context, resourceGrou } } -// Update - Update a private cloud +// Update - Update a PrivateCloud // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *PrivateCloudsClient) update(ctx context.Context, resourceGroupName string, privateCloudName string, privateCloudUpdate PrivateCloudUpdate, options *PrivateCloudsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateCloudsClient.BeginUpdate" @@ -665,7 +670,7 @@ func (client *PrivateCloudsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, privateCloudUpdate); err != nil { diff --git a/sdk/resourcemanager/avs/armavs/privateclouds_client_example_test.go b/sdk/resourcemanager/avs/armavs/privateclouds_client_example_test.go deleted file mode 100644 index 44d741a935a7..000000000000 --- a/sdk/resourcemanager/avs/armavs/privateclouds_client_example_test.go +++ /dev/null @@ -1,991 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_List.json -func ExamplePrivateCloudsClient_NewListPager_privateCloudsList() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateCloudsClient().NewListPager("group1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateCloudList = armavs.PrivateCloudList{ - // Value: []*armavs.PrivateCloud{ - // { - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1"), - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // }, - // Properties: &armavs.PrivateCloudProperties{ - // Availability: &armavs.AvailabilityProperties{ - // Strategy: to.Ptr(armavs.AvailabilityStrategySingleZone), - // Zone: to.Ptr[int32](1), - // }, - // IdentitySources: []*armavs.IdentitySource{ - // { - // Name: to.Ptr("group1"), - // Alias: to.Ptr("groupAlias"), - // BaseGroupDN: to.Ptr("ou=baseGroup"), - // BaseUserDN: to.Ptr("ou=baseUser"), - // Domain: to.Ptr("domain1"), - // PrimaryServer: to.Ptr("ldaps://1.1.1.1:636/"), - // SecondaryServer: to.Ptr("ldaps://1.1.1.2:636/"), - // SSL: to.Ptr(armavs.SSLEnumEnabled), - // }}, - // Internet: to.Ptr(armavs.InternetEnumDisabled), - // ManagementCluster: &armavs.ManagementCluster{ - // ClusterID: to.Ptr[int32](1), - // ClusterSize: to.Ptr[int32](4), - // Hosts: []*string{ - // to.Ptr("fakehost18.nyc1.kubernetes.center"), - // to.Ptr("fakehost19.nyc1.kubernetes.center"), - // to.Ptr("fakehost20.nyc1.kubernetes.center"), - // to.Ptr("fakehost21.nyc1.kubernetes.center")}, - // }, - // Circuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // ExpressRoutePrivatePeeringID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // Endpoints: &armavs.Endpoints{ - // HcxCloudManager: to.Ptr("https://192.168.50.4/"), - // NsxtManager: to.Ptr("https://192.168.50.3/"), - // Vcsa: to.Ptr("https://192.168.50.2/"), - // }, - // ExternalCloudLinks: []*string{ - // to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2")}, - // NetworkBlock: to.Ptr("192.168.48.0/22"), - // ProvisioningState: to.Ptr(armavs.PrivateCloudProvisioningStateSucceeded), - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV36"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_List_Stretched.json -func ExamplePrivateCloudsClient_NewListPager_privateCloudsListStretched() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateCloudsClient().NewListPager("group1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateCloudList = armavs.PrivateCloudList{ - // Value: []*armavs.PrivateCloud{ - // { - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1"), - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // }, - // Properties: &armavs.PrivateCloudProperties{ - // Availability: &armavs.AvailabilityProperties{ - // SecondaryZone: to.Ptr[int32](2), - // Strategy: to.Ptr(armavs.AvailabilityStrategyDualZone), - // Zone: to.Ptr[int32](1), - // }, - // IdentitySources: []*armavs.IdentitySource{ - // { - // Name: to.Ptr("group1"), - // Alias: to.Ptr("groupAlias"), - // BaseGroupDN: to.Ptr("ou=baseGroup"), - // BaseUserDN: to.Ptr("ou=baseUser"), - // Domain: to.Ptr("domain1"), - // PrimaryServer: to.Ptr("ldaps://1.1.1.1:636/"), - // SecondaryServer: to.Ptr("ldaps://1.1.1.2:636/"), - // SSL: to.Ptr(armavs.SSLEnumEnabled), - // }}, - // Internet: to.Ptr(armavs.InternetEnumDisabled), - // ManagementCluster: &armavs.ManagementCluster{ - // ClusterID: to.Ptr[int32](1), - // ClusterSize: to.Ptr[int32](4), - // Hosts: []*string{ - // to.Ptr("fakehost18.nyc1.kubernetes.center"), - // to.Ptr("fakehost19.nyc1.kubernetes.center"), - // to.Ptr("fakehost20.nyc1.kubernetes.center"), - // to.Ptr("fakehost21.nyc1.kubernetes.center")}, - // }, - // Circuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // ExpressRoutePrivatePeeringID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // Endpoints: &armavs.Endpoints{ - // HcxCloudManager: to.Ptr("https://192.168.50.4/"), - // NsxtManager: to.Ptr("https://192.168.50.3/"), - // Vcsa: to.Ptr("https://192.168.50.2/"), - // }, - // ExternalCloudLinks: []*string{ - // to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2")}, - // NetworkBlock: to.Ptr("192.168.48.0/22"), - // ProvisioningState: to.Ptr(armavs.PrivateCloudProvisioningStateSucceeded), - // SecondaryCircuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect2"), - // ExpressRoutePrivatePeeringID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er2/peerings/AzurePrivatePeering"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV36"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_ListInSubscription.json -func ExamplePrivateCloudsClient_NewListInSubscriptionPager_privateCloudsListInSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateCloudsClient().NewListInSubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateCloudList = armavs.PrivateCloudList{ - // Value: []*armavs.PrivateCloud{ - // { - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1"), - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // }, - // Properties: &armavs.PrivateCloudProperties{ - // Availability: &armavs.AvailabilityProperties{ - // Strategy: to.Ptr(armavs.AvailabilityStrategySingleZone), - // Zone: to.Ptr[int32](1), - // }, - // IdentitySources: []*armavs.IdentitySource{ - // { - // Name: to.Ptr("group1"), - // Alias: to.Ptr("groupAlias"), - // BaseGroupDN: to.Ptr("ou=baseGroup"), - // BaseUserDN: to.Ptr("ou=baseUser"), - // Domain: to.Ptr("domain1"), - // PrimaryServer: to.Ptr("ldaps://1.1.1.1:636/"), - // SecondaryServer: to.Ptr("ldaps://1.1.1.2:636/"), - // SSL: to.Ptr(armavs.SSLEnumEnabled), - // }}, - // Internet: to.Ptr(armavs.InternetEnumDisabled), - // ManagementCluster: &armavs.ManagementCluster{ - // ClusterID: to.Ptr[int32](1), - // ClusterSize: to.Ptr[int32](4), - // Hosts: []*string{ - // to.Ptr("fakehost18.nyc1.kubernetes.center"), - // to.Ptr("fakehost19.nyc1.kubernetes.center"), - // to.Ptr("fakehost20.nyc1.kubernetes.center"), - // to.Ptr("fakehost21.nyc1.kubernetes.center")}, - // }, - // Circuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // ExpressRoutePrivatePeeringID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // Endpoints: &armavs.Endpoints{ - // HcxCloudManager: to.Ptr("https://192.168.50.4/"), - // NsxtManager: to.Ptr("https://192.168.50.3/"), - // Vcsa: to.Ptr("https://192.168.50.2/"), - // }, - // NetworkBlock: to.Ptr("192.168.48.0/22"), - // ProvisioningState: to.Ptr(armavs.PrivateCloudProvisioningStateSucceeded), - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV36"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_ListInSubscription_Stretched.json -func ExamplePrivateCloudsClient_NewListInSubscriptionPager_privateCloudsListInSubscriptionStretched() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateCloudsClient().NewListInSubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateCloudList = armavs.PrivateCloudList{ - // Value: []*armavs.PrivateCloud{ - // { - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1"), - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // }, - // Properties: &armavs.PrivateCloudProperties{ - // Availability: &armavs.AvailabilityProperties{ - // SecondaryZone: to.Ptr[int32](2), - // Strategy: to.Ptr(armavs.AvailabilityStrategyDualZone), - // Zone: to.Ptr[int32](1), - // }, - // IdentitySources: []*armavs.IdentitySource{ - // { - // Name: to.Ptr("group1"), - // Alias: to.Ptr("groupAlias"), - // BaseGroupDN: to.Ptr("ou=baseGroup"), - // BaseUserDN: to.Ptr("ou=baseUser"), - // Domain: to.Ptr("domain1"), - // PrimaryServer: to.Ptr("ldaps://1.1.1.1:636/"), - // SecondaryServer: to.Ptr("ldaps://1.1.1.2:636/"), - // SSL: to.Ptr(armavs.SSLEnumEnabled), - // }}, - // Internet: to.Ptr(armavs.InternetEnumDisabled), - // ManagementCluster: &armavs.ManagementCluster{ - // ClusterID: to.Ptr[int32](1), - // ClusterSize: to.Ptr[int32](4), - // Hosts: []*string{ - // to.Ptr("fakehost18.nyc1.kubernetes.center"), - // to.Ptr("fakehost19.nyc1.kubernetes.center"), - // to.Ptr("fakehost20.nyc1.kubernetes.center"), - // to.Ptr("fakehost21.nyc1.kubernetes.center")}, - // }, - // Circuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // ExpressRoutePrivatePeeringID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // Endpoints: &armavs.Endpoints{ - // HcxCloudManager: to.Ptr("https://192.168.50.4/"), - // NsxtManager: to.Ptr("https://192.168.50.3/"), - // Vcsa: to.Ptr("https://192.168.50.2/"), - // }, - // NetworkBlock: to.Ptr("192.168.48.0/22"), - // ProvisioningState: to.Ptr(armavs.PrivateCloudProvisioningStateSucceeded), - // SecondaryCircuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect2"), - // ExpressRoutePrivatePeeringID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er2/peerings/AzurePrivatePeering"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV36"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Get.json -func ExamplePrivateCloudsClient_Get_privateCloudsGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateCloudsClient().Get(ctx, "group1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateCloud = armavs.PrivateCloud{ - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1"), - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // }, - // Identity: &armavs.PrivateCloudIdentity{ - // Type: to.Ptr(armavs.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("881e5573-063f-49e4-8c08-79d7df0169d8"), - // TenantID: to.Ptr("881e5573-063f-49e4-8c08-79d7df0169d8"), - // }, - // Properties: &armavs.PrivateCloudProperties{ - // Availability: &armavs.AvailabilityProperties{ - // Strategy: to.Ptr(armavs.AvailabilityStrategySingleZone), - // Zone: to.Ptr[int32](1), - // }, - // Encryption: &armavs.Encryption{ - // KeyVaultProperties: &armavs.EncryptionKeyVaultProperties{ - // KeyName: to.Ptr("keyname1"), - // KeyState: to.Ptr(armavs.EncryptionKeyStatusConnected), - // KeyVaultURL: to.Ptr("https://keyvault1-kmip-kvault.vault.azure.net/"), - // KeyVersion: to.Ptr("ver1.0"), - // VersionType: to.Ptr(armavs.EncryptionVersionTypeFixed), - // }, - // Status: to.Ptr(armavs.EncryptionStateEnabled), - // }, - // IdentitySources: []*armavs.IdentitySource{ - // { - // Name: to.Ptr("group1"), - // Alias: to.Ptr("groupAlias"), - // BaseGroupDN: to.Ptr("ou=baseGroup"), - // BaseUserDN: to.Ptr("ou=baseUser"), - // Domain: to.Ptr("domain1"), - // PrimaryServer: to.Ptr("ldaps://1.1.1.1:636/"), - // SecondaryServer: to.Ptr("ldaps://1.1.1.2:636/"), - // SSL: to.Ptr(armavs.SSLEnumEnabled), - // }}, - // Internet: to.Ptr(armavs.InternetEnumDisabled), - // ManagementCluster: &armavs.ManagementCluster{ - // ClusterID: to.Ptr[int32](1), - // ClusterSize: to.Ptr[int32](4), - // Hosts: []*string{ - // to.Ptr("fakehost18.nyc1.kubernetes.center"), - // to.Ptr("fakehost19.nyc1.kubernetes.center"), - // to.Ptr("fakehost20.nyc1.kubernetes.center"), - // to.Ptr("fakehost21.nyc1.kubernetes.center")}, - // }, - // Circuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // ExpressRoutePrivatePeeringID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // Endpoints: &armavs.Endpoints{ - // HcxCloudManager: to.Ptr("https://192.168.50.4/"), - // NsxtManager: to.Ptr("https://192.168.50.3/"), - // Vcsa: to.Ptr("https://192.168.50.2/"), - // }, - // ExternalCloudLinks: []*string{ - // to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2")}, - // NetworkBlock: to.Ptr("192.168.48.0/22"), - // ProvisioningState: to.Ptr(armavs.PrivateCloudProvisioningStateSucceeded), - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV36"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Get_Stretched.json -func ExamplePrivateCloudsClient_Get_privateCloudsGetStretched() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateCloudsClient().Get(ctx, "group1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateCloud = armavs.PrivateCloud{ - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1"), - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // }, - // Properties: &armavs.PrivateCloudProperties{ - // Availability: &armavs.AvailabilityProperties{ - // SecondaryZone: to.Ptr[int32](2), - // Strategy: to.Ptr(armavs.AvailabilityStrategyDualZone), - // Zone: to.Ptr[int32](1), - // }, - // IdentitySources: []*armavs.IdentitySource{ - // { - // Name: to.Ptr("group1"), - // Alias: to.Ptr("groupAlias"), - // BaseGroupDN: to.Ptr("ou=baseGroup"), - // BaseUserDN: to.Ptr("ou=baseUser"), - // Domain: to.Ptr("domain1"), - // PrimaryServer: to.Ptr("ldaps://1.1.1.1:636/"), - // SecondaryServer: to.Ptr("ldaps://1.1.1.2:636/"), - // SSL: to.Ptr(armavs.SSLEnumEnabled), - // }}, - // Internet: to.Ptr(armavs.InternetEnumDisabled), - // ManagementCluster: &armavs.ManagementCluster{ - // ClusterID: to.Ptr[int32](1), - // ClusterSize: to.Ptr[int32](4), - // Hosts: []*string{ - // to.Ptr("fakehost18.nyc1.kubernetes.center"), - // to.Ptr("fakehost19.nyc1.kubernetes.center"), - // to.Ptr("fakehost20.nyc1.kubernetes.center"), - // to.Ptr("fakehost21.nyc1.kubernetes.center")}, - // }, - // Circuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // ExpressRoutePrivatePeeringID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // Endpoints: &armavs.Endpoints{ - // HcxCloudManager: to.Ptr("https://192.168.50.4/"), - // NsxtManager: to.Ptr("https://192.168.50.3/"), - // Vcsa: to.Ptr("https://192.168.50.2/"), - // }, - // ExternalCloudLinks: []*string{ - // to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2")}, - // NetworkBlock: to.Ptr("192.168.48.0/22"), - // ProvisioningState: to.Ptr(armavs.PrivateCloudProvisioningStateSucceeded), - // SecondaryCircuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // ExpressRoutePrivatePeeringID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er2/peerings/AzurePrivatePeering"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV36"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_CreateOrUpdate.json -func ExamplePrivateCloudsClient_BeginCreateOrUpdate_privateCloudsCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateCloudsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", armavs.PrivateCloud{ - Location: to.Ptr("eastus2"), - Tags: map[string]*string{}, - Identity: &armavs.PrivateCloudIdentity{ - Type: to.Ptr(armavs.ResourceIdentityTypeSystemAssigned), - }, - Properties: &armavs.PrivateCloudProperties{ - ManagementCluster: &armavs.ManagementCluster{ - ClusterSize: to.Ptr[int32](4), - }, - NetworkBlock: to.Ptr("192.168.48.0/22"), - }, - SKU: &armavs.SKU{ - Name: to.Ptr("AV36"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateCloud = armavs.PrivateCloud{ - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1"), - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // }, - // Properties: &armavs.PrivateCloudProperties{ - // Availability: &armavs.AvailabilityProperties{ - // Strategy: to.Ptr(armavs.AvailabilityStrategySingleZone), - // Zone: to.Ptr[int32](1), - // }, - // IdentitySources: []*armavs.IdentitySource{ - // { - // Name: to.Ptr("group1"), - // Alias: to.Ptr("groupAlias"), - // BaseGroupDN: to.Ptr("ou=baseGroup"), - // BaseUserDN: to.Ptr("ou=baseUser"), - // Domain: to.Ptr("domain1"), - // PrimaryServer: to.Ptr("ldaps://1.1.1.1:636/"), - // SecondaryServer: to.Ptr("ldaps://1.1.1.2:636/"), - // SSL: to.Ptr(armavs.SSLEnumEnabled), - // }}, - // Internet: to.Ptr(armavs.InternetEnumDisabled), - // ManagementCluster: &armavs.ManagementCluster{ - // ClusterID: to.Ptr[int32](1), - // ClusterSize: to.Ptr[int32](4), - // Hosts: []*string{ - // to.Ptr("fakehost18.nyc1.kubernetes.center"), - // to.Ptr("fakehost19.nyc1.kubernetes.center"), - // to.Ptr("fakehost20.nyc1.kubernetes.center"), - // to.Ptr("fakehost21.nyc1.kubernetes.center")}, - // }, - // Circuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // Endpoints: &armavs.Endpoints{ - // NsxtManager: to.Ptr("https://192.168.50.3/"), - // Vcsa: to.Ptr("https://192.168.50.2/"), - // }, - // ExternalCloudLinks: []*string{ - // to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2")}, - // NetworkBlock: to.Ptr("192.168.48.0/22"), - // ProvisioningState: to.Ptr(armavs.PrivateCloudProvisioningStateSucceeded), - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV36"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_CreateOrUpdate_Stretched.json -func ExamplePrivateCloudsClient_BeginCreateOrUpdate_privateCloudsCreateOrUpdateStretched() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateCloudsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", armavs.PrivateCloud{ - Location: to.Ptr("eastus2"), - Tags: map[string]*string{}, - Properties: &armavs.PrivateCloudProperties{ - Availability: &armavs.AvailabilityProperties{ - SecondaryZone: to.Ptr[int32](2), - Strategy: to.Ptr(armavs.AvailabilityStrategyDualZone), - Zone: to.Ptr[int32](1), - }, - ManagementCluster: &armavs.ManagementCluster{ - ClusterSize: to.Ptr[int32](4), - }, - NetworkBlock: to.Ptr("192.168.48.0/22"), - }, - SKU: &armavs.SKU{ - Name: to.Ptr("AV36"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateCloud = armavs.PrivateCloud{ - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1"), - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // }, - // Properties: &armavs.PrivateCloudProperties{ - // Availability: &armavs.AvailabilityProperties{ - // SecondaryZone: to.Ptr[int32](2), - // Strategy: to.Ptr(armavs.AvailabilityStrategyDualZone), - // Zone: to.Ptr[int32](1), - // }, - // IdentitySources: []*armavs.IdentitySource{ - // { - // Name: to.Ptr("group1"), - // Alias: to.Ptr("groupAlias"), - // BaseGroupDN: to.Ptr("ou=baseGroup"), - // BaseUserDN: to.Ptr("ou=baseUser"), - // Domain: to.Ptr("domain1"), - // PrimaryServer: to.Ptr("ldaps://1.1.1.1:636/"), - // SecondaryServer: to.Ptr("ldaps://1.1.1.2:636/"), - // SSL: to.Ptr(armavs.SSLEnumEnabled), - // }}, - // Internet: to.Ptr(armavs.InternetEnumDisabled), - // ManagementCluster: &armavs.ManagementCluster{ - // ClusterID: to.Ptr[int32](1), - // ClusterSize: to.Ptr[int32](4), - // Hosts: []*string{ - // to.Ptr("fakehost18.nyc1.kubernetes.center"), - // to.Ptr("fakehost19.nyc1.kubernetes.center"), - // to.Ptr("fakehost20.nyc1.kubernetes.center"), - // to.Ptr("fakehost21.nyc1.kubernetes.center")}, - // }, - // Circuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // Endpoints: &armavs.Endpoints{ - // NsxtManager: to.Ptr("https://192.168.50.3/"), - // Vcsa: to.Ptr("https://192.168.50.2/"), - // }, - // ExternalCloudLinks: []*string{ - // to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2")}, - // NetworkBlock: to.Ptr("192.168.48.0/22"), - // ProvisioningState: to.Ptr(armavs.PrivateCloudProvisioningStateSucceeded), - // SecondaryCircuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect2"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV36"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Update.json -func ExamplePrivateCloudsClient_BeginUpdate_privateCloudsUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateCloudsClient().BeginUpdate(ctx, "group1", "cloud1", armavs.PrivateCloudUpdate{ - Identity: &armavs.PrivateCloudIdentity{ - Type: to.Ptr(armavs.ResourceIdentityTypeNone), - }, - Properties: &armavs.PrivateCloudUpdateProperties{ - Encryption: &armavs.Encryption{ - KeyVaultProperties: &armavs.EncryptionKeyVaultProperties{ - KeyName: to.Ptr("keyname1"), - KeyVaultURL: to.Ptr("https://keyvault1-kmip-kvault.vault.azure.net/"), - KeyVersion: to.Ptr("ver1.0"), - }, - Status: to.Ptr(armavs.EncryptionStateEnabled), - }, - ManagementCluster: &armavs.ManagementCluster{ - ClusterSize: to.Ptr[int32](4), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateCloud = armavs.PrivateCloud{ - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1"), - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // }, - // Properties: &armavs.PrivateCloudProperties{ - // Availability: &armavs.AvailabilityProperties{ - // Strategy: to.Ptr(armavs.AvailabilityStrategySingleZone), - // Zone: to.Ptr[int32](1), - // }, - // Encryption: &armavs.Encryption{ - // KeyVaultProperties: &armavs.EncryptionKeyVaultProperties{ - // KeyName: to.Ptr("keyname1"), - // KeyVaultURL: to.Ptr("https://keyvault1-kmip-kvault.vault.azure.net/"), - // KeyVersion: to.Ptr("ver1.0"), - // VersionType: to.Ptr(armavs.EncryptionVersionTypeFixed), - // }, - // Status: to.Ptr(armavs.EncryptionStateEnabled), - // }, - // IdentitySources: []*armavs.IdentitySource{ - // { - // Name: to.Ptr("group1"), - // Alias: to.Ptr("groupAlias"), - // BaseGroupDN: to.Ptr("ou=baseGroup"), - // BaseUserDN: to.Ptr("ou=baseUser"), - // Domain: to.Ptr("domain1"), - // PrimaryServer: to.Ptr("ldaps://1.1.1.1:636/"), - // SecondaryServer: to.Ptr("ldaps://1.1.1.2:636/"), - // SSL: to.Ptr(armavs.SSLEnumEnabled), - // }}, - // Internet: to.Ptr(armavs.InternetEnumDisabled), - // ManagementCluster: &armavs.ManagementCluster{ - // ClusterID: to.Ptr[int32](1), - // ClusterSize: to.Ptr[int32](4), - // Hosts: []*string{ - // to.Ptr("fakehost18.nyc1.kubernetes.center"), - // to.Ptr("fakehost19.nyc1.kubernetes.center"), - // to.Ptr("fakehost20.nyc1.kubernetes.center"), - // to.Ptr("fakehost21.nyc1.kubernetes.center")}, - // }, - // Circuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // ExpressRoutePrivatePeeringID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // Endpoints: &armavs.Endpoints{ - // HcxCloudManager: to.Ptr("https://192.168.50.4/"), - // NsxtManager: to.Ptr("https://192.168.50.3/"), - // Vcsa: to.Ptr("https://192.168.50.2/"), - // }, - // ExternalCloudLinks: []*string{ - // to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2")}, - // NetworkBlock: to.Ptr("192.168.48.0/22"), - // ProvisioningState: to.Ptr(armavs.PrivateCloudProvisioningStateSucceeded), - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV36"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Update_Stretched.json -func ExamplePrivateCloudsClient_BeginUpdate_privateCloudsUpdateStretched() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateCloudsClient().BeginUpdate(ctx, "group1", "cloud1", armavs.PrivateCloudUpdate{ - Properties: &armavs.PrivateCloudUpdateProperties{ - ManagementCluster: &armavs.ManagementCluster{ - ClusterSize: to.Ptr[int32](4), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateCloud = armavs.PrivateCloud{ - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1"), - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // }, - // Properties: &armavs.PrivateCloudProperties{ - // Availability: &armavs.AvailabilityProperties{ - // SecondaryZone: to.Ptr[int32](2), - // Strategy: to.Ptr(armavs.AvailabilityStrategyDualZone), - // Zone: to.Ptr[int32](1), - // }, - // IdentitySources: []*armavs.IdentitySource{ - // { - // Name: to.Ptr("group1"), - // Alias: to.Ptr("groupAlias"), - // BaseGroupDN: to.Ptr("ou=baseGroup"), - // BaseUserDN: to.Ptr("ou=baseUser"), - // Domain: to.Ptr("domain1"), - // PrimaryServer: to.Ptr("ldaps://1.1.1.1:636/"), - // SecondaryServer: to.Ptr("ldaps://1.1.1.2:636/"), - // SSL: to.Ptr(armavs.SSLEnumEnabled), - // }}, - // Internet: to.Ptr(armavs.InternetEnumDisabled), - // ManagementCluster: &armavs.ManagementCluster{ - // ClusterID: to.Ptr[int32](1), - // ClusterSize: to.Ptr[int32](4), - // Hosts: []*string{ - // to.Ptr("fakehost18.nyc1.kubernetes.center"), - // to.Ptr("fakehost19.nyc1.kubernetes.center"), - // to.Ptr("fakehost20.nyc1.kubernetes.center"), - // to.Ptr("fakehost21.nyc1.kubernetes.center")}, - // }, - // Circuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect"), - // ExpressRoutePrivatePeeringID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // Endpoints: &armavs.Endpoints{ - // HcxCloudManager: to.Ptr("https://192.168.50.4/"), - // NsxtManager: to.Ptr("https://192.168.50.3/"), - // Vcsa: to.Ptr("https://192.168.50.2/"), - // }, - // ExternalCloudLinks: []*string{ - // to.Ptr("/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2")}, - // NetworkBlock: to.Ptr("192.168.48.0/22"), - // ProvisioningState: to.Ptr(armavs.PrivateCloudProvisioningStateSucceeded), - // SecondaryCircuit: &armavs.Circuit{ - // ExpressRouteID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect2"), - // ExpressRoutePrivatePeeringID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er2/peerings/AzurePrivatePeering"), - // PrimarySubnet: to.Ptr("192.168.53.0/30"), - // SecondarySubnet: to.Ptr("192.168.53.4/30"), - // }, - // }, - // SKU: &armavs.SKU{ - // Name: to.Ptr("AV36"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_Delete.json -func ExamplePrivateCloudsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateCloudsClient().BeginDelete(ctx, "group1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_RotateVcenterPassword.json -func ExamplePrivateCloudsClient_BeginRotateVcenterPassword() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateCloudsClient().BeginRotateVcenterPassword(ctx, "group1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_RotateNsxtPassword.json -func ExamplePrivateCloudsClient_BeginRotateNsxtPassword() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateCloudsClient().BeginRotateNsxtPassword(ctx, "group1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/PrivateClouds_ListAdminCredentials.json -func ExamplePrivateCloudsClient_ListAdminCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateCloudsClient().ListAdminCredentials(ctx, "group1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdminCredentials = armavs.AdminCredentials{ - // NsxtPassword: to.Ptr("$(1X4Dkk"), - // NsxtUsername: to.Ptr("admin"), - // VcenterPassword: to.Ptr(""), - // VcenterUsername: to.Ptr("cloudadmin@vsphere.local"), - // } -} diff --git a/sdk/resourcemanager/avs/armavs/response_types.go b/sdk/resourcemanager/avs/armavs/responses.go similarity index 87% rename from sdk/resourcemanager/avs/armavs/response_types.go rename to sdk/resourcemanager/avs/armavs/responses.go index 94c433780988..13966c74f383 100644 --- a/sdk/resourcemanager/avs/armavs/response_types.go +++ b/sdk/resourcemanager/avs/armavs/responses.go @@ -27,8 +27,8 @@ type AddonsClientGetResponse struct { // AddonsClientListResponse contains the response from method AddonsClient.NewListPager. type AddonsClientListResponse struct { - // A paged list of addons - AddonList + // The response of a Addon list operation. + AddonListResult } // AuthorizationsClientCreateOrUpdateResponse contains the response from method AuthorizationsClient.BeginCreateOrUpdate. @@ -50,8 +50,8 @@ type AuthorizationsClientGetResponse struct { // AuthorizationsClientListResponse contains the response from method AuthorizationsClient.NewListPager. type AuthorizationsClientListResponse struct { - // A paged list of ExpressRoute Circuit Authorizations - ExpressRouteAuthorizationList + // The response of a ExpressRouteAuthorization list operation. + ExpressRouteAuthorizationListResult } // CloudLinksClientCreateOrUpdateResponse contains the response from method CloudLinksClient.BeginCreateOrUpdate. @@ -73,8 +73,8 @@ type CloudLinksClientGetResponse struct { // CloudLinksClientListResponse contains the response from method CloudLinksClient.NewListPager. type CloudLinksClientListResponse struct { - // A paged list of cloud links - CloudLinkList + // The response of a CloudLink list operation. + CloudLinkListResult } // ClustersClientCreateOrUpdateResponse contains the response from method ClustersClient.BeginCreateOrUpdate. @@ -96,8 +96,8 @@ type ClustersClientGetResponse struct { // ClustersClientListResponse contains the response from method ClustersClient.NewListPager. type ClustersClientListResponse struct { - // A paged list of clusters - ClusterList + // The response of a Cluster list operation. + ClusterListResult } // ClustersClientListZonesResponse contains the response from method ClustersClient.ListZones. @@ -131,8 +131,8 @@ type DatastoresClientGetResponse struct { // DatastoresClientListResponse contains the response from method DatastoresClient.NewListPager. type DatastoresClientListResponse struct { - // A paged list of datastores - DatastoreList + // The response of a Datastore list operation. + DatastoreListResult } // GlobalReachConnectionsClientCreateOrUpdateResponse contains the response from method GlobalReachConnectionsClient.BeginCreateOrUpdate. @@ -154,8 +154,8 @@ type GlobalReachConnectionsClientGetResponse struct { // GlobalReachConnectionsClientListResponse contains the response from method GlobalReachConnectionsClient.NewListPager. type GlobalReachConnectionsClientListResponse struct { - // A paged list of global reach connections - GlobalReachConnectionList + // The response of a GlobalReachConnection list operation. + GlobalReachConnectionListResult } // HcxEnterpriseSitesClientCreateOrUpdateResponse contains the response from method HcxEnterpriseSitesClient.CreateOrUpdate. @@ -177,8 +177,31 @@ type HcxEnterpriseSitesClientGetResponse struct { // HcxEnterpriseSitesClientListResponse contains the response from method HcxEnterpriseSitesClient.NewListPager. type HcxEnterpriseSitesClientListResponse struct { - // A paged list of HCX Enterprise Sites - HcxEnterpriseSiteList + // The response of a HcxEnterpriseSite list operation. + HcxEnterpriseSiteListResult +} + +// IscsiPathsClientCreateOrUpdateResponse contains the response from method IscsiPathsClient.BeginCreateOrUpdate. +type IscsiPathsClientCreateOrUpdateResponse struct { + // An iSCSI path resource + IscsiPath +} + +// IscsiPathsClientDeleteResponse contains the response from method IscsiPathsClient.BeginDelete. +type IscsiPathsClientDeleteResponse struct { + // placeholder for future response values +} + +// IscsiPathsClientGetResponse contains the response from method IscsiPathsClient.Get. +type IscsiPathsClientGetResponse struct { + // An iSCSI path resource + IscsiPath +} + +// IscsiPathsClientListByPrivateCloudResponse contains the response from method IscsiPathsClient.NewListByPrivateCloudPager. +type IscsiPathsClientListByPrivateCloudResponse struct { + // The response of a IscsiPath list operation. + IscsiPathListResult } // LocationsClientCheckQuotaAvailabilityResponse contains the response from method LocationsClient.CheckQuotaAvailability. @@ -195,8 +218,8 @@ type LocationsClientCheckTrialAvailabilityResponse struct { // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { - // Pageable list of operations - OperationList + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + OperationListResult } // PlacementPoliciesClientCreateOrUpdateResponse contains the response from method PlacementPoliciesClient.BeginCreateOrUpdate. @@ -218,8 +241,8 @@ type PlacementPoliciesClientGetResponse struct { // PlacementPoliciesClientListResponse contains the response from method PlacementPoliciesClient.NewListPager. type PlacementPoliciesClientListResponse struct { - // Represents list of placement policies - PlacementPoliciesList + // The response of a PlacementPolicy list operation. + PlacementPolicyListResult } // PlacementPoliciesClientUpdateResponse contains the response from method PlacementPoliciesClient.BeginUpdate. @@ -253,14 +276,14 @@ type PrivateCloudsClientListAdminCredentialsResponse struct { // PrivateCloudsClientListInSubscriptionResponse contains the response from method PrivateCloudsClient.NewListInSubscriptionPager. type PrivateCloudsClientListInSubscriptionResponse struct { - // A paged list of private clouds - PrivateCloudList + // The response of a PrivateCloud list operation. + PrivateCloudListResult } // PrivateCloudsClientListResponse contains the response from method PrivateCloudsClient.NewListPager. type PrivateCloudsClientListResponse struct { - // A paged list of private clouds - PrivateCloudList + // The response of a PrivateCloud list operation. + PrivateCloudListResult } // PrivateCloudsClientRotateNsxtPasswordResponse contains the response from method PrivateCloudsClient.BeginRotateNsxtPassword. @@ -287,8 +310,8 @@ type ScriptCmdletsClientGetResponse struct { // ScriptCmdletsClientListResponse contains the response from method ScriptCmdletsClient.NewListPager. type ScriptCmdletsClientListResponse struct { - // Pageable list of scripts/cmdlets - ScriptCmdletsList + // The response of a ScriptCmdlet list operation. + ScriptCmdletListResult } // ScriptExecutionsClientCreateOrUpdateResponse contains the response from method ScriptExecutionsClient.BeginCreateOrUpdate. @@ -316,8 +339,8 @@ type ScriptExecutionsClientGetResponse struct { // ScriptExecutionsClientListResponse contains the response from method ScriptExecutionsClient.NewListPager. type ScriptExecutionsClientListResponse struct { - // Pageable list of script executions - ScriptExecutionsList + // The response of a ScriptExecution list operation. + ScriptExecutionListResult } // ScriptPackagesClientGetResponse contains the response from method ScriptPackagesClient.Get. @@ -328,8 +351,8 @@ type ScriptPackagesClientGetResponse struct { // ScriptPackagesClientListResponse contains the response from method ScriptPackagesClient.NewListPager. type ScriptPackagesClientListResponse struct { - // A list of the available script packages - ScriptPackagesList + // The response of a ScriptPackage list operation. + ScriptPackageListResult } // VirtualMachinesClientGetResponse contains the response from method VirtualMachinesClient.Get. @@ -340,8 +363,8 @@ type VirtualMachinesClientGetResponse struct { // VirtualMachinesClientListResponse contains the response from method VirtualMachinesClient.NewListPager. type VirtualMachinesClientListResponse struct { - // A list of Virtual Machines - VirtualMachinesList + // The response of a VirtualMachine list operation. + VirtualMachineListResult } // VirtualMachinesClientRestrictMovementResponse contains the response from method VirtualMachinesClient.BeginRestrictMovement. @@ -488,62 +511,62 @@ type WorkloadNetworksClientGetVirtualMachineResponse struct { // WorkloadNetworksClientListDNSServicesResponse contains the response from method WorkloadNetworksClient.NewListDNSServicesPager. type WorkloadNetworksClientListDNSServicesResponse struct { - // A list of NSX DNS Services - WorkloadNetworkDNSServicesList + // The response of a WorkloadNetworkDnsService list operation. + WorkloadNetworkDNSServiceListResult } // WorkloadNetworksClientListDNSZonesResponse contains the response from method WorkloadNetworksClient.NewListDNSZonesPager. type WorkloadNetworksClientListDNSZonesResponse struct { - // A list of NSX DNS Zones - WorkloadNetworkDNSZonesList + // The response of a WorkloadNetworkDnsZone list operation. + WorkloadNetworkDNSZoneListResult } // WorkloadNetworksClientListDhcpResponse contains the response from method WorkloadNetworksClient.NewListDhcpPager. type WorkloadNetworksClientListDhcpResponse struct { - // A list of NSX dhcp entities - WorkloadNetworkDhcpList + // The response of a WorkloadNetworkDhcp list operation. + WorkloadNetworkDhcpListResult } // WorkloadNetworksClientListGatewaysResponse contains the response from method WorkloadNetworksClient.NewListGatewaysPager. type WorkloadNetworksClientListGatewaysResponse struct { - // A list of NSX Gateways - WorkloadNetworkGatewayList + // The response of a WorkloadNetworkGateway list operation. + WorkloadNetworkGatewayListResult } // WorkloadNetworksClientListPortMirroringResponse contains the response from method WorkloadNetworksClient.NewListPortMirroringPager. type WorkloadNetworksClientListPortMirroringResponse struct { - // A list of NSX Port Mirroring - WorkloadNetworkPortMirroringList + // The response of a WorkloadNetworkPortMirroring list operation. + WorkloadNetworkPortMirroringListResult } // WorkloadNetworksClientListPublicIPsResponse contains the response from method WorkloadNetworksClient.NewListPublicIPsPager. type WorkloadNetworksClientListPublicIPsResponse struct { - // A list of NSX Public IP Blocks - WorkloadNetworkPublicIPsList + // The response of a WorkloadNetworkPublicIP list operation. + WorkloadNetworkPublicIPListResult } // WorkloadNetworksClientListResponse contains the response from method WorkloadNetworksClient.NewListPager. type WorkloadNetworksClientListResponse struct { - // A list of workload networks - WorkloadNetworkList + // The response of a WorkloadNetwork list operation. + WorkloadNetworkListResult } // WorkloadNetworksClientListSegmentsResponse contains the response from method WorkloadNetworksClient.NewListSegmentsPager. type WorkloadNetworksClientListSegmentsResponse struct { - // A list of NSX Segments - WorkloadNetworkSegmentsList + // The response of a WorkloadNetworkSegment list operation. + WorkloadNetworkSegmentListResult } // WorkloadNetworksClientListVMGroupsResponse contains the response from method WorkloadNetworksClient.NewListVMGroupsPager. type WorkloadNetworksClientListVMGroupsResponse struct { - // A list of NSX VM Groups - WorkloadNetworkVMGroupsList + // The response of a WorkloadNetworkVMGroup list operation. + WorkloadNetworkVMGroupListResult } // WorkloadNetworksClientListVirtualMachinesResponse contains the response from method WorkloadNetworksClient.NewListVirtualMachinesPager. type WorkloadNetworksClientListVirtualMachinesResponse struct { - // A list of NSX Virtual Machines - WorkloadNetworkVirtualMachinesList + // The response of a WorkloadNetworkVirtualMachine list operation. + WorkloadNetworkVirtualMachineListResult } // WorkloadNetworksClientUpdateDNSServiceResponse contains the response from method WorkloadNetworksClient.BeginUpdateDNSService. diff --git a/sdk/resourcemanager/avs/armavs/scriptcmdlets_client.go b/sdk/resourcemanager/avs/armavs/scriptcmdlets_client.go index 7a2421aa5e5f..fc67ed01c6db 100644 --- a/sdk/resourcemanager/avs/armavs/scriptcmdlets_client.go +++ b/sdk/resourcemanager/avs/armavs/scriptcmdlets_client.go @@ -43,14 +43,14 @@ func NewScriptCmdletsClient(subscriptionID string, credential azcore.TokenCreden return client, nil } -// Get - Return information about a script cmdlet resource in a specific package on a private cloud +// Get - Get a ScriptCmdlet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - scriptPackageName - Name of the script package in the private cloud -// - scriptCmdletName - Name of the script cmdlet resource in the script package in the private cloud +// - scriptPackageName - Name of the script package. +// - scriptCmdletName - Name of the script cmdlet. // - options - ScriptCmdletsClientGetOptions contains the optional parameters for the ScriptCmdletsClient.Get method. func (client *ScriptCmdletsClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, scriptPackageName string, scriptCmdletName string, options *ScriptCmdletsClientGetOptions) (ScriptCmdletsClientGetResponse, error) { var err error @@ -102,7 +102,7 @@ func (client *ScriptCmdletsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,13 +117,12 @@ func (client *ScriptCmdletsClient) getHandleResponse(resp *http.Response) (Scrip return result, nil } -// NewListPager - List script cmdlet resources available for a private cloud to create a script execution resource on a private -// cloud +// NewListPager - List ScriptCmdlet resources by ScriptPackage // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - scriptPackageName - Name of the script package in the private cloud +// - scriptPackageName - Name of the script package. // - options - ScriptCmdletsClientListOptions contains the optional parameters for the ScriptCmdletsClient.NewListPager method. func (client *ScriptCmdletsClient) NewListPager(resourceGroupName string, privateCloudName string, scriptPackageName string, options *ScriptCmdletsClientListOptions) *runtime.Pager[ScriptCmdletsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ScriptCmdletsClientListResponse]{ @@ -172,7 +171,7 @@ func (client *ScriptCmdletsClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +180,7 @@ func (client *ScriptCmdletsClient) listCreateRequest(ctx context.Context, resour // listHandleResponse handles the List response. func (client *ScriptCmdletsClient) listHandleResponse(resp *http.Response) (ScriptCmdletsClientListResponse, error) { result := ScriptCmdletsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ScriptCmdletsList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.ScriptCmdletListResult); err != nil { return ScriptCmdletsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/avs/armavs/scriptcmdlets_client_example_test.go b/sdk/resourcemanager/avs/armavs/scriptcmdlets_client_example_test.go deleted file mode 100644 index 23ff2d8df686..000000000000 --- a/sdk/resourcemanager/avs/armavs/scriptcmdlets_client_example_test.go +++ /dev/null @@ -1,152 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptCmdlets_List.json -func ExampleScriptCmdletsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScriptCmdletsClient().NewListPager("group1", "cloud1", "package@1.0.2", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScriptCmdletsList = armavs.ScriptCmdletsList{ - // Value: []*armavs.ScriptCmdlet{ - // { - // Name: to.Ptr("Set-AvsStoragePolicy"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/scriptPackages/scriptCmdlets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptPackages/package@1.0.2/scriptCmdlets/Set-AvsStoragePolicy"), - // Properties: &armavs.ScriptCmdletProperties{ - // Description: to.Ptr("Allow user to set the storage policy of the specified VM"), - // Parameters: []*armavs.ScriptParameter{ - // { - // Name: to.Ptr("VM"), - // Type: to.Ptr(armavs.ScriptParameterTypesString), - // Description: to.Ptr("VM to set the storage policy on"), - // Optional: to.Ptr(armavs.OptionalParamEnumRequired), - // Visibility: to.Ptr(armavs.VisibilityParameterEnumVisible), - // }, - // { - // Name: to.Ptr("StoragePolicyName"), - // Type: to.Ptr(armavs.ScriptParameterTypesString), - // Description: to.Ptr("Name of the storage policy to set"), - // Optional: to.Ptr(armavs.OptionalParamEnumRequired), - // Visibility: to.Ptr(armavs.VisibilityParameterEnumVisible), - // }}, - // Timeout: to.Ptr("P0Y0M0DT0H60M0S"), - // }, - // }, - // { - // Name: to.Ptr("New-ExternalSsoDomain"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/scriptPackages/scriptCmdlets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptPackages/package@1.0.2/scriptCmdlets/New-ExternalSsoDomain"), - // Properties: &armavs.ScriptCmdletProperties{ - // Description: to.Ptr("Add an external Sso domain to their vCenter"), - // Parameters: []*armavs.ScriptParameter{ - // { - // Name: to.Ptr("DomainName"), - // Type: to.Ptr(armavs.ScriptParameterTypesString), - // Description: to.Ptr("Domain name of the Server"), - // Optional: to.Ptr(armavs.OptionalParamEnumRequired), - // Visibility: to.Ptr(armavs.VisibilityParameterEnumVisible), - // }, - // { - // Name: to.Ptr("BaseUserDN"), - // Type: to.Ptr(armavs.ScriptParameterTypesString), - // Description: to.Ptr("Base User DN of the Server"), - // Optional: to.Ptr(armavs.OptionalParamEnumRequired), - // Visibility: to.Ptr(armavs.VisibilityParameterEnumVisible), - // }, - // { - // Name: to.Ptr("Password"), - // Type: to.Ptr(armavs.ScriptParameterTypesSecureString), - // Description: to.Ptr("Password for authenticating to the server"), - // Optional: to.Ptr(armavs.OptionalParamEnumRequired), - // Visibility: to.Ptr(armavs.VisibilityParameterEnumHidden), - // }}, - // Timeout: to.Ptr("P0Y0M0DT0H60M0S"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptCmdlets_Get.json -func ExampleScriptCmdletsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScriptCmdletsClient().Get(ctx, "group1", "cloud1", "package@1.0.2", "New-ExternalSsoDomain", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScriptCmdlet = armavs.ScriptCmdlet{ - // Name: to.Ptr("New-ExternalSsoDomain"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/scriptPackages/scriptCmdlets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/package@1.0.2/scriptCmdlets/New-ExternalSsoDomain"), - // Properties: &armavs.ScriptCmdletProperties{ - // Description: to.Ptr("Add an external Sso domain to their vCenter"), - // Parameters: []*armavs.ScriptParameter{ - // { - // Name: to.Ptr("DomainName"), - // Type: to.Ptr(armavs.ScriptParameterTypesString), - // Description: to.Ptr("Domain name of the Server"), - // Optional: to.Ptr(armavs.OptionalParamEnumRequired), - // Visibility: to.Ptr(armavs.VisibilityParameterEnumVisible), - // }, - // { - // Name: to.Ptr("BaseUserDN"), - // Type: to.Ptr(armavs.ScriptParameterTypesString), - // Description: to.Ptr("Base User DN of the Server"), - // Optional: to.Ptr(armavs.OptionalParamEnumRequired), - // Visibility: to.Ptr(armavs.VisibilityParameterEnumVisible), - // }, - // { - // Name: to.Ptr("Password"), - // Type: to.Ptr(armavs.ScriptParameterTypesSecureString), - // Description: to.Ptr("Password for authenticating to the server"), - // Optional: to.Ptr(armavs.OptionalParamEnumRequired), - // Visibility: to.Ptr(armavs.VisibilityParameterEnumHidden), - // }}, - // Timeout: to.Ptr("P0Y0M0DT0H60M0S"), - // }, - // } -} diff --git a/sdk/resourcemanager/avs/armavs/scriptexecutions_client.go b/sdk/resourcemanager/avs/armavs/scriptexecutions_client.go index c0b4614bb547..0accdcfccfb9 100644 --- a/sdk/resourcemanager/avs/armavs/scriptexecutions_client.go +++ b/sdk/resourcemanager/avs/armavs/scriptexecutions_client.go @@ -43,14 +43,14 @@ func NewScriptExecutionsClient(subscriptionID string, credential azcore.TokenCre return client, nil } -// BeginCreateOrUpdate - Create or update a script execution in a private cloud +// BeginCreateOrUpdate - Create a ScriptExecution // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - privateCloudName - The name of the private cloud. -// - scriptExecutionName - Name of the user-invoked script execution resource -// - scriptExecution - A script running in the private cloud +// - privateCloudName - Name of the private cloud +// - scriptExecutionName - Name of the script cmdlet. +// - scriptExecution - Resource create parameters. // - options - ScriptExecutionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ScriptExecutionsClient.BeginCreateOrUpdate // method. func (client *ScriptExecutionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, scriptExecutionName string, scriptExecution ScriptExecution, options *ScriptExecutionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ScriptExecutionsClientCreateOrUpdateResponse], error) { @@ -60,7 +60,8 @@ func (client *ScriptExecutionsClient) BeginCreateOrUpdate(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ScriptExecutionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,10 +71,10 @@ func (client *ScriptExecutionsClient) BeginCreateOrUpdate(ctx context.Context, r } } -// CreateOrUpdate - Create or update a script execution in a private cloud +// CreateOrUpdate - Create a ScriptExecution // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *ScriptExecutionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, privateCloudName string, scriptExecutionName string, scriptExecution ScriptExecution, options *ScriptExecutionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ScriptExecutionsClient.BeginCreateOrUpdate" @@ -119,7 +120,7 @@ func (client *ScriptExecutionsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scriptExecution); err != nil { @@ -128,13 +129,13 @@ func (client *ScriptExecutionsClient) createOrUpdateCreateRequest(ctx context.Co return req, nil } -// BeginDelete - Cancel a ScriptExecution in a private cloud +// BeginDelete - Delete a ScriptExecution // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - scriptExecutionName - Name of the user-invoked script execution resource +// - scriptExecutionName - Name of the script cmdlet. // - options - ScriptExecutionsClientBeginDeleteOptions contains the optional parameters for the ScriptExecutionsClient.BeginDelete // method. func (client *ScriptExecutionsClient) BeginDelete(ctx context.Context, resourceGroupName string, privateCloudName string, scriptExecutionName string, options *ScriptExecutionsClientBeginDeleteOptions) (*runtime.Poller[ScriptExecutionsClientDeleteResponse], error) { @@ -144,7 +145,8 @@ func (client *ScriptExecutionsClient) BeginDelete(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ScriptExecutionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -154,10 +156,10 @@ func (client *ScriptExecutionsClient) BeginDelete(ctx context.Context, resourceG } } -// Delete - Cancel a ScriptExecution in a private cloud +// Delete - Delete a ScriptExecution // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *ScriptExecutionsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateCloudName string, scriptExecutionName string, options *ScriptExecutionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ScriptExecutionsClient.BeginDelete" @@ -203,19 +205,19 @@ func (client *ScriptExecutionsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get an script execution by name in a private cloud +// Get - Get a ScriptExecution // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - scriptExecutionName - Name of the user-invoked script execution resource +// - scriptExecutionName - Name of the script cmdlet. // - options - ScriptExecutionsClientGetOptions contains the optional parameters for the ScriptExecutionsClient.Get method. func (client *ScriptExecutionsClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, scriptExecutionName string, options *ScriptExecutionsClientGetOptions) (ScriptExecutionsClientGetResponse, error) { var err error @@ -263,7 +265,7 @@ func (client *ScriptExecutionsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,10 +283,10 @@ func (client *ScriptExecutionsClient) getHandleResponse(resp *http.Response) (Sc // GetExecutionLogs - Return the logs for a script execution resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - scriptExecutionName - Name of the user-invoked script execution resource +// - scriptExecutionName - Name of the script cmdlet. // - options - ScriptExecutionsClientGetExecutionLogsOptions contains the optional parameters for the ScriptExecutionsClient.GetExecutionLogs // method. func (client *ScriptExecutionsClient) GetExecutionLogs(ctx context.Context, resourceGroupName string, privateCloudName string, scriptExecutionName string, options *ScriptExecutionsClientGetExecutionLogsOptions) (ScriptExecutionsClientGetExecutionLogsResponse, error) { @@ -333,7 +335,7 @@ func (client *ScriptExecutionsClient) getExecutionLogsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ScriptOutputStreamType != nil { @@ -354,9 +356,9 @@ func (client *ScriptExecutionsClient) getExecutionLogsHandleResponse(resp *http. return result, nil } -// NewListPager - List script executions in a private cloud +// NewListPager - List ScriptExecution resources by PrivateCloud // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - ScriptExecutionsClientListOptions contains the optional parameters for the ScriptExecutionsClient.NewListPager @@ -404,7 +406,7 @@ func (client *ScriptExecutionsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -413,7 +415,7 @@ func (client *ScriptExecutionsClient) listCreateRequest(ctx context.Context, res // listHandleResponse handles the List response. func (client *ScriptExecutionsClient) listHandleResponse(resp *http.Response) (ScriptExecutionsClientListResponse, error) { result := ScriptExecutionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ScriptExecutionsList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.ScriptExecutionListResult); err != nil { return ScriptExecutionsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/avs/armavs/scriptexecutions_client_example_test.go b/sdk/resourcemanager/avs/armavs/scriptexecutions_client_example_test.go deleted file mode 100644 index 53143d297a90..000000000000 --- a/sdk/resourcemanager/avs/armavs/scriptexecutions_client_example_test.go +++ /dev/null @@ -1,257 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_List.json -func ExampleScriptExecutionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScriptExecutionsClient().NewListPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScriptExecutionsList = armavs.ScriptExecutionsList{ - // Value: []*armavs.ScriptExecution{ - // { - // Name: to.Ptr("addSsoServer"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/scriptExecutions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptExecutions/addSsoServer"), - // Properties: &armavs.ScriptExecutionProperties{ - // FailureReason: to.Ptr("vCenter failed to connect to the external server"), - // FinishedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-21T18:32:28.000Z"); return t}()), - // Parameters: []armavs.ScriptExecutionParameterClassification{ - // &armavs.ScriptStringExecutionParameter{ - // Name: to.Ptr("DomainName"), - // Type: to.Ptr(armavs.ScriptExecutionParameterTypeValue), - // Value: to.Ptr("placeholderDomain.local"), - // }, - // &armavs.ScriptStringExecutionParameter{ - // Name: to.Ptr("BaseUserDN"), - // Type: to.Ptr(armavs.ScriptExecutionParameterTypeValue), - // Value: to.Ptr("DC=placeholder, DC=placeholder"), - // }}, - // ProvisioningState: to.Ptr(armavs.ScriptExecutionProvisioningStateSucceeded), - // Retention: to.Ptr("P0Y0M60DT0H60M60S"), - // ScriptCmdletID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptPackages/AVS:1.0.0/scriptCmdlets/New-SsoExternalIdentitySource"), - // StartedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-21T17:32:28.000Z"); return t}()), - // SubmittedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-21T17:31:28.000Z"); return t}()), - // Timeout: to.Ptr("P0Y0M0DT0H60M60S"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_Get.json -func ExampleScriptExecutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScriptExecutionsClient().Get(ctx, "group1", "cloud1", "addSsoServer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScriptExecution = armavs.ScriptExecution{ - // Name: to.Ptr("addSsoServer"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/scriptExecutions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptExecutions/addSsoServer"), - // Properties: &armavs.ScriptExecutionProperties{ - // FailureReason: to.Ptr("vCenter failed to connect to the external server"), - // FinishedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-21T18:32:28.000Z"); return t}()), - // Parameters: []armavs.ScriptExecutionParameterClassification{ - // &armavs.ScriptStringExecutionParameter{ - // Name: to.Ptr("DomainName"), - // Type: to.Ptr(armavs.ScriptExecutionParameterTypeValue), - // Value: to.Ptr("placeholderDomain.local"), - // }, - // &armavs.ScriptStringExecutionParameter{ - // Name: to.Ptr("BaseUserDN"), - // Type: to.Ptr(armavs.ScriptExecutionParameterTypeValue), - // Value: to.Ptr("DC=placeholder, DC=placeholder"), - // }}, - // ProvisioningState: to.Ptr(armavs.ScriptExecutionProvisioningStateSucceeded), - // Retention: to.Ptr("P0Y0M60DT0H60M60S"), - // ScriptCmdletID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptPackages/AVS.PowerCommands@1.0.0/scriptCmdlets/New-SsoExternalIdentitySource"), - // StartedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-21T17:32:28.000Z"); return t}()), - // SubmittedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-21T17:31:28.000Z"); return t}()), - // Timeout: to.Ptr("P0Y0M0DT0H60M60S"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_CreateOrUpdate.json -func ExampleScriptExecutionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewScriptExecutionsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "addSsoServer", armavs.ScriptExecution{ - Properties: &armavs.ScriptExecutionProperties{ - HiddenParameters: []armavs.ScriptExecutionParameterClassification{ - &armavs.ScriptSecureStringExecutionParameter{ - Name: to.Ptr("Password"), - Type: to.Ptr(armavs.ScriptExecutionParameterTypeSecureValue), - SecureValue: to.Ptr("PlaceholderPassword"), - }}, - Parameters: []armavs.ScriptExecutionParameterClassification{ - &armavs.ScriptStringExecutionParameter{ - Name: to.Ptr("DomainName"), - Type: to.Ptr(armavs.ScriptExecutionParameterTypeValue), - Value: to.Ptr("placeholderDomain.local"), - }, - &armavs.ScriptStringExecutionParameter{ - Name: to.Ptr("BaseUserDN"), - Type: to.Ptr(armavs.ScriptExecutionParameterTypeValue), - Value: to.Ptr("DC=placeholder, DC=placeholder"), - }}, - Retention: to.Ptr("P0Y0M60DT0H60M60S"), - ScriptCmdletID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptPackages/AVS.PowerCommands@1.0.0/scriptCmdlets/New-SsoExternalIdentitySource"), - Timeout: to.Ptr("P0Y0M0DT0H60M60S"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScriptExecution = armavs.ScriptExecution{ - // Name: to.Ptr("addSsoServer"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/scriptExecutions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptExecutions/addSsoServer"), - // Properties: &armavs.ScriptExecutionProperties{ - // FailureReason: to.Ptr("vCenter failed to connect to the external server"), - // Output: []*string{ - // to.Ptr("IdentitySource: placeholder.dc"), - // to.Ptr("BaseDN='dc=placeholder, dc=local")}, - // Parameters: []armavs.ScriptExecutionParameterClassification{ - // &armavs.ScriptStringExecutionParameter{ - // Name: to.Ptr("DomainName"), - // Type: to.Ptr(armavs.ScriptExecutionParameterTypeValue), - // Value: to.Ptr("placeholderDomain.local"), - // }, - // &armavs.ScriptStringExecutionParameter{ - // Name: to.Ptr("BaseUserDN"), - // Type: to.Ptr(armavs.ScriptExecutionParameterTypeValue), - // Value: to.Ptr("DC=placeholder, DC=placeholder"), - // }}, - // ProvisioningState: to.Ptr(armavs.ScriptExecutionProvisioningStateSucceeded), - // Retention: to.Ptr("P0Y0M60DT0H60M60S"), - // ScriptCmdletID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptPackages/AVS.PowerCommands@1.0.0/scriptCmdlets/New-SsoExternalIdentitySource"), - // Timeout: to.Ptr("P0Y0M0DT0H60M60S"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_Delete.json -func ExampleScriptExecutionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewScriptExecutionsClient().BeginDelete(ctx, "group1", "cloud1", "addSsoServer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptExecutions_GetExecutionLogs.json -func ExampleScriptExecutionsClient_GetExecutionLogs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScriptExecutionsClient().GetExecutionLogs(ctx, "group1", "cloud1", "addSsoServer", &armavs.ScriptExecutionsClientGetExecutionLogsOptions{ScriptOutputStreamType: []*armavs.ScriptOutputStreamType{ - to.Ptr(armavs.ScriptOutputStreamTypeInformation), - to.Ptr(armavs.ScriptOutputStreamType("Warnings")), - to.Ptr(armavs.ScriptOutputStreamType("Errors")), - to.Ptr(armavs.ScriptOutputStreamTypeOutput)}, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScriptExecution = armavs.ScriptExecution{ - // Name: to.Ptr("addSsoServer"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptExecutions/addSsoServer"), - // Properties: &armavs.ScriptExecutionProperties{ - // Errors: []*string{ - // to.Ptr("Most recent error output"), - // to.Ptr("Second most error recent output")}, - // Information: []*string{ - // to.Ptr("Most recent information output"), - // to.Ptr("Second most recent information output")}, - // Output: []*string{ - // to.Ptr("Most recent output"), - // to.Ptr("Second most recent output")}, - // Timeout: to.Ptr("P0Y0M0D0H060M0S"), - // Warnings: []*string{ - // to.Ptr("Most recent warning output"), - // to.Ptr("Second most recent warning output")}, - // }, - // } -} diff --git a/sdk/resourcemanager/avs/armavs/scriptpackages_client.go b/sdk/resourcemanager/avs/armavs/scriptpackages_client.go index 561464f092bb..77628e691389 100644 --- a/sdk/resourcemanager/avs/armavs/scriptpackages_client.go +++ b/sdk/resourcemanager/avs/armavs/scriptpackages_client.go @@ -43,13 +43,13 @@ func NewScriptPackagesClient(subscriptionID string, credential azcore.TokenCrede return client, nil } -// Get - Get a script package available to run on a private cloud +// Get - Get a ScriptPackage // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - scriptPackageName - Name of the script package in the private cloud +// - scriptPackageName - Name of the script package. // - options - ScriptPackagesClientGetOptions contains the optional parameters for the ScriptPackagesClient.Get method. func (client *ScriptPackagesClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, scriptPackageName string, options *ScriptPackagesClientGetOptions) (ScriptPackagesClientGetResponse, error) { var err error @@ -97,7 +97,7 @@ func (client *ScriptPackagesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,9 +112,9 @@ func (client *ScriptPackagesClient) getHandleResponse(resp *http.Response) (Scri return result, nil } -// NewListPager - List script packages available to run on the private cloud +// NewListPager - List ScriptPackage resources by PrivateCloud // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - ScriptPackagesClientListOptions contains the optional parameters for the ScriptPackagesClient.NewListPager method. @@ -161,7 +161,7 @@ func (client *ScriptPackagesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,7 +170,7 @@ func (client *ScriptPackagesClient) listCreateRequest(ctx context.Context, resou // listHandleResponse handles the List response. func (client *ScriptPackagesClient) listHandleResponse(resp *http.Response) (ScriptPackagesClientListResponse, error) { result := ScriptPackagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ScriptPackagesList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.ScriptPackageListResult); err != nil { return ScriptPackagesClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/avs/armavs/scriptpackages_client_example_test.go b/sdk/resourcemanager/avs/armavs/scriptpackages_client_example_test.go deleted file mode 100644 index ccbcf37ccf36..000000000000 --- a/sdk/resourcemanager/avs/armavs/scriptpackages_client_example_test.go +++ /dev/null @@ -1,99 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptPackages_List.json -func ExampleScriptPackagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScriptPackagesClient().NewListPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScriptPackagesList = armavs.ScriptPackagesList{ - // Value: []*armavs.ScriptPackage{ - // { - // Name: to.Ptr("Microsoft.AVS.Management@3.0.48"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/scriptPackages"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptPackages/Microsoft.AVS.Management@3.0.48"), - // Properties: &armavs.ScriptPackageProperties{ - // Description: to.Ptr("Various cmdlets for elevated access to Private Cloud administrative functions"), - // Company: to.Ptr("Microsoft"), - // URI: to.Ptr("https://microsoft.com"), - // Version: to.Ptr("3.0.48"), - // }, - // }, - // { - // Name: to.Ptr("JSDR.Configuration@1.0.0"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/scriptPackages"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptPackages/JSDR.Configuration@1.0.0"), - // Properties: &armavs.ScriptPackageProperties{ - // Description: to.Ptr("Various cmdlets by Jetstream for Private Cloud administration"), - // Company: to.Ptr("Jetstream Software"), - // URI: to.Ptr("https://www.jetstreamsoft.com/about/support/"), - // Version: to.Ptr("1.0.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/ScriptPackages_Get.json -func ExampleScriptPackagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScriptPackagesClient().Get(ctx, "group1", "cloud1", "Microsoft.AVS.Management@3.0.48", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScriptPackage = armavs.ScriptPackage{ - // Name: to.Ptr("Microsoft.AVS.Management@3.0.48"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/scriptPackages"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/scriptPackages/Microsoft.AVS.Management@3.0.48"), - // Properties: &armavs.ScriptPackageProperties{ - // Description: to.Ptr("Various cmdlets for elevated access to Private Cloud administrative functions"), - // Company: to.Ptr("Microsoft"), - // URI: to.Ptr("https://microsoft.com"), - // Version: to.Ptr("3.0.48"), - // }, - // } -} diff --git a/sdk/resourcemanager/avs/armavs/time_rfc3339.go b/sdk/resourcemanager/avs/armavs/time_rfc3339.go index cdc75f569b81..cd17c63544ba 100644 --- a/sdk/resourcemanager/avs/armavs/time_rfc3339.go +++ b/sdk/resourcemanager/avs/armavs/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/avs/armavs/virtualmachines_client.go b/sdk/resourcemanager/avs/armavs/virtualmachines_client.go index e97654f32720..4e275028ef10 100644 --- a/sdk/resourcemanager/avs/armavs/virtualmachines_client.go +++ b/sdk/resourcemanager/avs/armavs/virtualmachines_client.go @@ -43,14 +43,14 @@ func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCred return client, nil } -// Get - Get a virtual machine by id in a private cloud cluster +// Get - Get a VirtualMachine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud -// - virtualMachineID - Virtual Machine identifier +// - clusterName - Name of the cluster +// - virtualMachineID - ID of the virtual machine. // - options - VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method. func (client *VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, virtualMachineID string, options *VirtualMachinesClientGetOptions) (VirtualMachinesClientGetResponse, error) { var err error @@ -102,7 +102,7 @@ func (client *VirtualMachinesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,12 +117,12 @@ func (client *VirtualMachinesClient) getHandleResponse(resp *http.Response) (Vir return result, nil } -// NewListPager - List of virtual machines in a private cloud cluster +// NewListPager - List VirtualMachine resources by Cluster // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud +// - clusterName - Name of the cluster // - options - VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager // method. func (client *VirtualMachinesClient) NewListPager(resourceGroupName string, privateCloudName string, clusterName string, options *VirtualMachinesClientListOptions) *runtime.Pager[VirtualMachinesClientListResponse] { @@ -172,7 +172,7 @@ func (client *VirtualMachinesClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *VirtualMachinesClient) listCreateRequest(ctx context.Context, reso // listHandleResponse handles the List response. func (client *VirtualMachinesClient) listHandleResponse(resp *http.Response) (VirtualMachinesClientListResponse, error) { result := VirtualMachinesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachinesList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil { return VirtualMachinesClientListResponse{}, err } return result, nil @@ -190,12 +190,12 @@ func (client *VirtualMachinesClient) listHandleResponse(resp *http.Response) (Vi // BeginRestrictMovement - Enable or disable DRS-driven VM movement restriction // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - clusterName - Name of the cluster in the private cloud -// - virtualMachineID - Virtual Machine identifier -// - restrictMovement - Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) +// - clusterName - Name of the cluster +// - virtualMachineID - ID of the virtual machine. +// - restrictMovement - The body type of the operation request. // - options - VirtualMachinesClientBeginRestrictMovementOptions contains the optional parameters for the VirtualMachinesClient.BeginRestrictMovement // method. func (client *VirtualMachinesClient) BeginRestrictMovement(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, virtualMachineID string, restrictMovement VirtualMachineRestrictMovement, options *VirtualMachinesClientBeginRestrictMovementOptions) (*runtime.Poller[VirtualMachinesClientRestrictMovementResponse], error) { @@ -205,7 +205,8 @@ func (client *VirtualMachinesClient) BeginRestrictMovement(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientRestrictMovementResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -218,7 +219,7 @@ func (client *VirtualMachinesClient) BeginRestrictMovement(ctx context.Context, // RestrictMovement - Enable or disable DRS-driven VM movement restriction // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *VirtualMachinesClient) restrictMovement(ctx context.Context, resourceGroupName string, privateCloudName string, clusterName string, virtualMachineID string, restrictMovement VirtualMachineRestrictMovement, options *VirtualMachinesClientBeginRestrictMovementOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginRestrictMovement" @@ -268,7 +269,7 @@ func (client *VirtualMachinesClient) restrictMovementCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, restrictMovement); err != nil { diff --git a/sdk/resourcemanager/avs/armavs/virtualmachines_client_example_test.go b/sdk/resourcemanager/avs/armavs/virtualmachines_client_example_test.go deleted file mode 100644 index 8d546fdbc0f4..000000000000 --- a/sdk/resourcemanager/avs/armavs/virtualmachines_client_example_test.go +++ /dev/null @@ -1,123 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/VirtualMachines_List.json -func ExampleVirtualMachinesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachinesClient().NewListPager("group1", "cloud1", "cluster1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachinesList = armavs.VirtualMachinesList{ - // Value: []*armavs.VirtualMachine{ - // { - // Name: to.Ptr("vm-209"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters/virtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-209"), - // Properties: &armavs.VirtualMachineProperties{ - // DisplayName: to.Ptr("contoso-vm1"), - // FolderPath: to.Ptr("vm/folder-1"), - // MoRefID: to.Ptr("vm-209"), - // RestrictMovement: to.Ptr(armavs.VirtualMachineRestrictMovementStateDisabled), - // }, - // }, - // { - // Name: to.Ptr("vm-128"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters/virtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128"), - // Properties: &armavs.VirtualMachineProperties{ - // DisplayName: to.Ptr("contoso-vm2"), - // FolderPath: to.Ptr("vm"), - // MoRefID: to.Ptr("vm-128"), - // RestrictMovement: to.Ptr(armavs.VirtualMachineRestrictMovementStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/VirtualMachines_Get.json -func ExampleVirtualMachinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "group1", "cloud1", "cluster1", "vm-209", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armavs.VirtualMachine{ - // Name: to.Ptr("vm-209"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/clusters/virtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-209"), - // Properties: &armavs.VirtualMachineProperties{ - // DisplayName: to.Ptr("contoso-vm"), - // FolderPath: to.Ptr("vm/folder-1"), - // MoRefID: to.Ptr("vm-209"), - // RestrictMovement: to.Ptr(armavs.VirtualMachineRestrictMovementStateDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/VirtualMachines_RestrictMovement.json -func ExampleVirtualMachinesClient_BeginRestrictMovement() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginRestrictMovement(ctx, "group1", "cloud1", "cluster1", "vm-209", armavs.VirtualMachineRestrictMovement{ - RestrictMovement: to.Ptr(armavs.VirtualMachineRestrictMovementStateEnabled), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/avs/armavs/workloadnetworks_client.go b/sdk/resourcemanager/avs/armavs/workloadnetworks_client.go index 88f17cd9e415..0f905f0335af 100644 --- a/sdk/resourcemanager/avs/armavs/workloadnetworks_client.go +++ b/sdk/resourcemanager/avs/armavs/workloadnetworks_client.go @@ -43,14 +43,14 @@ func NewWorkloadNetworksClient(subscriptionID string, credential azcore.TokenCre return client, nil } -// BeginCreateDNSService - Create a DNS service by id in a private cloud workload network. +// BeginCreateDNSService - Create a WorkloadNetworkDnsService // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - dnsServiceID - NSX DNS Service identifier. Generally the same as the DNS Service's display name -// - workloadNetworkDNSService - NSX DNS Service +// - dnsServiceID - ID of the DNS service. +// - workloadNetworkDNSService - Resource create parameters. // - options - WorkloadNetworksClientBeginCreateDNSServiceOptions contains the optional parameters for the WorkloadNetworksClient.BeginCreateDNSService // method. func (client *WorkloadNetworksClient) BeginCreateDNSService(ctx context.Context, resourceGroupName string, privateCloudName string, dnsServiceID string, workloadNetworkDNSService WorkloadNetworkDNSService, options *WorkloadNetworksClientBeginCreateDNSServiceOptions) (*runtime.Poller[WorkloadNetworksClientCreateDNSServiceResponse], error) { @@ -60,7 +60,8 @@ func (client *WorkloadNetworksClient) BeginCreateDNSService(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientCreateDNSServiceResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -70,10 +71,10 @@ func (client *WorkloadNetworksClient) BeginCreateDNSService(ctx context.Context, } } -// CreateDNSService - Create a DNS service by id in a private cloud workload network. +// CreateDNSService - Create a WorkloadNetworkDnsService // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) createDNSService(ctx context.Context, resourceGroupName string, privateCloudName string, dnsServiceID string, workloadNetworkDNSService WorkloadNetworkDNSService, options *WorkloadNetworksClientBeginCreateDNSServiceOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginCreateDNSService" @@ -119,7 +120,7 @@ func (client *WorkloadNetworksClient) createDNSServiceCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkDNSService); err != nil { @@ -128,14 +129,14 @@ func (client *WorkloadNetworksClient) createDNSServiceCreateRequest(ctx context. return req, nil } -// BeginCreateDNSZone - Create a DNS zone by id in a private cloud workload network. +// BeginCreateDNSZone - Create a WorkloadNetworkDnsZone // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - dnsZoneID - NSX DNS Zone identifier. Generally the same as the DNS Zone's display name -// - workloadNetworkDNSZone - NSX DNS Zone +// - dnsZoneID - ID of the DNS zone. +// - workloadNetworkDNSZone - Resource create parameters. // - options - WorkloadNetworksClientBeginCreateDNSZoneOptions contains the optional parameters for the WorkloadNetworksClient.BeginCreateDNSZone // method. func (client *WorkloadNetworksClient) BeginCreateDNSZone(ctx context.Context, resourceGroupName string, privateCloudName string, dnsZoneID string, workloadNetworkDNSZone WorkloadNetworkDNSZone, options *WorkloadNetworksClientBeginCreateDNSZoneOptions) (*runtime.Poller[WorkloadNetworksClientCreateDNSZoneResponse], error) { @@ -145,7 +146,8 @@ func (client *WorkloadNetworksClient) BeginCreateDNSZone(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientCreateDNSZoneResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -155,10 +157,10 @@ func (client *WorkloadNetworksClient) BeginCreateDNSZone(ctx context.Context, re } } -// CreateDNSZone - Create a DNS zone by id in a private cloud workload network. +// CreateDNSZone - Create a WorkloadNetworkDnsZone // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) createDNSZone(ctx context.Context, resourceGroupName string, privateCloudName string, dnsZoneID string, workloadNetworkDNSZone WorkloadNetworkDNSZone, options *WorkloadNetworksClientBeginCreateDNSZoneOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginCreateDNSZone" @@ -204,7 +206,7 @@ func (client *WorkloadNetworksClient) createDNSZoneCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkDNSZone); err != nil { @@ -213,14 +215,14 @@ func (client *WorkloadNetworksClient) createDNSZoneCreateRequest(ctx context.Con return req, nil } -// BeginCreateDhcp - Create dhcp by id in a private cloud workload network. +// BeginCreateDhcp - Create a WorkloadNetworkDhcp // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - dhcpID - NSX DHCP identifier. Generally the same as the DHCP display name -// - workloadNetworkDhcp - NSX DHCP +// - dhcpID - The ID of the DHCP configuration +// - workloadNetworkDhcp - Resource create parameters. // - options - WorkloadNetworksClientBeginCreateDhcpOptions contains the optional parameters for the WorkloadNetworksClient.BeginCreateDhcp // method. func (client *WorkloadNetworksClient) BeginCreateDhcp(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp WorkloadNetworkDhcp, options *WorkloadNetworksClientBeginCreateDhcpOptions) (*runtime.Poller[WorkloadNetworksClientCreateDhcpResponse], error) { @@ -230,7 +232,8 @@ func (client *WorkloadNetworksClient) BeginCreateDhcp(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientCreateDhcpResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -240,10 +243,10 @@ func (client *WorkloadNetworksClient) BeginCreateDhcp(ctx context.Context, resou } } -// CreateDhcp - Create dhcp by id in a private cloud workload network. +// CreateDhcp - Create a WorkloadNetworkDhcp // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) createDhcp(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp WorkloadNetworkDhcp, options *WorkloadNetworksClientBeginCreateDhcpOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginCreateDhcp" @@ -289,7 +292,7 @@ func (client *WorkloadNetworksClient) createDhcpCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkDhcp); err != nil { @@ -298,14 +301,14 @@ func (client *WorkloadNetworksClient) createDhcpCreateRequest(ctx context.Contex return req, nil } -// BeginCreatePortMirroring - Create a port mirroring profile by id in a private cloud workload network. +// BeginCreatePortMirroring - Create a WorkloadNetworkPortMirroring // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - portMirroringID - NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name -// - workloadNetworkPortMirroring - NSX port mirroring +// - portMirroringID - ID of the NSX port mirroring profile. +// - workloadNetworkPortMirroring - Resource create parameters. // - options - WorkloadNetworksClientBeginCreatePortMirroringOptions contains the optional parameters for the WorkloadNetworksClient.BeginCreatePortMirroring // method. func (client *WorkloadNetworksClient) BeginCreatePortMirroring(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring WorkloadNetworkPortMirroring, options *WorkloadNetworksClientBeginCreatePortMirroringOptions) (*runtime.Poller[WorkloadNetworksClientCreatePortMirroringResponse], error) { @@ -315,7 +318,8 @@ func (client *WorkloadNetworksClient) BeginCreatePortMirroring(ctx context.Conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientCreatePortMirroringResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -325,10 +329,10 @@ func (client *WorkloadNetworksClient) BeginCreatePortMirroring(ctx context.Conte } } -// CreatePortMirroring - Create a port mirroring profile by id in a private cloud workload network. +// CreatePortMirroring - Create a WorkloadNetworkPortMirroring // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) createPortMirroring(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring WorkloadNetworkPortMirroring, options *WorkloadNetworksClientBeginCreatePortMirroringOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginCreatePortMirroring" @@ -374,7 +378,7 @@ func (client *WorkloadNetworksClient) createPortMirroringCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkPortMirroring); err != nil { @@ -383,14 +387,14 @@ func (client *WorkloadNetworksClient) createPortMirroringCreateRequest(ctx conte return req, nil } -// BeginCreatePublicIP - Create a Public IP Block by id in a private cloud workload network. +// BeginCreatePublicIP - Create a WorkloadNetworkPublicIP // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - publicIPID - NSX Public IP Block identifier. Generally the same as the Public IP Block's display name -// - workloadNetworkPublicIP - NSX Public IP Block +// - publicIPID - ID of the DNS zone. +// - workloadNetworkPublicIP - Resource create parameters. // - options - WorkloadNetworksClientBeginCreatePublicIPOptions contains the optional parameters for the WorkloadNetworksClient.BeginCreatePublicIP // method. func (client *WorkloadNetworksClient) BeginCreatePublicIP(ctx context.Context, resourceGroupName string, privateCloudName string, publicIPID string, workloadNetworkPublicIP WorkloadNetworkPublicIP, options *WorkloadNetworksClientBeginCreatePublicIPOptions) (*runtime.Poller[WorkloadNetworksClientCreatePublicIPResponse], error) { @@ -400,7 +404,8 @@ func (client *WorkloadNetworksClient) BeginCreatePublicIP(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientCreatePublicIPResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -410,10 +415,10 @@ func (client *WorkloadNetworksClient) BeginCreatePublicIP(ctx context.Context, r } } -// CreatePublicIP - Create a Public IP Block by id in a private cloud workload network. +// CreatePublicIP - Create a WorkloadNetworkPublicIP // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) createPublicIP(ctx context.Context, resourceGroupName string, privateCloudName string, publicIPID string, workloadNetworkPublicIP WorkloadNetworkPublicIP, options *WorkloadNetworksClientBeginCreatePublicIPOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginCreatePublicIP" @@ -459,7 +464,7 @@ func (client *WorkloadNetworksClient) createPublicIPCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkPublicIP); err != nil { @@ -468,14 +473,14 @@ func (client *WorkloadNetworksClient) createPublicIPCreateRequest(ctx context.Co return req, nil } -// BeginCreateSegments - Create a segment by id in a private cloud workload network. +// BeginCreateSegments - Create a WorkloadNetworkSegment // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - segmentID - NSX Segment identifier. Generally the same as the Segment's display name -// - workloadNetworkSegment - NSX Segment +// - segmentID - The ID of the NSX Segment +// - workloadNetworkSegment - Resource create parameters. // - options - WorkloadNetworksClientBeginCreateSegmentsOptions contains the optional parameters for the WorkloadNetworksClient.BeginCreateSegments // method. func (client *WorkloadNetworksClient) BeginCreateSegments(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment WorkloadNetworkSegment, options *WorkloadNetworksClientBeginCreateSegmentsOptions) (*runtime.Poller[WorkloadNetworksClientCreateSegmentsResponse], error) { @@ -485,7 +490,8 @@ func (client *WorkloadNetworksClient) BeginCreateSegments(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientCreateSegmentsResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -495,10 +501,10 @@ func (client *WorkloadNetworksClient) BeginCreateSegments(ctx context.Context, r } } -// CreateSegments - Create a segment by id in a private cloud workload network. +// CreateSegments - Create a WorkloadNetworkSegment // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) createSegments(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment WorkloadNetworkSegment, options *WorkloadNetworksClientBeginCreateSegmentsOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginCreateSegments" @@ -544,7 +550,7 @@ func (client *WorkloadNetworksClient) createSegmentsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkSegment); err != nil { @@ -553,14 +559,14 @@ func (client *WorkloadNetworksClient) createSegmentsCreateRequest(ctx context.Co return req, nil } -// BeginCreateVMGroup - Create a vm group by id in a private cloud workload network. +// BeginCreateVMGroup - Create a WorkloadNetworkVMGroup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - vmGroupID - NSX VM Group identifier. Generally the same as the VM Group's display name -// - workloadNetworkVMGroup - NSX VM Group +// - vmGroupID - ID of the VM group. +// - workloadNetworkVMGroup - Resource create parameters. // - options - WorkloadNetworksClientBeginCreateVMGroupOptions contains the optional parameters for the WorkloadNetworksClient.BeginCreateVMGroup // method. func (client *WorkloadNetworksClient) BeginCreateVMGroup(ctx context.Context, resourceGroupName string, privateCloudName string, vmGroupID string, workloadNetworkVMGroup WorkloadNetworkVMGroup, options *WorkloadNetworksClientBeginCreateVMGroupOptions) (*runtime.Poller[WorkloadNetworksClientCreateVMGroupResponse], error) { @@ -570,7 +576,8 @@ func (client *WorkloadNetworksClient) BeginCreateVMGroup(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientCreateVMGroupResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -580,10 +587,10 @@ func (client *WorkloadNetworksClient) BeginCreateVMGroup(ctx context.Context, re } } -// CreateVMGroup - Create a vm group by id in a private cloud workload network. +// CreateVMGroup - Create a WorkloadNetworkVMGroup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) createVMGroup(ctx context.Context, resourceGroupName string, privateCloudName string, vmGroupID string, workloadNetworkVMGroup WorkloadNetworkVMGroup, options *WorkloadNetworksClientBeginCreateVMGroupOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginCreateVMGroup" @@ -629,7 +636,7 @@ func (client *WorkloadNetworksClient) createVMGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkVMGroup); err != nil { @@ -638,12 +645,12 @@ func (client *WorkloadNetworksClient) createVMGroupCreateRequest(ctx context.Con return req, nil } -// BeginDeleteDNSService - Delete a DNS service by id in a private cloud workload network. +// BeginDeleteDNSService - Delete a WorkloadNetworkDnsService // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - dnsServiceID - NSX DNS Service identifier. Generally the same as the DNS Service's display name +// - dnsServiceID - ID of the DNS service. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientBeginDeleteDNSServiceOptions contains the optional parameters for the WorkloadNetworksClient.BeginDeleteDNSService // method. @@ -654,7 +661,8 @@ func (client *WorkloadNetworksClient) BeginDeleteDNSService(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientDeleteDNSServiceResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -664,10 +672,10 @@ func (client *WorkloadNetworksClient) BeginDeleteDNSService(ctx context.Context, } } -// DeleteDNSService - Delete a DNS service by id in a private cloud workload network. +// DeleteDNSService - Delete a WorkloadNetworkDnsService // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) deleteDNSService(ctx context.Context, resourceGroupName string, dnsServiceID string, privateCloudName string, options *WorkloadNetworksClientBeginDeleteDNSServiceOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginDeleteDNSService" @@ -713,18 +721,18 @@ func (client *WorkloadNetworksClient) deleteDNSServiceCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginDeleteDNSZone - Delete a DNS zone by id in a private cloud workload network. +// BeginDeleteDNSZone - Delete a WorkloadNetworkDnsZone // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - dnsZoneID - NSX DNS Zone identifier. Generally the same as the DNS Zone's display name +// - dnsZoneID - ID of the DNS zone. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientBeginDeleteDNSZoneOptions contains the optional parameters for the WorkloadNetworksClient.BeginDeleteDNSZone // method. @@ -735,7 +743,8 @@ func (client *WorkloadNetworksClient) BeginDeleteDNSZone(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientDeleteDNSZoneResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -745,10 +754,10 @@ func (client *WorkloadNetworksClient) BeginDeleteDNSZone(ctx context.Context, re } } -// DeleteDNSZone - Delete a DNS zone by id in a private cloud workload network. +// DeleteDNSZone - Delete a WorkloadNetworkDnsZone // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) deleteDNSZone(ctx context.Context, resourceGroupName string, dnsZoneID string, privateCloudName string, options *WorkloadNetworksClientBeginDeleteDNSZoneOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginDeleteDNSZone" @@ -794,19 +803,19 @@ func (client *WorkloadNetworksClient) deleteDNSZoneCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginDeleteDhcp - Delete dhcp by id in a private cloud workload network. +// BeginDeleteDhcp - Delete a WorkloadNetworkDhcp // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - dhcpID - NSX DHCP identifier. Generally the same as the DHCP display name +// - dhcpID - The ID of the DHCP configuration // - options - WorkloadNetworksClientBeginDeleteDhcpOptions contains the optional parameters for the WorkloadNetworksClient.BeginDeleteDhcp // method. func (client *WorkloadNetworksClient) BeginDeleteDhcp(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, options *WorkloadNetworksClientBeginDeleteDhcpOptions) (*runtime.Poller[WorkloadNetworksClientDeleteDhcpResponse], error) { @@ -816,7 +825,8 @@ func (client *WorkloadNetworksClient) BeginDeleteDhcp(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientDeleteDhcpResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -826,10 +836,10 @@ func (client *WorkloadNetworksClient) BeginDeleteDhcp(ctx context.Context, resou } } -// DeleteDhcp - Delete dhcp by id in a private cloud workload network. +// DeleteDhcp - Delete a WorkloadNetworkDhcp // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) deleteDhcp(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, options *WorkloadNetworksClientBeginDeleteDhcpOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginDeleteDhcp" @@ -875,18 +885,18 @@ func (client *WorkloadNetworksClient) deleteDhcpCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginDeletePortMirroring - Delete a port mirroring profile by id in a private cloud workload network. +// BeginDeletePortMirroring - Delete a WorkloadNetworkPortMirroring // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - portMirroringID - NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name +// - portMirroringID - ID of the NSX port mirroring profile. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientBeginDeletePortMirroringOptions contains the optional parameters for the WorkloadNetworksClient.BeginDeletePortMirroring // method. @@ -897,7 +907,8 @@ func (client *WorkloadNetworksClient) BeginDeletePortMirroring(ctx context.Conte return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientDeletePortMirroringResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -907,10 +918,10 @@ func (client *WorkloadNetworksClient) BeginDeletePortMirroring(ctx context.Conte } } -// DeletePortMirroring - Delete a port mirroring profile by id in a private cloud workload network. +// DeletePortMirroring - Delete a WorkloadNetworkPortMirroring // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) deletePortMirroring(ctx context.Context, resourceGroupName string, portMirroringID string, privateCloudName string, options *WorkloadNetworksClientBeginDeletePortMirroringOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginDeletePortMirroring" @@ -956,18 +967,18 @@ func (client *WorkloadNetworksClient) deletePortMirroringCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginDeletePublicIP - Delete a Public IP Block by id in a private cloud workload network. +// BeginDeletePublicIP - Delete a WorkloadNetworkPublicIP // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - publicIPID - NSX Public IP Block identifier. Generally the same as the Public IP Block's display name +// - publicIPID - ID of the DNS zone. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientBeginDeletePublicIPOptions contains the optional parameters for the WorkloadNetworksClient.BeginDeletePublicIP // method. @@ -978,7 +989,8 @@ func (client *WorkloadNetworksClient) BeginDeletePublicIP(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientDeletePublicIPResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -988,10 +1000,10 @@ func (client *WorkloadNetworksClient) BeginDeletePublicIP(ctx context.Context, r } } -// DeletePublicIP - Delete a Public IP Block by id in a private cloud workload network. +// DeletePublicIP - Delete a WorkloadNetworkPublicIP // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) deletePublicIP(ctx context.Context, resourceGroupName string, publicIPID string, privateCloudName string, options *WorkloadNetworksClientBeginDeletePublicIPOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginDeletePublicIP" @@ -1037,19 +1049,19 @@ func (client *WorkloadNetworksClient) deletePublicIPCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginDeleteSegment - Delete a segment by id in a private cloud workload network. +// BeginDeleteSegment - Delete a WorkloadNetworkSegment // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - segmentID - NSX Segment identifier. Generally the same as the Segment's display name +// - segmentID - The ID of the NSX Segment // - options - WorkloadNetworksClientBeginDeleteSegmentOptions contains the optional parameters for the WorkloadNetworksClient.BeginDeleteSegment // method. func (client *WorkloadNetworksClient) BeginDeleteSegment(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, options *WorkloadNetworksClientBeginDeleteSegmentOptions) (*runtime.Poller[WorkloadNetworksClientDeleteSegmentResponse], error) { @@ -1059,7 +1071,8 @@ func (client *WorkloadNetworksClient) BeginDeleteSegment(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientDeleteSegmentResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1069,10 +1082,10 @@ func (client *WorkloadNetworksClient) BeginDeleteSegment(ctx context.Context, re } } -// DeleteSegment - Delete a segment by id in a private cloud workload network. +// DeleteSegment - Delete a WorkloadNetworkSegment // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) deleteSegment(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, options *WorkloadNetworksClientBeginDeleteSegmentOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginDeleteSegment" @@ -1118,18 +1131,18 @@ func (client *WorkloadNetworksClient) deleteSegmentCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginDeleteVMGroup - Delete a vm group by id in a private cloud workload network. +// BeginDeleteVMGroup - Delete a WorkloadNetworkVMGroup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - vmGroupID - NSX VM Group identifier. Generally the same as the VM Group's display name +// - vmGroupID - ID of the VM group. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientBeginDeleteVMGroupOptions contains the optional parameters for the WorkloadNetworksClient.BeginDeleteVMGroup // method. @@ -1140,7 +1153,8 @@ func (client *WorkloadNetworksClient) BeginDeleteVMGroup(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientDeleteVMGroupResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1150,10 +1164,10 @@ func (client *WorkloadNetworksClient) BeginDeleteVMGroup(ctx context.Context, re } } -// DeleteVMGroup - Delete a vm group by id in a private cloud workload network. +// DeleteVMGroup - Delete a WorkloadNetworkVMGroup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 func (client *WorkloadNetworksClient) deleteVMGroup(ctx context.Context, resourceGroupName string, vmGroupID string, privateCloudName string, options *WorkloadNetworksClientBeginDeleteVMGroupOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginDeleteVMGroup" @@ -1199,27 +1213,26 @@ func (client *WorkloadNetworksClient) deleteVMGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get a private cloud workload network. +// Get - Get a WorkloadNetwork // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - workloadNetworkName - Name for the workload network in the private cloud // - options - WorkloadNetworksClientGetOptions contains the optional parameters for the WorkloadNetworksClient.Get method. -func (client *WorkloadNetworksClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, workloadNetworkName WorkloadNetworkName, options *WorkloadNetworksClientGetOptions) (WorkloadNetworksClientGetResponse, error) { +func (client *WorkloadNetworksClient) Get(ctx context.Context, resourceGroupName string, privateCloudName string, options *WorkloadNetworksClientGetOptions) (WorkloadNetworksClientGetResponse, error) { var err error const operationName = "WorkloadNetworksClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, privateCloudName, workloadNetworkName, options) + req, err := client.getCreateRequest(ctx, resourceGroupName, privateCloudName, options) if err != nil { return WorkloadNetworksClientGetResponse{}, err } @@ -1236,8 +1249,8 @@ func (client *WorkloadNetworksClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *WorkloadNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, workloadNetworkName WorkloadNetworkName, options *WorkloadNetworksClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}" +func (client *WorkloadNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, options *WorkloadNetworksClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -1250,16 +1263,12 @@ func (client *WorkloadNetworksClient) getCreateRequest(ctx context.Context, reso return nil, errors.New("parameter privateCloudName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateCloudName}", url.PathEscape(privateCloudName)) - if workloadNetworkName == "" { - return nil, errors.New("parameter workloadNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{workloadNetworkName}", url.PathEscape(string(workloadNetworkName))) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1274,13 +1283,13 @@ func (client *WorkloadNetworksClient) getHandleResponse(resp *http.Response) (Wo return result, nil } -// GetDNSService - Get a DNS service by id in a private cloud workload network. +// GetDNSService - Get a WorkloadNetworkDnsService // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - dnsServiceID - NSX DNS Service identifier. Generally the same as the DNS Service's display name +// - dnsServiceID - ID of the DNS service. // - options - WorkloadNetworksClientGetDNSServiceOptions contains the optional parameters for the WorkloadNetworksClient.GetDNSService // method. func (client *WorkloadNetworksClient) GetDNSService(ctx context.Context, resourceGroupName string, privateCloudName string, dnsServiceID string, options *WorkloadNetworksClientGetDNSServiceOptions) (WorkloadNetworksClientGetDNSServiceResponse, error) { @@ -1329,7 +1338,7 @@ func (client *WorkloadNetworksClient) getDNSServiceCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1344,13 +1353,13 @@ func (client *WorkloadNetworksClient) getDNSServiceHandleResponse(resp *http.Res return result, nil } -// GetDNSZone - Get a DNS zone by id in a private cloud workload network. +// GetDNSZone - Get a WorkloadNetworkDnsZone // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - dnsZoneID - NSX DNS Zone identifier. Generally the same as the DNS Zone's display name +// - dnsZoneID - ID of the DNS zone. // - options - WorkloadNetworksClientGetDNSZoneOptions contains the optional parameters for the WorkloadNetworksClient.GetDNSZone // method. func (client *WorkloadNetworksClient) GetDNSZone(ctx context.Context, resourceGroupName string, privateCloudName string, dnsZoneID string, options *WorkloadNetworksClientGetDNSZoneOptions) (WorkloadNetworksClientGetDNSZoneResponse, error) { @@ -1399,7 +1408,7 @@ func (client *WorkloadNetworksClient) getDNSZoneCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1414,12 +1423,12 @@ func (client *WorkloadNetworksClient) getDNSZoneHandleResponse(resp *http.Respon return result, nil } -// GetDhcp - Get dhcp by id in a private cloud workload network. +// GetDhcp - Get a WorkloadNetworkDhcp // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - dhcpID - NSX DHCP identifier. Generally the same as the DHCP display name +// - dhcpID - The ID of the DHCP configuration // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientGetDhcpOptions contains the optional parameters for the WorkloadNetworksClient.GetDhcp // method. @@ -1469,7 +1478,7 @@ func (client *WorkloadNetworksClient) getDhcpCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1484,13 +1493,13 @@ func (client *WorkloadNetworksClient) getDhcpHandleResponse(resp *http.Response) return result, nil } -// GetGateway - Get a gateway by id in a private cloud workload network. +// GetGateway - Get a WorkloadNetworkGateway // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - gatewayID - NSX Gateway identifier. Generally the same as the Gateway's display name +// - gatewayID - The ID of the NSX Gateway // - options - WorkloadNetworksClientGetGatewayOptions contains the optional parameters for the WorkloadNetworksClient.GetGateway // method. func (client *WorkloadNetworksClient) GetGateway(ctx context.Context, resourceGroupName string, privateCloudName string, gatewayID string, options *WorkloadNetworksClientGetGatewayOptions) (WorkloadNetworksClientGetGatewayResponse, error) { @@ -1539,7 +1548,7 @@ func (client *WorkloadNetworksClient) getGatewayCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1554,13 +1563,13 @@ func (client *WorkloadNetworksClient) getGatewayHandleResponse(resp *http.Respon return result, nil } -// GetPortMirroring - Get a port mirroring profile by id in a private cloud workload network. +// GetPortMirroring - Get a WorkloadNetworkPortMirroring // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - portMirroringID - NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name +// - portMirroringID - ID of the NSX port mirroring profile. // - options - WorkloadNetworksClientGetPortMirroringOptions contains the optional parameters for the WorkloadNetworksClient.GetPortMirroring // method. func (client *WorkloadNetworksClient) GetPortMirroring(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, options *WorkloadNetworksClientGetPortMirroringOptions) (WorkloadNetworksClientGetPortMirroringResponse, error) { @@ -1609,7 +1618,7 @@ func (client *WorkloadNetworksClient) getPortMirroringCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1624,13 +1633,13 @@ func (client *WorkloadNetworksClient) getPortMirroringHandleResponse(resp *http. return result, nil } -// GetPublicIP - Get a Public IP Block by id in a private cloud workload network. +// GetPublicIP - Get a WorkloadNetworkPublicIP // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - publicIPID - NSX Public IP Block identifier. Generally the same as the Public IP Block's display name +// - publicIPID - ID of the DNS zone. // - options - WorkloadNetworksClientGetPublicIPOptions contains the optional parameters for the WorkloadNetworksClient.GetPublicIP // method. func (client *WorkloadNetworksClient) GetPublicIP(ctx context.Context, resourceGroupName string, privateCloudName string, publicIPID string, options *WorkloadNetworksClientGetPublicIPOptions) (WorkloadNetworksClientGetPublicIPResponse, error) { @@ -1679,7 +1688,7 @@ func (client *WorkloadNetworksClient) getPublicIPCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1694,13 +1703,13 @@ func (client *WorkloadNetworksClient) getPublicIPHandleResponse(resp *http.Respo return result, nil } -// GetSegment - Get a segment by id in a private cloud workload network. +// GetSegment - Get a WorkloadNetworkSegment // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - segmentID - NSX Segment identifier. Generally the same as the Segment's display name +// - segmentID - The ID of the NSX Segment // - options - WorkloadNetworksClientGetSegmentOptions contains the optional parameters for the WorkloadNetworksClient.GetSegment // method. func (client *WorkloadNetworksClient) GetSegment(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, options *WorkloadNetworksClientGetSegmentOptions) (WorkloadNetworksClientGetSegmentResponse, error) { @@ -1749,7 +1758,7 @@ func (client *WorkloadNetworksClient) getSegmentCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1764,13 +1773,13 @@ func (client *WorkloadNetworksClient) getSegmentHandleResponse(resp *http.Respon return result, nil } -// GetVMGroup - Get a vm group by id in a private cloud workload network. +// GetVMGroup - Get a WorkloadNetworkVMGroup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - vmGroupID - NSX VM Group identifier. Generally the same as the VM Group's display name +// - vmGroupID - ID of the VM group. // - options - WorkloadNetworksClientGetVMGroupOptions contains the optional parameters for the WorkloadNetworksClient.GetVMGroup // method. func (client *WorkloadNetworksClient) GetVMGroup(ctx context.Context, resourceGroupName string, privateCloudName string, vmGroupID string, options *WorkloadNetworksClientGetVMGroupOptions) (WorkloadNetworksClientGetVMGroupResponse, error) { @@ -1819,7 +1828,7 @@ func (client *WorkloadNetworksClient) getVMGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1834,13 +1843,13 @@ func (client *WorkloadNetworksClient) getVMGroupHandleResponse(resp *http.Respon return result, nil } -// GetVirtualMachine - Get a virtual machine by id in a private cloud workload network. +// GetVirtualMachine - Get a WorkloadNetworkVirtualMachine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - virtualMachineID - Virtual Machine identifier +// - virtualMachineID - ID of the virtual machine. // - options - WorkloadNetworksClientGetVirtualMachineOptions contains the optional parameters for the WorkloadNetworksClient.GetVirtualMachine // method. func (client *WorkloadNetworksClient) GetVirtualMachine(ctx context.Context, resourceGroupName string, privateCloudName string, virtualMachineID string, options *WorkloadNetworksClientGetVirtualMachineOptions) (WorkloadNetworksClientGetVirtualMachineResponse, error) { @@ -1889,7 +1898,7 @@ func (client *WorkloadNetworksClient) getVirtualMachineCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1904,9 +1913,9 @@ func (client *WorkloadNetworksClient) getVirtualMachineHandleResponse(resp *http return result, nil } -// NewListPager - List of workload networks in a private cloud. +// NewListPager - List WorkloadNetwork resources by PrivateCloud // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientListOptions contains the optional parameters for the WorkloadNetworksClient.NewListPager @@ -1954,7 +1963,7 @@ func (client *WorkloadNetworksClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1963,15 +1972,15 @@ func (client *WorkloadNetworksClient) listCreateRequest(ctx context.Context, res // listHandleResponse handles the List response. func (client *WorkloadNetworksClient) listHandleResponse(resp *http.Response) (WorkloadNetworksClientListResponse, error) { result := WorkloadNetworksClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkListResult); err != nil { return WorkloadNetworksClientListResponse{}, err } return result, nil } -// NewListDNSServicesPager - List of DNS services in a private cloud workload network. +// NewListDNSServicesPager - List WorkloadNetworkDnsService resources by WorkloadNetwork // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientListDNSServicesOptions contains the optional parameters for the WorkloadNetworksClient.NewListDNSServicesPager @@ -2019,7 +2028,7 @@ func (client *WorkloadNetworksClient) listDNSServicesCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2028,15 +2037,15 @@ func (client *WorkloadNetworksClient) listDNSServicesCreateRequest(ctx context.C // listDNSServicesHandleResponse handles the ListDNSServices response. func (client *WorkloadNetworksClient) listDNSServicesHandleResponse(resp *http.Response) (WorkloadNetworksClientListDNSServicesResponse, error) { result := WorkloadNetworksClientListDNSServicesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkDNSServicesList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkDNSServiceListResult); err != nil { return WorkloadNetworksClientListDNSServicesResponse{}, err } return result, nil } -// NewListDNSZonesPager - List of DNS zones in a private cloud workload network. +// NewListDNSZonesPager - List WorkloadNetworkDnsZone resources by WorkloadNetwork // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientListDNSZonesOptions contains the optional parameters for the WorkloadNetworksClient.NewListDNSZonesPager @@ -2084,7 +2093,7 @@ func (client *WorkloadNetworksClient) listDNSZonesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2093,15 +2102,15 @@ func (client *WorkloadNetworksClient) listDNSZonesCreateRequest(ctx context.Cont // listDNSZonesHandleResponse handles the ListDNSZones response. func (client *WorkloadNetworksClient) listDNSZonesHandleResponse(resp *http.Response) (WorkloadNetworksClientListDNSZonesResponse, error) { result := WorkloadNetworksClientListDNSZonesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkDNSZonesList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkDNSZoneListResult); err != nil { return WorkloadNetworksClientListDNSZonesResponse{}, err } return result, nil } -// NewListDhcpPager - List dhcp in a private cloud workload network. +// NewListDhcpPager - List WorkloadNetworkDhcp resources by WorkloadNetwork // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientListDhcpOptions contains the optional parameters for the WorkloadNetworksClient.NewListDhcpPager @@ -2149,7 +2158,7 @@ func (client *WorkloadNetworksClient) listDhcpCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2158,15 +2167,15 @@ func (client *WorkloadNetworksClient) listDhcpCreateRequest(ctx context.Context, // listDhcpHandleResponse handles the ListDhcp response. func (client *WorkloadNetworksClient) listDhcpHandleResponse(resp *http.Response) (WorkloadNetworksClientListDhcpResponse, error) { result := WorkloadNetworksClientListDhcpResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkDhcpList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkDhcpListResult); err != nil { return WorkloadNetworksClientListDhcpResponse{}, err } return result, nil } -// NewListGatewaysPager - List of gateways in a private cloud workload network. +// NewListGatewaysPager - List WorkloadNetworkGateway resources by WorkloadNetwork // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientListGatewaysOptions contains the optional parameters for the WorkloadNetworksClient.NewListGatewaysPager @@ -2214,7 +2223,7 @@ func (client *WorkloadNetworksClient) listGatewaysCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2223,15 +2232,15 @@ func (client *WorkloadNetworksClient) listGatewaysCreateRequest(ctx context.Cont // listGatewaysHandleResponse handles the ListGateways response. func (client *WorkloadNetworksClient) listGatewaysHandleResponse(resp *http.Response) (WorkloadNetworksClientListGatewaysResponse, error) { result := WorkloadNetworksClientListGatewaysResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkGatewayList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkGatewayListResult); err != nil { return WorkloadNetworksClientListGatewaysResponse{}, err } return result, nil } -// NewListPortMirroringPager - List of port mirroring profiles in a private cloud workload network. +// NewListPortMirroringPager - List WorkloadNetworkPortMirroring resources by WorkloadNetwork // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientListPortMirroringOptions contains the optional parameters for the WorkloadNetworksClient.NewListPortMirroringPager @@ -2279,7 +2288,7 @@ func (client *WorkloadNetworksClient) listPortMirroringCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2288,15 +2297,15 @@ func (client *WorkloadNetworksClient) listPortMirroringCreateRequest(ctx context // listPortMirroringHandleResponse handles the ListPortMirroring response. func (client *WorkloadNetworksClient) listPortMirroringHandleResponse(resp *http.Response) (WorkloadNetworksClientListPortMirroringResponse, error) { result := WorkloadNetworksClientListPortMirroringResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkPortMirroringList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkPortMirroringListResult); err != nil { return WorkloadNetworksClientListPortMirroringResponse{}, err } return result, nil } -// NewListPublicIPsPager - List of Public IP Blocks in a private cloud workload network. +// NewListPublicIPsPager - List WorkloadNetworkPublicIP resources by WorkloadNetwork // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientListPublicIPsOptions contains the optional parameters for the WorkloadNetworksClient.NewListPublicIPsPager @@ -2344,7 +2353,7 @@ func (client *WorkloadNetworksClient) listPublicIPsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2353,15 +2362,15 @@ func (client *WorkloadNetworksClient) listPublicIPsCreateRequest(ctx context.Con // listPublicIPsHandleResponse handles the ListPublicIPs response. func (client *WorkloadNetworksClient) listPublicIPsHandleResponse(resp *http.Response) (WorkloadNetworksClientListPublicIPsResponse, error) { result := WorkloadNetworksClientListPublicIPsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkPublicIPsList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkPublicIPListResult); err != nil { return WorkloadNetworksClientListPublicIPsResponse{}, err } return result, nil } -// NewListSegmentsPager - List of segments in a private cloud workload network. +// NewListSegmentsPager - List WorkloadNetworkSegment resources by WorkloadNetwork // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientListSegmentsOptions contains the optional parameters for the WorkloadNetworksClient.NewListSegmentsPager @@ -2409,7 +2418,7 @@ func (client *WorkloadNetworksClient) listSegmentsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2418,15 +2427,15 @@ func (client *WorkloadNetworksClient) listSegmentsCreateRequest(ctx context.Cont // listSegmentsHandleResponse handles the ListSegments response. func (client *WorkloadNetworksClient) listSegmentsHandleResponse(resp *http.Response) (WorkloadNetworksClientListSegmentsResponse, error) { result := WorkloadNetworksClientListSegmentsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkSegmentsList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkSegmentListResult); err != nil { return WorkloadNetworksClientListSegmentsResponse{}, err } return result, nil } -// NewListVMGroupsPager - List of vm groups in a private cloud workload network. +// NewListVMGroupsPager - List WorkloadNetworkVMGroup resources by WorkloadNetwork // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientListVMGroupsOptions contains the optional parameters for the WorkloadNetworksClient.NewListVMGroupsPager @@ -2474,7 +2483,7 @@ func (client *WorkloadNetworksClient) listVMGroupsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2483,15 +2492,15 @@ func (client *WorkloadNetworksClient) listVMGroupsCreateRequest(ctx context.Cont // listVMGroupsHandleResponse handles the ListVMGroups response. func (client *WorkloadNetworksClient) listVMGroupsHandleResponse(resp *http.Response) (WorkloadNetworksClientListVMGroupsResponse, error) { result := WorkloadNetworksClientListVMGroupsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkVMGroupsList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkVMGroupListResult); err != nil { return WorkloadNetworksClientListVMGroupsResponse{}, err } return result, nil } -// NewListVirtualMachinesPager - List of virtual machines in a private cloud workload network. +// NewListVirtualMachinesPager - List WorkloadNetworkVirtualMachine resources by WorkloadNetwork // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud // - options - WorkloadNetworksClientListVirtualMachinesOptions contains the optional parameters for the WorkloadNetworksClient.NewListVirtualMachinesPager @@ -2539,7 +2548,7 @@ func (client *WorkloadNetworksClient) listVirtualMachinesCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2548,30 +2557,31 @@ func (client *WorkloadNetworksClient) listVirtualMachinesCreateRequest(ctx conte // listVirtualMachinesHandleResponse handles the ListVirtualMachines response. func (client *WorkloadNetworksClient) listVirtualMachinesHandleResponse(resp *http.Response) (WorkloadNetworksClientListVirtualMachinesResponse, error) { result := WorkloadNetworksClientListVirtualMachinesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkVirtualMachinesList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.WorkloadNetworkVirtualMachineListResult); err != nil { return WorkloadNetworksClientListVirtualMachinesResponse{}, err } return result, nil } -// BeginUpdateDNSService - Create or update a DNS service by id in a private cloud workload network. +// BeginUpdateDNSService - Update a WorkloadNetworkDnsService // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - dnsServiceID - NSX DNS Service identifier. Generally the same as the DNS Service's display name -// - workloadNetworkDNSService - NSX DNS Service +// - dnsServiceID - ID of the DNS service. +// - workloadNetworkDNSService - The resource properties to be updated. // - options - WorkloadNetworksClientBeginUpdateDNSServiceOptions contains the optional parameters for the WorkloadNetworksClient.BeginUpdateDNSService // method. -func (client *WorkloadNetworksClient) BeginUpdateDNSService(ctx context.Context, resourceGroupName string, privateCloudName string, dnsServiceID string, workloadNetworkDNSService WorkloadNetworkDNSService, options *WorkloadNetworksClientBeginUpdateDNSServiceOptions) (*runtime.Poller[WorkloadNetworksClientUpdateDNSServiceResponse], error) { +func (client *WorkloadNetworksClient) BeginUpdateDNSService(ctx context.Context, resourceGroupName string, privateCloudName string, dnsServiceID string, workloadNetworkDNSService WorkloadNetworkDNSServiceUpdate, options *WorkloadNetworksClientBeginUpdateDNSServiceOptions) (*runtime.Poller[WorkloadNetworksClientUpdateDNSServiceResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updateDNSService(ctx, resourceGroupName, privateCloudName, dnsServiceID, workloadNetworkDNSService, options) if err != nil { return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientUpdateDNSServiceResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -2581,11 +2591,11 @@ func (client *WorkloadNetworksClient) BeginUpdateDNSService(ctx context.Context, } } -// UpdateDNSService - Create or update a DNS service by id in a private cloud workload network. +// UpdateDNSService - Update a WorkloadNetworkDnsService // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 -func (client *WorkloadNetworksClient) updateDNSService(ctx context.Context, resourceGroupName string, privateCloudName string, dnsServiceID string, workloadNetworkDNSService WorkloadNetworkDNSService, options *WorkloadNetworksClientBeginUpdateDNSServiceOptions) (*http.Response, error) { +// Generated from API version 2023-09-01 +func (client *WorkloadNetworksClient) updateDNSService(ctx context.Context, resourceGroupName string, privateCloudName string, dnsServiceID string, workloadNetworkDNSService WorkloadNetworkDNSServiceUpdate, options *WorkloadNetworksClientBeginUpdateDNSServiceOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginUpdateDNSService" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -2607,7 +2617,7 @@ func (client *WorkloadNetworksClient) updateDNSService(ctx context.Context, reso } // updateDNSServiceCreateRequest creates the UpdateDNSService request. -func (client *WorkloadNetworksClient) updateDNSServiceCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, dnsServiceID string, workloadNetworkDNSService WorkloadNetworkDNSService, options *WorkloadNetworksClientBeginUpdateDNSServiceOptions) (*policy.Request, error) { +func (client *WorkloadNetworksClient) updateDNSServiceCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, dnsServiceID string, workloadNetworkDNSService WorkloadNetworkDNSServiceUpdate, options *WorkloadNetworksClientBeginUpdateDNSServiceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -2630,7 +2640,7 @@ func (client *WorkloadNetworksClient) updateDNSServiceCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkDNSService); err != nil { @@ -2639,24 +2649,25 @@ func (client *WorkloadNetworksClient) updateDNSServiceCreateRequest(ctx context. return req, nil } -// BeginUpdateDNSZone - Create or update a DNS zone by id in a private cloud workload network. +// BeginUpdateDNSZone - Update a WorkloadNetworkDnsZone // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - dnsZoneID - NSX DNS Zone identifier. Generally the same as the DNS Zone's display name -// - workloadNetworkDNSZone - NSX DNS Zone +// - dnsZoneID - ID of the DNS zone. +// - workloadNetworkDNSZone - The resource properties to be updated. // - options - WorkloadNetworksClientBeginUpdateDNSZoneOptions contains the optional parameters for the WorkloadNetworksClient.BeginUpdateDNSZone // method. -func (client *WorkloadNetworksClient) BeginUpdateDNSZone(ctx context.Context, resourceGroupName string, privateCloudName string, dnsZoneID string, workloadNetworkDNSZone WorkloadNetworkDNSZone, options *WorkloadNetworksClientBeginUpdateDNSZoneOptions) (*runtime.Poller[WorkloadNetworksClientUpdateDNSZoneResponse], error) { +func (client *WorkloadNetworksClient) BeginUpdateDNSZone(ctx context.Context, resourceGroupName string, privateCloudName string, dnsZoneID string, workloadNetworkDNSZone WorkloadNetworkDNSZoneUpdate, options *WorkloadNetworksClientBeginUpdateDNSZoneOptions) (*runtime.Poller[WorkloadNetworksClientUpdateDNSZoneResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updateDNSZone(ctx, resourceGroupName, privateCloudName, dnsZoneID, workloadNetworkDNSZone, options) if err != nil { return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientUpdateDNSZoneResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -2666,11 +2677,11 @@ func (client *WorkloadNetworksClient) BeginUpdateDNSZone(ctx context.Context, re } } -// UpdateDNSZone - Create or update a DNS zone by id in a private cloud workload network. +// UpdateDNSZone - Update a WorkloadNetworkDnsZone // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 -func (client *WorkloadNetworksClient) updateDNSZone(ctx context.Context, resourceGroupName string, privateCloudName string, dnsZoneID string, workloadNetworkDNSZone WorkloadNetworkDNSZone, options *WorkloadNetworksClientBeginUpdateDNSZoneOptions) (*http.Response, error) { +// Generated from API version 2023-09-01 +func (client *WorkloadNetworksClient) updateDNSZone(ctx context.Context, resourceGroupName string, privateCloudName string, dnsZoneID string, workloadNetworkDNSZone WorkloadNetworkDNSZoneUpdate, options *WorkloadNetworksClientBeginUpdateDNSZoneOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginUpdateDNSZone" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -2692,7 +2703,7 @@ func (client *WorkloadNetworksClient) updateDNSZone(ctx context.Context, resourc } // updateDNSZoneCreateRequest creates the UpdateDNSZone request. -func (client *WorkloadNetworksClient) updateDNSZoneCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, dnsZoneID string, workloadNetworkDNSZone WorkloadNetworkDNSZone, options *WorkloadNetworksClientBeginUpdateDNSZoneOptions) (*policy.Request, error) { +func (client *WorkloadNetworksClient) updateDNSZoneCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, dnsZoneID string, workloadNetworkDNSZone WorkloadNetworkDNSZoneUpdate, options *WorkloadNetworksClientBeginUpdateDNSZoneOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -2715,7 +2726,7 @@ func (client *WorkloadNetworksClient) updateDNSZoneCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkDNSZone); err != nil { @@ -2724,24 +2735,25 @@ func (client *WorkloadNetworksClient) updateDNSZoneCreateRequest(ctx context.Con return req, nil } -// BeginUpdateDhcp - Create or update dhcp by id in a private cloud workload network. +// BeginUpdateDhcp - Update a WorkloadNetworkDhcp // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - dhcpID - NSX DHCP identifier. Generally the same as the DHCP display name -// - workloadNetworkDhcp - NSX DHCP +// - dhcpID - The ID of the DHCP configuration +// - workloadNetworkDhcp - The resource properties to be updated. // - options - WorkloadNetworksClientBeginUpdateDhcpOptions contains the optional parameters for the WorkloadNetworksClient.BeginUpdateDhcp // method. -func (client *WorkloadNetworksClient) BeginUpdateDhcp(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp WorkloadNetworkDhcp, options *WorkloadNetworksClientBeginUpdateDhcpOptions) (*runtime.Poller[WorkloadNetworksClientUpdateDhcpResponse], error) { +func (client *WorkloadNetworksClient) BeginUpdateDhcp(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp WorkloadNetworkDhcpUpdate, options *WorkloadNetworksClientBeginUpdateDhcpOptions) (*runtime.Poller[WorkloadNetworksClientUpdateDhcpResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updateDhcp(ctx, resourceGroupName, privateCloudName, dhcpID, workloadNetworkDhcp, options) if err != nil { return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientUpdateDhcpResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -2751,11 +2763,11 @@ func (client *WorkloadNetworksClient) BeginUpdateDhcp(ctx context.Context, resou } } -// UpdateDhcp - Create or update dhcp by id in a private cloud workload network. +// UpdateDhcp - Update a WorkloadNetworkDhcp // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 -func (client *WorkloadNetworksClient) updateDhcp(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp WorkloadNetworkDhcp, options *WorkloadNetworksClientBeginUpdateDhcpOptions) (*http.Response, error) { +// Generated from API version 2023-09-01 +func (client *WorkloadNetworksClient) updateDhcp(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp WorkloadNetworkDhcpUpdate, options *WorkloadNetworksClientBeginUpdateDhcpOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginUpdateDhcp" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -2777,7 +2789,7 @@ func (client *WorkloadNetworksClient) updateDhcp(ctx context.Context, resourceGr } // updateDhcpCreateRequest creates the UpdateDhcp request. -func (client *WorkloadNetworksClient) updateDhcpCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp WorkloadNetworkDhcp, options *WorkloadNetworksClientBeginUpdateDhcpOptions) (*policy.Request, error) { +func (client *WorkloadNetworksClient) updateDhcpCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp WorkloadNetworkDhcpUpdate, options *WorkloadNetworksClientBeginUpdateDhcpOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -2800,7 +2812,7 @@ func (client *WorkloadNetworksClient) updateDhcpCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkDhcp); err != nil { @@ -2809,24 +2821,25 @@ func (client *WorkloadNetworksClient) updateDhcpCreateRequest(ctx context.Contex return req, nil } -// BeginUpdatePortMirroring - Create or update a port mirroring profile by id in a private cloud workload network. +// BeginUpdatePortMirroring - Update a WorkloadNetworkPortMirroring // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - portMirroringID - NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name -// - workloadNetworkPortMirroring - NSX port mirroring +// - portMirroringID - ID of the NSX port mirroring profile. +// - workloadNetworkPortMirroring - The resource properties to be updated. // - options - WorkloadNetworksClientBeginUpdatePortMirroringOptions contains the optional parameters for the WorkloadNetworksClient.BeginUpdatePortMirroring // method. -func (client *WorkloadNetworksClient) BeginUpdatePortMirroring(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring WorkloadNetworkPortMirroring, options *WorkloadNetworksClientBeginUpdatePortMirroringOptions) (*runtime.Poller[WorkloadNetworksClientUpdatePortMirroringResponse], error) { +func (client *WorkloadNetworksClient) BeginUpdatePortMirroring(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring WorkloadNetworkPortMirroringUpdate, options *WorkloadNetworksClientBeginUpdatePortMirroringOptions) (*runtime.Poller[WorkloadNetworksClientUpdatePortMirroringResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updatePortMirroring(ctx, resourceGroupName, privateCloudName, portMirroringID, workloadNetworkPortMirroring, options) if err != nil { return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientUpdatePortMirroringResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -2836,11 +2849,11 @@ func (client *WorkloadNetworksClient) BeginUpdatePortMirroring(ctx context.Conte } } -// UpdatePortMirroring - Create or update a port mirroring profile by id in a private cloud workload network. +// UpdatePortMirroring - Update a WorkloadNetworkPortMirroring // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 -func (client *WorkloadNetworksClient) updatePortMirroring(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring WorkloadNetworkPortMirroring, options *WorkloadNetworksClientBeginUpdatePortMirroringOptions) (*http.Response, error) { +// Generated from API version 2023-09-01 +func (client *WorkloadNetworksClient) updatePortMirroring(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring WorkloadNetworkPortMirroringUpdate, options *WorkloadNetworksClientBeginUpdatePortMirroringOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginUpdatePortMirroring" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -2862,7 +2875,7 @@ func (client *WorkloadNetworksClient) updatePortMirroring(ctx context.Context, r } // updatePortMirroringCreateRequest creates the UpdatePortMirroring request. -func (client *WorkloadNetworksClient) updatePortMirroringCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring WorkloadNetworkPortMirroring, options *WorkloadNetworksClientBeginUpdatePortMirroringOptions) (*policy.Request, error) { +func (client *WorkloadNetworksClient) updatePortMirroringCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring WorkloadNetworkPortMirroringUpdate, options *WorkloadNetworksClientBeginUpdatePortMirroringOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -2885,7 +2898,7 @@ func (client *WorkloadNetworksClient) updatePortMirroringCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkPortMirroring); err != nil { @@ -2894,24 +2907,25 @@ func (client *WorkloadNetworksClient) updatePortMirroringCreateRequest(ctx conte return req, nil } -// BeginUpdateSegments - Create or update a segment by id in a private cloud workload network. +// BeginUpdateSegments - Update a WorkloadNetworkSegment // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - segmentID - NSX Segment identifier. Generally the same as the Segment's display name -// - workloadNetworkSegment - NSX Segment +// - segmentID - The ID of the NSX Segment +// - workloadNetworkSegment - The resource properties to be updated. // - options - WorkloadNetworksClientBeginUpdateSegmentsOptions contains the optional parameters for the WorkloadNetworksClient.BeginUpdateSegments // method. -func (client *WorkloadNetworksClient) BeginUpdateSegments(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment WorkloadNetworkSegment, options *WorkloadNetworksClientBeginUpdateSegmentsOptions) (*runtime.Poller[WorkloadNetworksClientUpdateSegmentsResponse], error) { +func (client *WorkloadNetworksClient) BeginUpdateSegments(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment WorkloadNetworkSegmentUpdate, options *WorkloadNetworksClientBeginUpdateSegmentsOptions) (*runtime.Poller[WorkloadNetworksClientUpdateSegmentsResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updateSegments(ctx, resourceGroupName, privateCloudName, segmentID, workloadNetworkSegment, options) if err != nil { return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientUpdateSegmentsResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -2921,11 +2935,11 @@ func (client *WorkloadNetworksClient) BeginUpdateSegments(ctx context.Context, r } } -// UpdateSegments - Create or update a segment by id in a private cloud workload network. +// UpdateSegments - Update a WorkloadNetworkSegment // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 -func (client *WorkloadNetworksClient) updateSegments(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment WorkloadNetworkSegment, options *WorkloadNetworksClientBeginUpdateSegmentsOptions) (*http.Response, error) { +// Generated from API version 2023-09-01 +func (client *WorkloadNetworksClient) updateSegments(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment WorkloadNetworkSegmentUpdate, options *WorkloadNetworksClientBeginUpdateSegmentsOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginUpdateSegments" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -2947,7 +2961,7 @@ func (client *WorkloadNetworksClient) updateSegments(ctx context.Context, resour } // updateSegmentsCreateRequest creates the UpdateSegments request. -func (client *WorkloadNetworksClient) updateSegmentsCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment WorkloadNetworkSegment, options *WorkloadNetworksClientBeginUpdateSegmentsOptions) (*policy.Request, error) { +func (client *WorkloadNetworksClient) updateSegmentsCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment WorkloadNetworkSegmentUpdate, options *WorkloadNetworksClientBeginUpdateSegmentsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -2970,7 +2984,7 @@ func (client *WorkloadNetworksClient) updateSegmentsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkSegment); err != nil { @@ -2979,24 +2993,25 @@ func (client *WorkloadNetworksClient) updateSegmentsCreateRequest(ctx context.Co return req, nil } -// BeginUpdateVMGroup - Create or update a vm group by id in a private cloud workload network. +// BeginUpdateVMGroup - Update a WorkloadNetworkVMGroup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 +// Generated from API version 2023-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - privateCloudName - Name of the private cloud -// - vmGroupID - NSX VM Group identifier. Generally the same as the VM Group's display name -// - workloadNetworkVMGroup - NSX VM Group +// - vmGroupID - ID of the VM group. +// - workloadNetworkVMGroup - The resource properties to be updated. // - options - WorkloadNetworksClientBeginUpdateVMGroupOptions contains the optional parameters for the WorkloadNetworksClient.BeginUpdateVMGroup // method. -func (client *WorkloadNetworksClient) BeginUpdateVMGroup(ctx context.Context, resourceGroupName string, privateCloudName string, vmGroupID string, workloadNetworkVMGroup WorkloadNetworkVMGroup, options *WorkloadNetworksClientBeginUpdateVMGroupOptions) (*runtime.Poller[WorkloadNetworksClientUpdateVMGroupResponse], error) { +func (client *WorkloadNetworksClient) BeginUpdateVMGroup(ctx context.Context, resourceGroupName string, privateCloudName string, vmGroupID string, workloadNetworkVMGroup WorkloadNetworkVMGroupUpdate, options *WorkloadNetworksClientBeginUpdateVMGroupOptions) (*runtime.Poller[WorkloadNetworksClientUpdateVMGroupResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updateVMGroup(ctx, resourceGroupName, privateCloudName, vmGroupID, workloadNetworkVMGroup, options) if err != nil { return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkloadNetworksClientUpdateVMGroupResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -3006,11 +3021,11 @@ func (client *WorkloadNetworksClient) BeginUpdateVMGroup(ctx context.Context, re } } -// UpdateVMGroup - Create or update a vm group by id in a private cloud workload network. +// UpdateVMGroup - Update a WorkloadNetworkVMGroup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-03-01 -func (client *WorkloadNetworksClient) updateVMGroup(ctx context.Context, resourceGroupName string, privateCloudName string, vmGroupID string, workloadNetworkVMGroup WorkloadNetworkVMGroup, options *WorkloadNetworksClientBeginUpdateVMGroupOptions) (*http.Response, error) { +// Generated from API version 2023-09-01 +func (client *WorkloadNetworksClient) updateVMGroup(ctx context.Context, resourceGroupName string, privateCloudName string, vmGroupID string, workloadNetworkVMGroup WorkloadNetworkVMGroupUpdate, options *WorkloadNetworksClientBeginUpdateVMGroupOptions) (*http.Response, error) { var err error const operationName = "WorkloadNetworksClient.BeginUpdateVMGroup" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -3032,7 +3047,7 @@ func (client *WorkloadNetworksClient) updateVMGroup(ctx context.Context, resourc } // updateVMGroupCreateRequest creates the UpdateVMGroup request. -func (client *WorkloadNetworksClient) updateVMGroupCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, vmGroupID string, workloadNetworkVMGroup WorkloadNetworkVMGroup, options *WorkloadNetworksClientBeginUpdateVMGroupOptions) (*policy.Request, error) { +func (client *WorkloadNetworksClient) updateVMGroupCreateRequest(ctx context.Context, resourceGroupName string, privateCloudName string, vmGroupID string, workloadNetworkVMGroup WorkloadNetworkVMGroupUpdate, options *WorkloadNetworksClientBeginUpdateVMGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -3055,7 +3070,7 @@ func (client *WorkloadNetworksClient) updateVMGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01") + reqQP.Set("api-version", "2023-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, workloadNetworkVMGroup); err != nil { diff --git a/sdk/resourcemanager/avs/armavs/workloadnetworks_client_example_test.go b/sdk/resourcemanager/avs/armavs/workloadnetworks_client_example_test.go deleted file mode 100644 index 053485375e8a..000000000000 --- a/sdk/resourcemanager/avs/armavs/workloadnetworks_client_example_test.go +++ /dev/null @@ -1,1496 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armavs_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_Get.json -func ExampleWorkloadNetworksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkloadNetworksClient().Get(ctx, "group1", "cloud1", armavs.WorkloadNetworkNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetwork = armavs.WorkloadNetwork{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_List.json -func ExampleWorkloadNetworksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkloadNetworksClient().NewListPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadNetworkList = armavs.WorkloadNetworkList{ - // Value: []*armavs.WorkloadNetwork{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListSegments.json -func ExampleWorkloadNetworksClient_NewListSegmentsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkloadNetworksClient().NewListSegmentsPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadNetworkSegmentsList = armavs.WorkloadNetworkSegmentsList{ - // Value: []*armavs.WorkloadNetworkSegment{ - // { - // Name: to.Ptr("segment1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/segments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/segments/segment1"), - // Properties: &armavs.WorkloadNetworkSegmentProperties{ - // ConnectedGateway: to.Ptr("/infra/tier-1s/gateway"), - // DisplayName: to.Ptr("segment1"), - // PortVif: []*armavs.WorkloadNetworkSegmentPortVif{ - // { - // PortName: to.Ptr("vm1"), - // }}, - // Revision: to.Ptr[int64](1), - // Status: to.Ptr(armavs.SegmentStatusEnumSUCCESS), - // Subnet: &armavs.WorkloadNetworkSegmentSubnet{ - // DhcpRanges: []*string{ - // to.Ptr("40.20.0.0-40.20.0.1")}, - // GatewayAddress: to.Ptr("40.20.20.20/16"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetSegments.json -func ExampleWorkloadNetworksClient_GetSegment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkloadNetworksClient().GetSegment(ctx, "group1", "cloud1", "segment1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkSegment = armavs.WorkloadNetworkSegment{ - // Name: to.Ptr("segment1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/segments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/segments/segment1"), - // Properties: &armavs.WorkloadNetworkSegmentProperties{ - // ConnectedGateway: to.Ptr("/infra/tier-1s/gateway"), - // DisplayName: to.Ptr("segment1"), - // PortVif: []*armavs.WorkloadNetworkSegmentPortVif{ - // { - // PortName: to.Ptr("vm1"), - // }}, - // Revision: to.Ptr[int64](1), - // Status: to.Ptr(armavs.SegmentStatusEnumSUCCESS), - // Subnet: &armavs.WorkloadNetworkSegmentSubnet{ - // DhcpRanges: []*string{ - // to.Ptr("40.20.0.0-40.20.0.1")}, - // GatewayAddress: to.Ptr("40.20.20.20/16"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateSegments.json -func ExampleWorkloadNetworksClient_BeginCreateSegments() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginCreateSegments(ctx, "group1", "cloud1", "segment1", armavs.WorkloadNetworkSegment{ - Properties: &armavs.WorkloadNetworkSegmentProperties{ - ConnectedGateway: to.Ptr("/infra/tier-1s/gateway"), - DisplayName: to.Ptr("segment1"), - Revision: to.Ptr[int64](1), - Subnet: &armavs.WorkloadNetworkSegmentSubnet{ - DhcpRanges: []*string{ - to.Ptr("40.20.0.0-40.20.0.1")}, - GatewayAddress: to.Ptr("40.20.20.20/16"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkSegment = armavs.WorkloadNetworkSegment{ - // Name: to.Ptr("segment1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/segments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/segments/segment1"), - // Properties: &armavs.WorkloadNetworkSegmentProperties{ - // ConnectedGateway: to.Ptr("/infra/tier-1s/gateway"), - // DisplayName: to.Ptr("segment1"), - // PortVif: []*armavs.WorkloadNetworkSegmentPortVif{ - // }, - // Revision: to.Ptr[int64](1), - // Status: to.Ptr(armavs.SegmentStatusEnumSUCCESS), - // Subnet: &armavs.WorkloadNetworkSegmentSubnet{ - // DhcpRanges: []*string{ - // to.Ptr("40.20.0.0-40.20.0.1")}, - // GatewayAddress: to.Ptr("40.20.20.20/16"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateSegments.json -func ExampleWorkloadNetworksClient_BeginUpdateSegments() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginUpdateSegments(ctx, "group1", "cloud1", "segment1", armavs.WorkloadNetworkSegment{ - Properties: &armavs.WorkloadNetworkSegmentProperties{ - ConnectedGateway: to.Ptr("/infra/tier-1s/gateway"), - Revision: to.Ptr[int64](1), - Subnet: &armavs.WorkloadNetworkSegmentSubnet{ - DhcpRanges: []*string{ - to.Ptr("40.20.0.0-40.20.0.1")}, - GatewayAddress: to.Ptr("40.20.20.20/16"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkSegment = armavs.WorkloadNetworkSegment{ - // Name: to.Ptr("segment1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/segments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/segments/segment1"), - // Properties: &armavs.WorkloadNetworkSegmentProperties{ - // ConnectedGateway: to.Ptr("/infra/tier-1s/gateway"), - // DisplayName: to.Ptr("segment1"), - // PortVif: []*armavs.WorkloadNetworkSegmentPortVif{ - // { - // PortName: to.Ptr("vm1"), - // }}, - // Revision: to.Ptr[int64](2), - // Status: to.Ptr(armavs.SegmentStatusEnumSUCCESS), - // Subnet: &armavs.WorkloadNetworkSegmentSubnet{ - // DhcpRanges: []*string{ - // to.Ptr("40.20.0.0-40.20.0.1")}, - // GatewayAddress: to.Ptr("40.20.20.20/16"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteSegments.json -func ExampleWorkloadNetworksClient_BeginDeleteSegment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginDeleteSegment(ctx, "group1", "cloud1", "segment1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListDhcpConfigurations.json -func ExampleWorkloadNetworksClient_NewListDhcpPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkloadNetworksClient().NewListDhcpPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadNetworkDhcpList = armavs.WorkloadNetworkDhcpList{ - // Value: []*armavs.WorkloadNetworkDhcp{ - // { - // Name: to.Ptr("dhcp1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/dhcpConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/dhcpConfigurations/dhcpConfigurations1"), - // Properties: &armavs.WorkloadNetworkDhcpServer{ - // DhcpType: to.Ptr(armavs.DhcpTypeEnumSERVER), - // DisplayName: to.Ptr("dhcpConfigurations1"), - // Revision: to.Ptr[int64](1), - // Segments: []*string{ - // to.Ptr("segment1"), - // to.Ptr("segment2")}, - // LeaseTime: to.Ptr[int64](86400), - // ServerAddress: to.Ptr("40.1.5.1/24"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetDhcpConfigurations.json -func ExampleWorkloadNetworksClient_GetDhcp() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkloadNetworksClient().GetDhcp(ctx, "group1", "dhcp1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkDhcp = armavs.WorkloadNetworkDhcp{ - // Name: to.Ptr("dhcp1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/dhcpConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/dhcpConfigurations/dhcpConfigurations1"), - // Properties: &armavs.WorkloadNetworkDhcpServer{ - // DhcpType: to.Ptr(armavs.DhcpTypeEnumSERVER), - // DisplayName: to.Ptr("dhcpConfigurations1"), - // Revision: to.Ptr[int64](1), - // Segments: []*string{ - // to.Ptr("segment1"), - // to.Ptr("segment2")}, - // LeaseTime: to.Ptr[int64](86400), - // ServerAddress: to.Ptr("40.1.5.1/24"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateDhcpConfigurations.json -func ExampleWorkloadNetworksClient_BeginCreateDhcp() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginCreateDhcp(ctx, "group1", "cloud1", "dhcp1", armavs.WorkloadNetworkDhcp{ - Properties: &armavs.WorkloadNetworkDhcpServer{ - DhcpType: to.Ptr(armavs.DhcpTypeEnumSERVER), - DisplayName: to.Ptr("dhcpConfigurations1"), - Revision: to.Ptr[int64](1), - LeaseTime: to.Ptr[int64](86400), - ServerAddress: to.Ptr("40.1.5.1/24"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkDhcp = armavs.WorkloadNetworkDhcp{ - // Name: to.Ptr("dhcp1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/dhcpConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/dhcpConfigurations/dhcpConfigurations1"), - // Properties: &armavs.WorkloadNetworkDhcpServer{ - // DhcpType: to.Ptr(armavs.DhcpTypeEnumSERVER), - // DisplayName: to.Ptr("dhcpConfigurations1"), - // Revision: to.Ptr[int64](1), - // Segments: []*string{ - // to.Ptr("segment1"), - // to.Ptr("segment2")}, - // LeaseTime: to.Ptr[int64](86400), - // ServerAddress: to.Ptr("40.1.5.1/24"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateDhcpConfigurations.json -func ExampleWorkloadNetworksClient_BeginUpdateDhcp() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginUpdateDhcp(ctx, "group1", "cloud1", "dhcp1", armavs.WorkloadNetworkDhcp{ - Properties: &armavs.WorkloadNetworkDhcpServer{ - DhcpType: to.Ptr(armavs.DhcpTypeEnumSERVER), - Revision: to.Ptr[int64](1), - LeaseTime: to.Ptr[int64](86400), - ServerAddress: to.Ptr("40.1.5.1/24"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkDhcp = armavs.WorkloadNetworkDhcp{ - // Name: to.Ptr("dhcp1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/dhcpConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/dhcpConfigurations/dhcpConfigurations1"), - // Properties: &armavs.WorkloadNetworkDhcpServer{ - // DhcpType: to.Ptr(armavs.DhcpTypeEnumSERVER), - // DisplayName: to.Ptr("dhcpConfigurations1"), - // Revision: to.Ptr[int64](2), - // Segments: []*string{ - // to.Ptr("segment1"), - // to.Ptr("segment2")}, - // LeaseTime: to.Ptr[int64](86400), - // ServerAddress: to.Ptr("40.1.5.1/24"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteDhcpConfigurations.json -func ExampleWorkloadNetworksClient_BeginDeleteDhcp() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginDeleteDhcp(ctx, "group1", "cloud1", "dhcp1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListGateways.json -func ExampleWorkloadNetworksClient_NewListGatewaysPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkloadNetworksClient().NewListGatewaysPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadNetworkGatewayList = armavs.WorkloadNetworkGatewayList{ - // Value: []*armavs.WorkloadNetworkGateway{ - // { - // Name: to.Ptr("gateway1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/segments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/gateways/gateway1"), - // Properties: &armavs.WorkloadNetworkGatewayProperties{ - // Path: to.Ptr("/infra/tier-1s/gateway1"), - // DisplayName: to.Ptr("gateway1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetGateway.json -func ExampleWorkloadNetworksClient_GetGateway() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkloadNetworksClient().GetGateway(ctx, "group1", "cloud1", "gateway1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkGateway = armavs.WorkloadNetworkGateway{ - // Name: to.Ptr("gateway1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/gateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/gateways/gateway1"), - // Properties: &armavs.WorkloadNetworkGatewayProperties{ - // Path: to.Ptr("/infra/tier-1s/gateway1"), - // DisplayName: to.Ptr("gateway1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListPortMirroringProfiles.json -func ExampleWorkloadNetworksClient_NewListPortMirroringPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkloadNetworksClient().NewListPortMirroringPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadNetworkPortMirroringList = armavs.WorkloadNetworkPortMirroringList{ - // Value: []*armavs.WorkloadNetworkPortMirroring{ - // { - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/portMirroringProfiles"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/portMirroringProfiles/portMirroring1"), - // Properties: &armavs.WorkloadNetworkPortMirroringProperties{ - // Destination: to.Ptr("vmGroup2"), - // Direction: to.Ptr(armavs.PortMirroringDirectionEnumBIDIRECTIONAL), - // DisplayName: to.Ptr("portMirroring1"), - // Revision: to.Ptr[int64](1), - // Source: to.Ptr("vmGroup1"), - // Status: to.Ptr(armavs.PortMirroringStatusEnumSUCCESS), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetPortMirroringProfiles.json -func ExampleWorkloadNetworksClient_GetPortMirroring() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkloadNetworksClient().GetPortMirroring(ctx, "group1", "cloud1", "portMirroring1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkPortMirroring = armavs.WorkloadNetworkPortMirroring{ - // Name: to.Ptr("portMirroring1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/portMirroringProfiles"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/portMirroringProfiles/portMirroring1"), - // Properties: &armavs.WorkloadNetworkPortMirroringProperties{ - // Destination: to.Ptr("vmGroup2"), - // Direction: to.Ptr(armavs.PortMirroringDirectionEnumBIDIRECTIONAL), - // DisplayName: to.Ptr("portMirroring1"), - // Revision: to.Ptr[int64](1), - // Source: to.Ptr("vmGroup1"), - // Status: to.Ptr(armavs.PortMirroringStatusEnumSUCCESS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreatePortMirroringProfiles.json -func ExampleWorkloadNetworksClient_BeginCreatePortMirroring() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginCreatePortMirroring(ctx, "group1", "cloud1", "portMirroring1", armavs.WorkloadNetworkPortMirroring{ - Properties: &armavs.WorkloadNetworkPortMirroringProperties{ - Destination: to.Ptr("vmGroup2"), - Direction: to.Ptr(armavs.PortMirroringDirectionEnumBIDIRECTIONAL), - DisplayName: to.Ptr("portMirroring1"), - Revision: to.Ptr[int64](1), - Source: to.Ptr("vmGroup1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkPortMirroring = armavs.WorkloadNetworkPortMirroring{ - // Name: to.Ptr("portMirroring1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/portMirroringProfiles"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/portMirroringProfiles/portMirroring1"), - // Properties: &armavs.WorkloadNetworkPortMirroringProperties{ - // Destination: to.Ptr("vmGroup2"), - // Direction: to.Ptr(armavs.PortMirroringDirectionEnumBIDIRECTIONAL), - // DisplayName: to.Ptr("portMirroring1"), - // Revision: to.Ptr[int64](1), - // Source: to.Ptr("vmGroup1"), - // Status: to.Ptr(armavs.PortMirroringStatusEnumSUCCESS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdatePortMirroringProfiles.json -func ExampleWorkloadNetworksClient_BeginUpdatePortMirroring() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginUpdatePortMirroring(ctx, "group1", "cloud1", "portMirroring1", armavs.WorkloadNetworkPortMirroring{ - Properties: &armavs.WorkloadNetworkPortMirroringProperties{ - Destination: to.Ptr("vmGroup2"), - Direction: to.Ptr(armavs.PortMirroringDirectionEnumBIDIRECTIONAL), - Revision: to.Ptr[int64](1), - Source: to.Ptr("vmGroup1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkPortMirroring = armavs.WorkloadNetworkPortMirroring{ - // Name: to.Ptr("portMirroring1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/portMirroringProfiles"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/portMirroringProfiles/portMirroring1"), - // Properties: &armavs.WorkloadNetworkPortMirroringProperties{ - // Destination: to.Ptr("vmGroup2"), - // Direction: to.Ptr(armavs.PortMirroringDirectionEnumBIDIRECTIONAL), - // DisplayName: to.Ptr("portMirroring1"), - // Revision: to.Ptr[int64](2), - // Source: to.Ptr("vmGroup1"), - // Status: to.Ptr(armavs.PortMirroringStatusEnumSUCCESS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeletePortMirroringProfiles.json -func ExampleWorkloadNetworksClient_BeginDeletePortMirroring() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginDeletePortMirroring(ctx, "group1", "portMirroring1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListVMGroups.json -func ExampleWorkloadNetworksClient_NewListVMGroupsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkloadNetworksClient().NewListVMGroupsPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadNetworkVMGroupsList = armavs.WorkloadNetworkVMGroupsList{ - // Value: []*armavs.WorkloadNetworkVMGroup{ - // { - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/vmGroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/vmGroups/vmGroup1"), - // Properties: &armavs.WorkloadNetworkVMGroupProperties{ - // DisplayName: to.Ptr("vmGroup1"), - // Members: []*string{ - // to.Ptr("564d43da-fefc-2a3b-1d92-42855622fa50")}, - // Revision: to.Ptr[int64](1), - // Status: to.Ptr(armavs.VMGroupStatusEnumSUCCESS), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetVMGroups.json -func ExampleWorkloadNetworksClient_GetVMGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkloadNetworksClient().GetVMGroup(ctx, "group1", "cloud1", "vmGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkVMGroup = armavs.WorkloadNetworkVMGroup{ - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/vmGroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/vmGroups/vmGroup1"), - // Properties: &armavs.WorkloadNetworkVMGroupProperties{ - // DisplayName: to.Ptr("vmGroup1"), - // Members: []*string{ - // to.Ptr("564d43da-fefc-2a3b-1d92-42855622fa50")}, - // Revision: to.Ptr[int64](1), - // Status: to.Ptr(armavs.VMGroupStatusEnumSUCCESS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateVMGroups.json -func ExampleWorkloadNetworksClient_BeginCreateVMGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginCreateVMGroup(ctx, "group1", "cloud1", "vmGroup1", armavs.WorkloadNetworkVMGroup{ - Properties: &armavs.WorkloadNetworkVMGroupProperties{ - DisplayName: to.Ptr("vmGroup1"), - Members: []*string{ - to.Ptr("564d43da-fefc-2a3b-1d92-42855622fa50")}, - Revision: to.Ptr[int64](1), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkVMGroup = armavs.WorkloadNetworkVMGroup{ - // Name: to.Ptr("vmGroup1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/vmGroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/vmGroups/vmGroup1"), - // Properties: &armavs.WorkloadNetworkVMGroupProperties{ - // DisplayName: to.Ptr("vmGroup1"), - // Members: []*string{ - // to.Ptr("564d43da-fefc-2a3b-1d92-42855622fa50")}, - // Revision: to.Ptr[int64](1), - // Status: to.Ptr(armavs.VMGroupStatusEnumSUCCESS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateVMGroups.json -func ExampleWorkloadNetworksClient_BeginUpdateVMGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginUpdateVMGroup(ctx, "group1", "cloud1", "vmGroup1", armavs.WorkloadNetworkVMGroup{ - Properties: &armavs.WorkloadNetworkVMGroupProperties{ - Members: []*string{ - to.Ptr("564d43da-fefc-2a3b-1d92-42855622fa50")}, - Revision: to.Ptr[int64](1), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkVMGroup = armavs.WorkloadNetworkVMGroup{ - // Name: to.Ptr("cloud1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/vmGroups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/vmGroups/vmGroup1"), - // Properties: &armavs.WorkloadNetworkVMGroupProperties{ - // DisplayName: to.Ptr("vmGroup1"), - // Members: []*string{ - // to.Ptr("564d43da-fefc-2a3b-1d92-42855622fa50")}, - // Revision: to.Ptr[int64](2), - // Status: to.Ptr(armavs.VMGroupStatusEnumSUCCESS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteVMGroups.json -func ExampleWorkloadNetworksClient_BeginDeleteVMGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginDeleteVMGroup(ctx, "group1", "vmGroup1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListVirtualMachines.json -func ExampleWorkloadNetworksClient_NewListVirtualMachinesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkloadNetworksClient().NewListVirtualMachinesPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadNetworkVirtualMachinesList = armavs.WorkloadNetworkVirtualMachinesList{ - // Value: []*armavs.WorkloadNetworkVirtualMachine{ - // { - // Name: to.Ptr("vm1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/virtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/virtualMachines/vm1"), - // Properties: &armavs.WorkloadNetworkVirtualMachineProperties{ - // DisplayName: to.Ptr("vm1"), - // VMType: to.Ptr(armavs.VMTypeEnumREGULAR), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetVirtualMachine.json -func ExampleWorkloadNetworksClient_GetVirtualMachine() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkloadNetworksClient().GetVirtualMachine(ctx, "group1", "cloud1", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkVirtualMachine = armavs.WorkloadNetworkVirtualMachine{ - // Name: to.Ptr("vm1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/virtualMachines"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/virtualMachines/vm1"), - // Properties: &armavs.WorkloadNetworkVirtualMachineProperties{ - // DisplayName: to.Ptr("vm1"), - // VMType: to.Ptr(armavs.VMTypeEnumREGULAR), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListDnsServices.json -func ExampleWorkloadNetworksClient_NewListDNSServicesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkloadNetworksClient().NewListDNSServicesPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadNetworkDNSServicesList = armavs.WorkloadNetworkDNSServicesList{ - // Value: []*armavs.WorkloadNetworkDNSService{ - // { - // Name: to.Ptr("portMirroring1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/dnsServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/dnsServices/dnsService1"), - // Properties: &armavs.WorkloadNetworkDNSServiceProperties{ - // DefaultDNSZone: to.Ptr("defaultDnsZone1"), - // DisplayName: to.Ptr("dnsService1"), - // DNSServiceIP: to.Ptr("5.5.5.5"), - // FqdnZones: []*string{ - // to.Ptr("fqdnZone1")}, - // LogLevel: to.Ptr(armavs.DNSServiceLogLevelEnumINFO), - // Revision: to.Ptr[int64](1), - // Status: to.Ptr(armavs.DNSServiceStatusEnumSUCCESS), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetDnsServices.json -func ExampleWorkloadNetworksClient_GetDNSService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkloadNetworksClient().GetDNSService(ctx, "group1", "cloud1", "dnsService1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkDNSService = armavs.WorkloadNetworkDNSService{ - // Name: to.Ptr("portMirroring1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/dnsServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/dnsServices/dnsService1"), - // Properties: &armavs.WorkloadNetworkDNSServiceProperties{ - // DefaultDNSZone: to.Ptr("defaultDnsZone1"), - // DisplayName: to.Ptr("dnsService1"), - // DNSServiceIP: to.Ptr("5.5.5.5"), - // FqdnZones: []*string{ - // to.Ptr("fqdnZone1")}, - // LogLevel: to.Ptr(armavs.DNSServiceLogLevelEnumINFO), - // Revision: to.Ptr[int64](1), - // Status: to.Ptr(armavs.DNSServiceStatusEnumSUCCESS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateDnsServices.json -func ExampleWorkloadNetworksClient_BeginCreateDNSService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginCreateDNSService(ctx, "group1", "cloud1", "dnsService1", armavs.WorkloadNetworkDNSService{ - Properties: &armavs.WorkloadNetworkDNSServiceProperties{ - DefaultDNSZone: to.Ptr("defaultDnsZone1"), - DisplayName: to.Ptr("dnsService1"), - DNSServiceIP: to.Ptr("5.5.5.5"), - FqdnZones: []*string{ - to.Ptr("fqdnZone1")}, - LogLevel: to.Ptr(armavs.DNSServiceLogLevelEnumINFO), - Revision: to.Ptr[int64](1), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkDNSService = armavs.WorkloadNetworkDNSService{ - // Name: to.Ptr("dnsService1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/dnsServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/dnsServices/dnsService1"), - // Properties: &armavs.WorkloadNetworkDNSServiceProperties{ - // DefaultDNSZone: to.Ptr("defaultDnsZone1"), - // DisplayName: to.Ptr("dnsService1"), - // DNSServiceIP: to.Ptr("5.5.5.5"), - // FqdnZones: []*string{ - // to.Ptr("fqdnZone1")}, - // LogLevel: to.Ptr(armavs.DNSServiceLogLevelEnumINFO), - // Revision: to.Ptr[int64](1), - // Status: to.Ptr(armavs.DNSServiceStatusEnumSUCCESS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateDnsServices.json -func ExampleWorkloadNetworksClient_BeginUpdateDNSService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginUpdateDNSService(ctx, "group1", "cloud1", "dnsService1", armavs.WorkloadNetworkDNSService{ - Properties: &armavs.WorkloadNetworkDNSServiceProperties{ - DefaultDNSZone: to.Ptr("defaultDnsZone1"), - DisplayName: to.Ptr("dnsService1"), - DNSServiceIP: to.Ptr("5.5.5.5"), - FqdnZones: []*string{ - to.Ptr("fqdnZone1")}, - LogLevel: to.Ptr(armavs.DNSServiceLogLevelEnumINFO), - Revision: to.Ptr[int64](1), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkDNSService = armavs.WorkloadNetworkDNSService{ - // Name: to.Ptr("dnsService1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/dnsServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/dnsServices/dnsService1"), - // Properties: &armavs.WorkloadNetworkDNSServiceProperties{ - // DefaultDNSZone: to.Ptr("defaultDnsZone1"), - // DisplayName: to.Ptr("dnsService1"), - // DNSServiceIP: to.Ptr("5.5.5.5"), - // FqdnZones: []*string{ - // to.Ptr("fqdnZone1")}, - // LogLevel: to.Ptr(armavs.DNSServiceLogLevelEnumINFO), - // Revision: to.Ptr[int64](1), - // Status: to.Ptr(armavs.DNSServiceStatusEnumSUCCESS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteDnsServices.json -func ExampleWorkloadNetworksClient_BeginDeleteDNSService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginDeleteDNSService(ctx, "group1", "dnsService1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListDnsZones.json -func ExampleWorkloadNetworksClient_NewListDNSZonesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkloadNetworksClient().NewListDNSZonesPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadNetworkDNSZonesList = armavs.WorkloadNetworkDNSZonesList{ - // Value: []*armavs.WorkloadNetworkDNSZone{ - // { - // Name: to.Ptr("portMirroring1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/dnsZones"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/dnsZones/dnsZone1"), - // Properties: &armavs.WorkloadNetworkDNSZoneProperties{ - // DisplayName: to.Ptr("dnsZone1"), - // DNSServerIPs: []*string{ - // to.Ptr("1.1.1.1")}, - // DNSServices: to.Ptr[int64](0), - // Domain: []*string{ - // }, - // Revision: to.Ptr[int64](1), - // SourceIP: to.Ptr("8.8.8.8"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetDnsZones.json -func ExampleWorkloadNetworksClient_GetDNSZone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkloadNetworksClient().GetDNSZone(ctx, "group1", "cloud1", "dnsZone1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkDNSZone = armavs.WorkloadNetworkDNSZone{ - // Name: to.Ptr("portMirroring1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/dnsZones"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/dnsZones/dnsZone1"), - // Properties: &armavs.WorkloadNetworkDNSZoneProperties{ - // DisplayName: to.Ptr("dnsZone1"), - // DNSServerIPs: []*string{ - // to.Ptr("1.1.1.1")}, - // DNSServices: to.Ptr[int64](0), - // Domain: []*string{ - // }, - // Revision: to.Ptr[int64](1), - // SourceIP: to.Ptr("8.8.8.8"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreateDnsZones.json -func ExampleWorkloadNetworksClient_BeginCreateDNSZone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginCreateDNSZone(ctx, "group1", "cloud1", "dnsZone1", armavs.WorkloadNetworkDNSZone{ - Properties: &armavs.WorkloadNetworkDNSZoneProperties{ - DisplayName: to.Ptr("dnsZone1"), - DNSServerIPs: []*string{ - to.Ptr("1.1.1.1")}, - Domain: []*string{}, - Revision: to.Ptr[int64](1), - SourceIP: to.Ptr("8.8.8.8"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkDNSZone = armavs.WorkloadNetworkDNSZone{ - // Name: to.Ptr("dnsZone1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/dnsZones"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/dnsZones/dnsZone1"), - // Properties: &armavs.WorkloadNetworkDNSZoneProperties{ - // DisplayName: to.Ptr("dnsZone1"), - // DNSServerIPs: []*string{ - // to.Ptr("1.1.1.1")}, - // DNSServices: to.Ptr[int64](0), - // Domain: []*string{ - // }, - // Revision: to.Ptr[int64](1), - // SourceIP: to.Ptr("8.8.8.8"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_UpdateDnsZones.json -func ExampleWorkloadNetworksClient_BeginUpdateDNSZone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginUpdateDNSZone(ctx, "group1", "cloud1", "dnsZone1", armavs.WorkloadNetworkDNSZone{ - Properties: &armavs.WorkloadNetworkDNSZoneProperties{ - DisplayName: to.Ptr("dnsZone1"), - DNSServerIPs: []*string{ - to.Ptr("1.1.1.1")}, - Domain: []*string{}, - Revision: to.Ptr[int64](1), - SourceIP: to.Ptr("8.8.8.8"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkDNSZone = armavs.WorkloadNetworkDNSZone{ - // Name: to.Ptr("dnsZone1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/dnsZones"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/dnsZones/dnsZone1"), - // Properties: &armavs.WorkloadNetworkDNSZoneProperties{ - // DisplayName: to.Ptr("dnsZone1"), - // DNSServerIPs: []*string{ - // to.Ptr("1.1.1.1")}, - // DNSServices: to.Ptr[int64](0), - // Domain: []*string{ - // }, - // Revision: to.Ptr[int64](1), - // SourceIP: to.Ptr("8.8.8.8"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeleteDnsZones.json -func ExampleWorkloadNetworksClient_BeginDeleteDNSZone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginDeleteDNSZone(ctx, "group1", "dnsZone1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_ListPublicIPs.json -func ExampleWorkloadNetworksClient_NewListPublicIPsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkloadNetworksClient().NewListPublicIPsPager("group1", "cloud1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadNetworkPublicIPsList = armavs.WorkloadNetworkPublicIPsList{ - // Value: []*armavs.WorkloadNetworkPublicIP{ - // { - // Name: to.Ptr("publicIP1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/publicIPs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/publicIPs/publicIP1"), - // Properties: &armavs.WorkloadNetworkPublicIPProperties{ - // DisplayName: to.Ptr("publicIP1"), - // PublicIPBlock: to.Ptr("20.20.40.50/32"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_GetPublicIPs.json -func ExampleWorkloadNetworksClient_GetPublicIP() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkloadNetworksClient().GetPublicIP(ctx, "group1", "cloud1", "publicIP1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkPublicIP = armavs.WorkloadNetworkPublicIP{ - // Name: to.Ptr("publicIP1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/publicIPs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/publicIPs/publicIP1"), - // Properties: &armavs.WorkloadNetworkPublicIPProperties{ - // DisplayName: to.Ptr("publicIP1"), - // PublicIPBlock: to.Ptr("20.20.40.50/32"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_CreatePublicIPs.json -func ExampleWorkloadNetworksClient_BeginCreatePublicIP() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginCreatePublicIP(ctx, "group1", "cloud1", "publicIP1", armavs.WorkloadNetworkPublicIP{ - Properties: &armavs.WorkloadNetworkPublicIPProperties{ - DisplayName: to.Ptr("publicIP1"), - NumberOfPublicIPs: to.Ptr[int64](32), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkloadNetworkPublicIP = armavs.WorkloadNetworkPublicIP{ - // Name: to.Ptr("publicIP1"), - // Type: to.Ptr("Microsoft.AVS/privateClouds/workloadNetworks/publicIPs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/workloadNetworks/default/publicIPs/publicIP1"), - // Properties: &armavs.WorkloadNetworkPublicIPProperties{ - // DisplayName: to.Ptr("publicIP1"), - // PublicIPBlock: to.Ptr("20.20.40.50/32"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a5e7ff51c8af3781e7f6dd3b82a3fc922e2f6f93/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/examples/WorkloadNetworks_DeletePublicIPs.json -func ExampleWorkloadNetworksClient_BeginDeletePublicIP() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armavs.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkloadNetworksClient().BeginDeletePublicIP(ctx, "group1", "publicIP1", "cloud1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -}