From c1462e2f8c279b9ffaaf032aaa530db9c9a51011 Mon Sep 17 00:00:00 2001 From: Peng Jiahui <46921893+Alancere@users.noreply.github.com> Date: Wed, 19 Jul 2023 16:40:10 +0800 Subject: [PATCH] [Release] sdk/resourcemanager/networkcloud/armnetworkcloud/0.2.0 generation from spec commit: c53808ba54beef57059371708f1fa6949a11a280 (#21137) --- .../networkcloud/armnetworkcloud/CHANGELOG.md | 127 ++ .../armnetworkcloud/agentpools_client.go | 380 ++++ .../agentpools_client_example_test.go | 516 +++++ .../networkcloud/armnetworkcloud/autorest.md | 8 +- .../baremetalmachinekeysets_client.go | 79 +- ...metalmachinekeysets_client_example_test.go | 32 +- .../baremetalmachines_client.go | 151 +- .../baremetalmachines_client_example_test.go | 367 ++-- .../armnetworkcloud/bmckeysets_client.go | 80 +- .../bmckeysets_client_example_test.go | 32 +- .../armnetworkcloud/client_factory.go | 16 +- .../cloudservicesnetworks_client.go | 52 +- ...oudservicesnetworks_client_example_test.go | 218 +-- .../armnetworkcloud/clustermanagers_client.go | 48 +- .../clustermanagers_client_example_test.go | 56 +- .../armnetworkcloud/clusters_client.go | 70 +- .../clusters_client_example_test.go | 194 +- .../armnetworkcloud/consoles_client.go | 79 +- .../consoles_client_example_test.go | 40 +- .../networkcloud/armnetworkcloud/constants.go | 418 +++- .../defaultcninetworks_client.go | 421 ---- .../defaultcninetworks_client_example_test.go | 514 ----- .../networkcloud/armnetworkcloud/go.mod | 16 +- .../networkcloud/armnetworkcloud/go.sum | 36 +- .../hybridaksclusters_client.go | 497 ----- .../hybridaksclusters_client_example_test.go | 1510 --------------- .../kubernetesclusters_client.go | 479 +++++ .../kubernetesclusters_client_example_test.go | 1494 ++++++++++++++ .../armnetworkcloud/l2networks_client.go | 48 +- .../l2networks_client_example_test.go | 135 +- .../armnetworkcloud/l3networks_client.go | 48 +- .../l3networks_client_example_test.go | 162 +- .../metricsconfigurations_client.go | 83 +- ...tricsconfigurations_client_example_test.go | 32 +- .../networkcloud/armnetworkcloud/models.go | 1029 ++++++---- .../armnetworkcloud/models_serde.go | 1716 ++++++++++++----- .../armnetworkcloud/operations_client.go | 4 +- .../operations_client_example_test.go | 2 +- .../armnetworkcloud/racks_client.go | 52 +- .../racks_client_example_test.go | 44 +- .../armnetworkcloud/rackskus_client.go | 16 +- .../rackskus_client_example_test.go | 8 +- .../armnetworkcloud/response_types.go | 114 +- .../storageappliances_client.go | 151 +- .../storageappliances_client_example_test.go | 85 +- .../armnetworkcloud/trunkednetworks_client.go | 48 +- .../trunkednetworks_client_example_test.go | 180 +- .../armnetworkcloud/virtualmachines_client.go | 106 +- .../virtualmachines_client_example_test.go | 133 +- .../armnetworkcloud/volumes_client.go | 48 +- .../volumes_client_example_test.go | 44 +- 51 files changed, 6483 insertions(+), 5735 deletions(-) create mode 100644 sdk/resourcemanager/networkcloud/armnetworkcloud/agentpools_client.go create mode 100644 sdk/resourcemanager/networkcloud/armnetworkcloud/agentpools_client_example_test.go delete mode 100644 sdk/resourcemanager/networkcloud/armnetworkcloud/defaultcninetworks_client.go delete mode 100644 sdk/resourcemanager/networkcloud/armnetworkcloud/defaultcninetworks_client_example_test.go delete mode 100644 sdk/resourcemanager/networkcloud/armnetworkcloud/hybridaksclusters_client.go delete mode 100644 sdk/resourcemanager/networkcloud/armnetworkcloud/hybridaksclusters_client_example_test.go create mode 100644 sdk/resourcemanager/networkcloud/armnetworkcloud/kubernetesclusters_client.go create mode 100644 sdk/resourcemanager/networkcloud/armnetworkcloud/kubernetesclusters_client_example_test.go diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/CHANGELOG.md b/sdk/resourcemanager/networkcloud/armnetworkcloud/CHANGELOG.md index ddc4f8595983..daa931298a87 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/CHANGELOG.md +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/CHANGELOG.md @@ -1,5 +1,132 @@ # Release History +## 0.2.0 (2023-07-28) +### Breaking Changes + +- Enum `DefaultCniNetworkDetailedStatus` has been removed +- Enum `DefaultCniNetworkProvisioningState` has been removed +- Enum `HybridAksClusterDetailedStatus` has been removed +- Enum `HybridAksClusterMachinePowerState` has been removed +- Enum `HybridAksClusterProvisioningState` has been removed +- Enum `StorageApplianceHardwareValidationCategory` has been removed +- Function `*BareMetalMachineKeySetsClient.NewListByResourceGroupPager` has been removed +- Function `*BmcKeySetsClient.NewListByResourceGroupPager` has been removed +- Function `*ClientFactory.NewDefaultCniNetworksClient` has been removed +- Function `*ClientFactory.NewHybridAksClustersClient` has been removed +- Function `*ConsolesClient.NewListByResourceGroupPager` has been removed +- Function `NewDefaultCniNetworksClient` has been removed +- Function `*DefaultCniNetworksClient.BeginCreateOrUpdate` has been removed +- Function `*DefaultCniNetworksClient.BeginDelete` has been removed +- Function `*DefaultCniNetworksClient.Get` has been removed +- Function `*DefaultCniNetworksClient.NewListByResourceGroupPager` has been removed +- Function `*DefaultCniNetworksClient.NewListBySubscriptionPager` has been removed +- Function `*DefaultCniNetworksClient.Update` has been removed +- Function `NewHybridAksClustersClient` has been removed +- Function `*HybridAksClustersClient.BeginCreateOrUpdate` has been removed +- Function `*HybridAksClustersClient.BeginDelete` has been removed +- Function `*HybridAksClustersClient.Get` has been removed +- Function `*HybridAksClustersClient.NewListByResourceGroupPager` has been removed +- Function `*HybridAksClustersClient.NewListBySubscriptionPager` has been removed +- Function `*HybridAksClustersClient.BeginRestartNode` has been removed +- Function `*HybridAksClustersClient.Update` has been removed +- Function `*MetricsConfigurationsClient.NewListByResourceGroupPager` has been removed +- Function `*StorageAppliancesClient.BeginValidateHardware` has been removed +- Struct `BgpPeer` has been removed +- Struct `CniBgpConfiguration` has been removed +- Struct `CommunityAdvertisement` has been removed +- Struct `DefaultCniNetwork` has been removed +- Struct `DefaultCniNetworkList` has been removed +- Struct `DefaultCniNetworkPatchParameters` has been removed +- Struct `DefaultCniNetworkProperties` has been removed +- Struct `HybridAksCluster` has been removed +- Struct `HybridAksClusterList` has been removed +- Struct `HybridAksClusterPatchParameters` has been removed +- Struct `HybridAksClusterProperties` has been removed +- Struct `HybridAksClusterRestartNodeParameters` has been removed +- Struct `Node` has been removed +- Struct `NodeConfiguration` has been removed +- Struct `StorageApplianceValidateHardwareParameters` has been removed + +### Features Added + +- New value `VirtualMachineDetailedStatusRunning`, `VirtualMachineDetailedStatusScheduling`, `VirtualMachineDetailedStatusStopped`, `VirtualMachineDetailedStatusTerminating`, `VirtualMachineDetailedStatusUnknown` added to enum type `VirtualMachineDetailedStatus` +- New value `VirtualMachinePowerStateUnknown` added to enum type `VirtualMachinePowerState` +- New enum type `AdvertiseToFabric` with values `AdvertiseToFabricFalse`, `AdvertiseToFabricTrue` +- New enum type `AgentPoolDetailedStatus` with values `AgentPoolDetailedStatusAvailable`, `AgentPoolDetailedStatusError`, `AgentPoolDetailedStatusProvisioning` +- New enum type `AgentPoolMode` with values `AgentPoolModeNotApplicable`, `AgentPoolModeSystem`, `AgentPoolModeUser` +- New enum type `AgentPoolProvisioningState` with values `AgentPoolProvisioningStateAccepted`, `AgentPoolProvisioningStateCanceled`, `AgentPoolProvisioningStateDeleting`, `AgentPoolProvisioningStateFailed`, `AgentPoolProvisioningStateInProgress`, `AgentPoolProvisioningStateSucceeded`, `AgentPoolProvisioningStateUpdating` +- New enum type `AvailabilityLifecycle` with values `AvailabilityLifecycleGenerallyAvailable`, `AvailabilityLifecyclePreview` +- New enum type `BfdEnabled` with values `BfdEnabledFalse`, `BfdEnabledTrue` +- New enum type `BgpMultiHop` with values `BgpMultiHopFalse`, `BgpMultiHopTrue` +- New enum type `FabricPeeringEnabled` with values `FabricPeeringEnabledFalse`, `FabricPeeringEnabledTrue` +- New enum type `FeatureDetailedStatus` with values `FeatureDetailedStatusFailed`, `FeatureDetailedStatusRunning`, `FeatureDetailedStatusUnknown` +- New enum type `HugepagesSize` with values `HugepagesSizeOneG`, `HugepagesSizeTwoM` +- New enum type `KubernetesClusterDetailedStatus` with values `KubernetesClusterDetailedStatusAvailable`, `KubernetesClusterDetailedStatusError`, `KubernetesClusterDetailedStatusProvisioning` +- New enum type `KubernetesClusterNodeDetailedStatus` with values `KubernetesClusterNodeDetailedStatusAvailable`, `KubernetesClusterNodeDetailedStatusError`, `KubernetesClusterNodeDetailedStatusProvisioning`, `KubernetesClusterNodeDetailedStatusRunning`, `KubernetesClusterNodeDetailedStatusScheduling`, `KubernetesClusterNodeDetailedStatusStopped`, `KubernetesClusterNodeDetailedStatusTerminating`, `KubernetesClusterNodeDetailedStatusUnknown` +- New enum type `KubernetesClusterProvisioningState` with values `KubernetesClusterProvisioningStateAccepted`, `KubernetesClusterProvisioningStateCanceled`, `KubernetesClusterProvisioningStateCreated`, `KubernetesClusterProvisioningStateDeleting`, `KubernetesClusterProvisioningStateFailed`, `KubernetesClusterProvisioningStateInProgress`, `KubernetesClusterProvisioningStateSucceeded`, `KubernetesClusterProvisioningStateUpdating` +- New enum type `KubernetesNodePowerState` with values `KubernetesNodePowerStateOff`, `KubernetesNodePowerStateOn`, `KubernetesNodePowerStateUnknown` +- New enum type `KubernetesNodeRole` with values `KubernetesNodeRoleControlPlane`, `KubernetesNodeRoleWorker` +- New enum type `KubernetesPluginType` with values `KubernetesPluginTypeDPDK`, `KubernetesPluginTypeIPVLAN`, `KubernetesPluginTypeMACVLAN`, `KubernetesPluginTypeOSDevice`, `KubernetesPluginTypeSRIOV` +- New enum type `L3NetworkConfigurationIpamEnabled` with values `L3NetworkConfigurationIpamEnabledFalse`, `L3NetworkConfigurationIpamEnabledTrue` +- New function `NewAgentPoolsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AgentPoolsClient, error)` +- New function `*AgentPoolsClient.BeginCreateOrUpdate(context.Context, string, string, string, AgentPool, *AgentPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AgentPoolsClientCreateOrUpdateResponse], error)` +- New function `*AgentPoolsClient.BeginDelete(context.Context, string, string, string, *AgentPoolsClientBeginDeleteOptions) (*runtime.Poller[AgentPoolsClientDeleteResponse], error)` +- New function `*AgentPoolsClient.Get(context.Context, string, string, string, *AgentPoolsClientGetOptions) (AgentPoolsClientGetResponse, error)` +- New function `*AgentPoolsClient.NewListByKubernetesClusterPager(string, string, *AgentPoolsClientListByKubernetesClusterOptions) *runtime.Pager[AgentPoolsClientListByKubernetesClusterResponse]` +- New function `*AgentPoolsClient.BeginUpdate(context.Context, string, string, string, AgentPoolPatchParameters, *AgentPoolsClientBeginUpdateOptions) (*runtime.Poller[AgentPoolsClientUpdateResponse], error)` +- New function `*BareMetalMachineKeySetsClient.NewListByClusterPager(string, string, *BareMetalMachineKeySetsClientListByClusterOptions) *runtime.Pager[BareMetalMachineKeySetsClientListByClusterResponse]` +- New function `*BmcKeySetsClient.NewListByClusterPager(string, string, *BmcKeySetsClientListByClusterOptions) *runtime.Pager[BmcKeySetsClientListByClusterResponse]` +- New function `*ClientFactory.NewAgentPoolsClient() *AgentPoolsClient` +- New function `*ClientFactory.NewKubernetesClustersClient() *KubernetesClustersClient` +- New function `*ConsolesClient.NewListByVirtualMachinePager(string, string, *ConsolesClientListByVirtualMachineOptions) *runtime.Pager[ConsolesClientListByVirtualMachineResponse]` +- New function `NewKubernetesClustersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*KubernetesClustersClient, error)` +- New function `*KubernetesClustersClient.BeginCreateOrUpdate(context.Context, string, string, KubernetesCluster, *KubernetesClustersClientBeginCreateOrUpdateOptions) (*runtime.Poller[KubernetesClustersClientCreateOrUpdateResponse], error)` +- New function `*KubernetesClustersClient.BeginDelete(context.Context, string, string, *KubernetesClustersClientBeginDeleteOptions) (*runtime.Poller[KubernetesClustersClientDeleteResponse], error)` +- New function `*KubernetesClustersClient.Get(context.Context, string, string, *KubernetesClustersClientGetOptions) (KubernetesClustersClientGetResponse, error)` +- New function `*KubernetesClustersClient.NewListByResourceGroupPager(string, *KubernetesClustersClientListByResourceGroupOptions) *runtime.Pager[KubernetesClustersClientListByResourceGroupResponse]` +- New function `*KubernetesClustersClient.NewListBySubscriptionPager(*KubernetesClustersClientListBySubscriptionOptions) *runtime.Pager[KubernetesClustersClientListBySubscriptionResponse]` +- New function `*KubernetesClustersClient.BeginRestartNode(context.Context, string, string, KubernetesClusterRestartNodeParameters, *KubernetesClustersClientBeginRestartNodeOptions) (*runtime.Poller[KubernetesClustersClientRestartNodeResponse], error)` +- New function `*KubernetesClustersClient.BeginUpdate(context.Context, string, string, KubernetesClusterPatchParameters, *KubernetesClustersClientBeginUpdateOptions) (*runtime.Poller[KubernetesClustersClientUpdateResponse], error)` +- New function `*MetricsConfigurationsClient.NewListByClusterPager(string, string, *MetricsConfigurationsClientListByClusterOptions) *runtime.Pager[MetricsConfigurationsClientListByClusterResponse]` +- New struct `AADConfiguration` +- New struct `AdministratorConfiguration` +- New struct `AgentOptions` +- New struct `AgentPool` +- New struct `AgentPoolList` +- New struct `AgentPoolPatchParameters` +- New struct `AgentPoolPatchProperties` +- New struct `AgentPoolProperties` +- New struct `AgentPoolUpgradeSettings` +- New struct `AttachedNetworkConfiguration` +- New struct `AvailableUpgrade` +- New struct `BgpAdvertisement` +- New struct `BgpServiceLoadBalancerConfiguration` +- New struct `ControlPlaneNodeConfiguration` +- New struct `ControlPlaneNodePatchConfiguration` +- New struct `FeatureStatus` +- New struct `IPAddressPool` +- New struct `InitialAgentPoolConfiguration` +- New struct `KubernetesCluster` +- New struct `KubernetesClusterList` +- New struct `KubernetesClusterNode` +- New struct `KubernetesClusterPatchParameters` +- New struct `KubernetesClusterPatchProperties` +- New struct `KubernetesClusterProperties` +- New struct `KubernetesClusterRestartNodeParameters` +- New struct `KubernetesLabel` +- New struct `L2NetworkAttachmentConfiguration` +- New struct `L3NetworkAttachmentConfiguration` +- New struct `NetworkConfiguration` +- New struct `ServiceLoadBalancerBgpPeer` +- New struct `TrunkedNetworkAttachmentConfiguration` +- New field `AssociatedResourceIDs` in struct `BareMetalMachineProperties` +- New field `AssociatedResourceIDs` in struct `CloudServicesNetworkProperties` +- New field `AssociatedResourceIDs` in struct `L2NetworkProperties` +- New field `AssociatedResourceIDs` in struct `L3NetworkProperties` +- New field `AssociatedResourceIDs` in struct `TrunkedNetworkProperties` +- New field `AvailabilityZone` in struct `VirtualMachineProperties` + + ## 0.1.0 (2023-05-26) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/agentpools_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/agentpools_client.go new file mode 100644 index 000000000000..36ad73bd82ca --- /dev/null +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/agentpools_client.go @@ -0,0 +1,380 @@ +//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 armnetworkcloud + +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" +) + +// AgentPoolsClient contains the methods for the AgentPools group. +// Don't use this type directly, use NewAgentPoolsClient() instead. +type AgentPoolsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAgentPoolsClient creates a new instance of AgentPoolsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAgentPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AgentPoolsClient, error) { + cl, err := arm.NewClient(moduleName+".AgentPoolsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AgentPoolsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a new Kubernetes cluster agent pool or update the properties of the existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - kubernetesClusterName - The name of the Kubernetes cluster. +// - agentPoolName - The name of the Kubernetes cluster agent pool. +// - agentPoolParameters - The request body. +// - options - AgentPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginCreateOrUpdate +// method. +func (client *AgentPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, kubernetesClusterName string, agentPoolName string, agentPoolParameters AgentPool, options *AgentPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AgentPoolsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, kubernetesClusterName, agentPoolName, agentPoolParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AgentPoolsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[AgentPoolsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a new Kubernetes cluster agent pool or update the properties of the existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *AgentPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, kubernetesClusterName string, agentPoolName string, agentPoolParameters AgentPool, options *AgentPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, kubernetesClusterName, agentPoolName, agentPoolParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, kubernetesClusterName string, agentPoolName string, agentPoolParameters AgentPool, options *AgentPoolsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" + 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 kubernetesClusterName == "" { + return nil, errors.New("parameter kubernetesClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{kubernetesClusterName}", url.PathEscape(kubernetesClusterName)) + if agentPoolName == "" { + return nil, errors.New("parameter agentPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, agentPoolParameters) +} + +// BeginDelete - Delete the provided Kubernetes cluster agent pool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - kubernetesClusterName - The name of the Kubernetes cluster. +// - agentPoolName - The name of the Kubernetes cluster agent pool. +// - options - AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method. +func (client *AgentPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, kubernetesClusterName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (*runtime.Poller[AgentPoolsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, kubernetesClusterName, agentPoolName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AgentPoolsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[AgentPoolsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete the provided Kubernetes cluster agent pool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *AgentPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, kubernetesClusterName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, kubernetesClusterName, agentPoolName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, kubernetesClusterName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" + 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 kubernetesClusterName == "" { + return nil, errors.New("parameter kubernetesClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{kubernetesClusterName}", url.PathEscape(kubernetesClusterName)) + if agentPoolName == "" { + return nil, errors.New("parameter agentPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get properties of the provided Kubernetes cluster agent pool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - kubernetesClusterName - The name of the Kubernetes cluster. +// - agentPoolName - The name of the Kubernetes cluster agent pool. +// - options - AgentPoolsClientGetOptions contains the optional parameters for the AgentPoolsClient.Get method. +func (client *AgentPoolsClient) Get(ctx context.Context, resourceGroupName string, kubernetesClusterName string, agentPoolName string, options *AgentPoolsClientGetOptions) (AgentPoolsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, kubernetesClusterName, agentPoolName, options) + if err != nil { + return AgentPoolsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AgentPoolsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AgentPoolsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AgentPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, kubernetesClusterName string, agentPoolName string, options *AgentPoolsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" + 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 kubernetesClusterName == "" { + return nil, errors.New("parameter kubernetesClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{kubernetesClusterName}", url.PathEscape(kubernetesClusterName)) + if agentPoolName == "" { + return nil, errors.New("parameter agentPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AgentPoolsClient) getHandleResponse(resp *http.Response) (AgentPoolsClientGetResponse, error) { + result := AgentPoolsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AgentPool); err != nil { + return AgentPoolsClientGetResponse{}, err + } + return result, nil +} + +// NewListByKubernetesClusterPager - Get a list of agent pools for the provided Kubernetes cluster. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - kubernetesClusterName - The name of the Kubernetes cluster. +// - options - AgentPoolsClientListByKubernetesClusterOptions contains the optional parameters for the AgentPoolsClient.NewListByKubernetesClusterPager +// method. +func (client *AgentPoolsClient) NewListByKubernetesClusterPager(resourceGroupName string, kubernetesClusterName string, options *AgentPoolsClientListByKubernetesClusterOptions) *runtime.Pager[AgentPoolsClientListByKubernetesClusterResponse] { + return runtime.NewPager(runtime.PagingHandler[AgentPoolsClientListByKubernetesClusterResponse]{ + More: func(page AgentPoolsClientListByKubernetesClusterResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AgentPoolsClientListByKubernetesClusterResponse) (AgentPoolsClientListByKubernetesClusterResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByKubernetesClusterCreateRequest(ctx, resourceGroupName, kubernetesClusterName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AgentPoolsClientListByKubernetesClusterResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AgentPoolsClientListByKubernetesClusterResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AgentPoolsClientListByKubernetesClusterResponse{}, runtime.NewResponseError(resp) + } + return client.listByKubernetesClusterHandleResponse(resp) + }, + }) +} + +// listByKubernetesClusterCreateRequest creates the ListByKubernetesCluster request. +func (client *AgentPoolsClient) listByKubernetesClusterCreateRequest(ctx context.Context, resourceGroupName string, kubernetesClusterName string, options *AgentPoolsClientListByKubernetesClusterOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools" + 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 kubernetesClusterName == "" { + return nil, errors.New("parameter kubernetesClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{kubernetesClusterName}", url.PathEscape(kubernetesClusterName)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByKubernetesClusterHandleResponse handles the ListByKubernetesCluster response. +func (client *AgentPoolsClient) listByKubernetesClusterHandleResponse(resp *http.Response) (AgentPoolsClientListByKubernetesClusterResponse, error) { + result := AgentPoolsClientListByKubernetesClusterResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AgentPoolList); err != nil { + return AgentPoolsClientListByKubernetesClusterResponse{}, err + } + return result, nil +} + +// BeginUpdate - Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the +// Kubernetes cluster agent pool. Properties and tag updates can be done independently. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - kubernetesClusterName - The name of the Kubernetes cluster. +// - agentPoolName - The name of the Kubernetes cluster agent pool. +// - agentPoolUpdateParameters - The request body. +// - options - AgentPoolsClientBeginUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginUpdate method. +func (client *AgentPoolsClient) BeginUpdate(ctx context.Context, resourceGroupName string, kubernetesClusterName string, agentPoolName string, agentPoolUpdateParameters AgentPoolPatchParameters, options *AgentPoolsClientBeginUpdateOptions) (*runtime.Poller[AgentPoolsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, kubernetesClusterName, agentPoolName, agentPoolUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AgentPoolsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[AgentPoolsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes +// cluster agent pool. Properties and tag updates can be done independently. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *AgentPoolsClient) update(ctx context.Context, resourceGroupName string, kubernetesClusterName string, agentPoolName string, agentPoolUpdateParameters AgentPoolPatchParameters, options *AgentPoolsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, kubernetesClusterName, agentPoolName, agentPoolUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *AgentPoolsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, kubernetesClusterName string, agentPoolName string, agentPoolUpdateParameters AgentPoolPatchParameters, options *AgentPoolsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" + 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 kubernetesClusterName == "" { + return nil, errors.New("parameter kubernetesClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{kubernetesClusterName}", url.PathEscape(kubernetesClusterName)) + if agentPoolName == "" { + return nil, errors.New("parameter agentPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, agentPoolUpdateParameters) +} diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/agentpools_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/agentpools_client_example_test.go new file mode 100644 index 000000000000..7e11d151992d --- /dev/null +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/agentpools_client_example_test.go @@ -0,0 +1,516 @@ +//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 armnetworkcloud_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/networkcloud/armnetworkcloud" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/AgentPools_ListByKubernetesCluster.json +func ExampleAgentPoolsClient_NewListByKubernetesClusterPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewAgentPoolsClient().NewListByKubernetesClusterPager("resourceGroupName", "kubernetesClusterName", 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.AgentPoolList = armnetworkcloud.AgentPoolList{ + // Value: []*armnetworkcloud.AgentPool{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.NetworkCloud/kubernetesClusters/agentPools"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/kubernetesClusters/kubernetesClusterName/agentPools/agentPoolName"), + // SystemData: &armnetworkcloud.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), + // CreatedBy: to.Ptr("identityA"), + // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), + // LastModifiedBy: to.Ptr("identityB"), + // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), + // }, + // Location: to.Ptr("location"), + // Tags: map[string]*string{ + // "key1": to.Ptr("myvalue1"), + // "key2": to.Ptr("myvalue2"), + // }, + // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Type: to.Ptr("CustomLocation"), + // }, + // Properties: &armnetworkcloud.AgentPoolProperties{ + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AgentOptions: &armnetworkcloud.AgentOptions{ + // HugepagesCount: to.Ptr[int64](96), + // HugepagesSize: to.Ptr(armnetworkcloud.HugepagesSizeOneG), + // }, + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // DetailedStatus: to.Ptr(armnetworkcloud.AgentPoolDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Agent pool is available"), + // KubernetesVersion: to.Ptr("1.24.3-1"), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // ProvisioningState: to.Ptr(armnetworkcloud.AgentPoolProvisioningStateSucceeded), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // UpgradeSettings: &armnetworkcloud.AgentPoolUpgradeSettings{ + // MaxSurge: to.Ptr("1"), + // }, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/AgentPools_Get.json +func ExampleAgentPoolsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAgentPoolsClient().Get(ctx, "resourceGroupName", "kubernetesClusterName", "agentPoolName", 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.AgentPool = armnetworkcloud.AgentPool{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.NetworkCloud/kubernetesClusters/agentPools"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/kubernetesClusters/kubernetesClusterName/agentPools/agentPoolName"), + // SystemData: &armnetworkcloud.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), + // CreatedBy: to.Ptr("identityA"), + // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), + // LastModifiedBy: to.Ptr("identityB"), + // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), + // }, + // Location: to.Ptr("location"), + // Tags: map[string]*string{ + // "key1": to.Ptr("myvalue1"), + // "key2": to.Ptr("myvalue2"), + // }, + // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Type: to.Ptr("CustomLocation"), + // }, + // Properties: &armnetworkcloud.AgentPoolProperties{ + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AgentOptions: &armnetworkcloud.AgentOptions{ + // HugepagesCount: to.Ptr[int64](96), + // HugepagesSize: to.Ptr(armnetworkcloud.HugepagesSizeOneG), + // }, + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // DetailedStatus: to.Ptr(armnetworkcloud.AgentPoolDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Agent pool is available"), + // KubernetesVersion: to.Ptr("1.24.3-1"), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // ProvisioningState: to.Ptr(armnetworkcloud.AgentPoolProvisioningStateSucceeded), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // UpgradeSettings: &armnetworkcloud.AgentPoolUpgradeSettings{ + // MaxSurge: to.Ptr("1"), + // }, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/AgentPools_Create.json +func ExampleAgentPoolsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "kubernetesClusterName", "agentPoolName", armnetworkcloud.AgentPool{ + Location: to.Ptr("location"), + Tags: map[string]*string{ + "key1": to.Ptr("myvalue1"), + "key2": to.Ptr("myvalue2"), + }, + ExtendedLocation: &armnetworkcloud.ExtendedLocation{ + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Type: to.Ptr("CustomLocation"), + }, + Properties: &armnetworkcloud.AgentPoolProperties{ + AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + AdminUsername: to.Ptr("azure"), + SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + { + KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + }}, + }, + AgentOptions: &armnetworkcloud.AgentOptions{ + HugepagesCount: to.Ptr[int64](96), + HugepagesSize: to.Ptr(armnetworkcloud.HugepagesSizeOneG), + }, + AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + { + NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + }}, + L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + { + IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + }}, + TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + { + NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + }}, + }, + AvailabilityZones: []*string{ + to.Ptr("1"), + to.Ptr("2"), + to.Ptr("3")}, + Count: to.Ptr[int64](3), + Labels: []*armnetworkcloud.KubernetesLabel{ + { + Key: to.Ptr("kubernetes.label"), + Value: to.Ptr("true"), + }}, + Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + Taints: []*armnetworkcloud.KubernetesLabel{ + { + Key: to.Ptr("kubernetes.taint"), + Value: to.Ptr("true"), + }}, + UpgradeSettings: &armnetworkcloud.AgentPoolUpgradeSettings{ + MaxSurge: to.Ptr("1"), + }, + VMSKUName: to.Ptr("NC_M16_v1"), + }, + }, 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.AgentPool = armnetworkcloud.AgentPool{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.NetworkCloud/kubernetesClusters/agentPools"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/kubernetesClusters/kubernetesClusterName/agentPools/agentPoolName"), + // SystemData: &armnetworkcloud.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), + // CreatedBy: to.Ptr("identityA"), + // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), + // LastModifiedBy: to.Ptr("identityB"), + // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), + // }, + // Location: to.Ptr("location"), + // Tags: map[string]*string{ + // "key1": to.Ptr("myvalue1"), + // "key2": to.Ptr("myvalue2"), + // }, + // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Type: to.Ptr("CustomLocation"), + // }, + // Properties: &armnetworkcloud.AgentPoolProperties{ + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AgentOptions: &armnetworkcloud.AgentOptions{ + // HugepagesCount: to.Ptr[int64](96), + // HugepagesSize: to.Ptr(armnetworkcloud.HugepagesSizeOneG), + // }, + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // DetailedStatus: to.Ptr(armnetworkcloud.AgentPoolDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Agent pool is available"), + // KubernetesVersion: to.Ptr("1.24.3-1"), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // ProvisioningState: to.Ptr(armnetworkcloud.AgentPoolProvisioningStateSucceeded), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // UpgradeSettings: &armnetworkcloud.AgentPoolUpgradeSettings{ + // MaxSurge: to.Ptr("1"), + // }, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/AgentPools_Delete.json +func ExampleAgentPoolsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAgentPoolsClient().BeginDelete(ctx, "resourceGroupName", "kubernetesClusterName", "agentPoolName", 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/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/AgentPools_Patch.json +func ExampleAgentPoolsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAgentPoolsClient().BeginUpdate(ctx, "resourceGroupName", "kubernetesClusterName", "agentPoolName", armnetworkcloud.AgentPoolPatchParameters{ + Properties: &armnetworkcloud.AgentPoolPatchProperties{ + Count: to.Ptr[int64](3), + UpgradeSettings: &armnetworkcloud.AgentPoolUpgradeSettings{ + MaxSurge: to.Ptr("1"), + }, + }, + Tags: map[string]*string{ + "key1": to.Ptr("myvalue1"), + "key2": to.Ptr("myvalue2"), + }, + }, 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.AgentPool = armnetworkcloud.AgentPool{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.NetworkCloud/kubernetesClusters/agentPools"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/kubernetesClusters/kubernetesClusterName/agentPools/agentPoolName"), + // SystemData: &armnetworkcloud.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), + // CreatedBy: to.Ptr("identityA"), + // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), + // LastModifiedBy: to.Ptr("identityB"), + // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), + // }, + // Location: to.Ptr("location"), + // Tags: map[string]*string{ + // "key1": to.Ptr("myvalue1"), + // "key2": to.Ptr("myvalue2"), + // }, + // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Type: to.Ptr("CustomLocation"), + // }, + // Properties: &armnetworkcloud.AgentPoolProperties{ + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AgentOptions: &armnetworkcloud.AgentOptions{ + // HugepagesCount: to.Ptr[int64](96), + // HugepagesSize: to.Ptr(armnetworkcloud.HugepagesSizeOneG), + // }, + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // DetailedStatus: to.Ptr(armnetworkcloud.AgentPoolDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Agent pool is available"), + // KubernetesVersion: to.Ptr("1.24.3-1"), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // ProvisioningState: to.Ptr(armnetworkcloud.AgentPoolProvisioningStateSucceeded), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // UpgradeSettings: &armnetworkcloud.AgentPoolUpgradeSettings{ + // MaxSurge: to.Ptr("1"), + // }, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }, + // } +} diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/autorest.md b/sdk/resourcemanager/networkcloud/armnetworkcloud/autorest.md index 793f39f04470..f333ff1c5b03 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/autorest.md +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.0 -tag: package-2022-12-12-preview +module-version: 0.2.0 +tag: package-2023-05-01-preview ``` \ No newline at end of file diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachinekeysets_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachinekeysets_client.go index 9399563afd05..54bcd43bef16 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachinekeysets_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachinekeysets_client.go @@ -29,7 +29,7 @@ type BareMetalMachineKeySetsClient struct { } // NewBareMetalMachineKeySetsClient creates a new instance of BareMetalMachineKeySetsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewBareMetalMachineKeySetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BareMetalMachineKeySetsClient, error) { @@ -47,7 +47,7 @@ func NewBareMetalMachineKeySetsClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Create a new bare metal machine key set or update the existing one for the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - bareMetalMachineKeySetName - The name of the bare metal machine key set. @@ -71,7 +71,7 @@ func (client *BareMetalMachineKeySetsClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Create a new bare metal machine key set or update the existing one for the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachineKeySetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, bareMetalMachineKeySetName string, bareMetalMachineKeySetParameters BareMetalMachineKeySet, options *BareMetalMachineKeySetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetParameters, options) if err != nil { @@ -90,9 +90,6 @@ func (client *BareMetalMachineKeySetsClient) createOrUpdate(ctx context.Context, // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *BareMetalMachineKeySetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, bareMetalMachineKeySetName string, bareMetalMachineKeySetParameters BareMetalMachineKeySet, options *BareMetalMachineKeySetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" - 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") @@ -111,7 +108,7 @@ func (client *BareMetalMachineKeySetsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bareMetalMachineKeySetParameters) @@ -120,7 +117,7 @@ func (client *BareMetalMachineKeySetsClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Delete the bare metal machine key set of the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - bareMetalMachineKeySetName - The name of the bare metal machine key set. @@ -143,7 +140,7 @@ func (client *BareMetalMachineKeySetsClient) BeginDelete(ctx context.Context, re // Delete - Delete the bare metal machine key set of the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachineKeySetsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, bareMetalMachineKeySetName string, options *BareMetalMachineKeySetsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, bareMetalMachineKeySetName, options) if err != nil { @@ -162,9 +159,6 @@ func (client *BareMetalMachineKeySetsClient) deleteOperation(ctx context.Context // deleteCreateRequest creates the Delete request. func (client *BareMetalMachineKeySetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, bareMetalMachineKeySetName string, options *BareMetalMachineKeySetsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" - 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") @@ -183,7 +177,7 @@ func (client *BareMetalMachineKeySetsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +186,7 @@ func (client *BareMetalMachineKeySetsClient) deleteCreateRequest(ctx context.Con // Get - Get bare metal machine key set of the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - bareMetalMachineKeySetName - The name of the bare metal machine key set. @@ -216,9 +210,6 @@ func (client *BareMetalMachineKeySetsClient) Get(ctx context.Context, resourceGr // getCreateRequest creates the Get request. func (client *BareMetalMachineKeySetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, bareMetalMachineKeySetName string, options *BareMetalMachineKeySetsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" - 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") @@ -237,7 +228,7 @@ func (client *BareMetalMachineKeySetsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,47 +243,44 @@ func (client *BareMetalMachineKeySetsClient) getHandleResponse(resp *http.Respon return result, nil } -// NewListByResourceGroupPager - Get a list of bare metal machine key sets of the cluster in the provided resource group. +// NewListByClusterPager - Get a list of bare metal machine key sets for the provided cluster. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. -// - options - BareMetalMachineKeySetsClientListByResourceGroupOptions contains the optional parameters for the BareMetalMachineKeySetsClient.NewListByResourceGroupPager +// - options - BareMetalMachineKeySetsClientListByClusterOptions contains the optional parameters for the BareMetalMachineKeySetsClient.NewListByClusterPager // method. -func (client *BareMetalMachineKeySetsClient) NewListByResourceGroupPager(resourceGroupName string, clusterName string, options *BareMetalMachineKeySetsClientListByResourceGroupOptions) *runtime.Pager[BareMetalMachineKeySetsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[BareMetalMachineKeySetsClientListByResourceGroupResponse]{ - More: func(page BareMetalMachineKeySetsClientListByResourceGroupResponse) bool { +func (client *BareMetalMachineKeySetsClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *BareMetalMachineKeySetsClientListByClusterOptions) *runtime.Pager[BareMetalMachineKeySetsClientListByClusterResponse] { + return runtime.NewPager(runtime.PagingHandler[BareMetalMachineKeySetsClientListByClusterResponse]{ + More: func(page BareMetalMachineKeySetsClientListByClusterResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *BareMetalMachineKeySetsClientListByResourceGroupResponse) (BareMetalMachineKeySetsClientListByResourceGroupResponse, error) { + Fetcher: func(ctx context.Context, page *BareMetalMachineKeySetsClientListByClusterResponse) (BareMetalMachineKeySetsClientListByClusterResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, clusterName, options) + req, err = client.listByClusterCreateRequest(ctx, resourceGroupName, clusterName, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return BareMetalMachineKeySetsClientListByResourceGroupResponse{}, err + return BareMetalMachineKeySetsClientListByClusterResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return BareMetalMachineKeySetsClientListByResourceGroupResponse{}, err + return BareMetalMachineKeySetsClientListByClusterResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BareMetalMachineKeySetsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + return BareMetalMachineKeySetsClientListByClusterResponse{}, runtime.NewResponseError(resp) } - return client.listByResourceGroupHandleResponse(resp) + return client.listByClusterHandleResponse(resp) }, }) } -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *BareMetalMachineKeySetsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *BareMetalMachineKeySetsClientListByResourceGroupOptions) (*policy.Request, error) { +// listByClusterCreateRequest creates the ListByCluster request. +func (client *BareMetalMachineKeySetsClient) listByClusterCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *BareMetalMachineKeySetsClientListByClusterOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets" - 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") @@ -307,17 +295,17 @@ func (client *BareMetalMachineKeySetsClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *BareMetalMachineKeySetsClient) listByResourceGroupHandleResponse(resp *http.Response) (BareMetalMachineKeySetsClientListByResourceGroupResponse, error) { - result := BareMetalMachineKeySetsClientListByResourceGroupResponse{} +// listByClusterHandleResponse handles the ListByCluster response. +func (client *BareMetalMachineKeySetsClient) listByClusterHandleResponse(resp *http.Response) (BareMetalMachineKeySetsClientListByClusterResponse, error) { + result := BareMetalMachineKeySetsClientListByClusterResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.BareMetalMachineKeySetList); err != nil { - return BareMetalMachineKeySetsClientListByResourceGroupResponse{}, err + return BareMetalMachineKeySetsClientListByClusterResponse{}, err } return result, nil } @@ -326,7 +314,7 @@ func (client *BareMetalMachineKeySetsClient) listByResourceGroupHandleResponse(r // it. Properties and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - bareMetalMachineKeySetName - The name of the bare metal machine key set. @@ -340,7 +328,7 @@ func (client *BareMetalMachineKeySetsClient) BeginUpdate(ctx context.Context, re return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BareMetalMachineKeySetsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { return runtime.NewPollerFromResumeToken[BareMetalMachineKeySetsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -351,7 +339,7 @@ func (client *BareMetalMachineKeySetsClient) BeginUpdate(ctx context.Context, re // Properties and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachineKeySetsClient) update(ctx context.Context, resourceGroupName string, clusterName string, bareMetalMachineKeySetName string, bareMetalMachineKeySetUpdateParameters BareMetalMachineKeySetPatchParameters, options *BareMetalMachineKeySetsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetUpdateParameters, options) if err != nil { @@ -370,9 +358,6 @@ func (client *BareMetalMachineKeySetsClient) update(ctx context.Context, resourc // updateCreateRequest creates the Update request. func (client *BareMetalMachineKeySetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, bareMetalMachineKeySetName string, bareMetalMachineKeySetUpdateParameters BareMetalMachineKeySetPatchParameters, options *BareMetalMachineKeySetsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" - 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") @@ -391,7 +376,7 @@ func (client *BareMetalMachineKeySetsClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bareMetalMachineKeySetUpdateParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachinekeysets_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachinekeysets_client_example_test.go index 102ffab30f7f..a421ddc91b09 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachinekeysets_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachinekeysets_client_example_test.go @@ -20,8 +20,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_ListByResourceGroup.json -func ExampleBareMetalMachineKeySetsClient_NewListByResourceGroupPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachineKeySets_ListByCluster.json +func ExampleBareMetalMachineKeySetsClient_NewListByClusterPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -31,7 +31,7 @@ func ExampleBareMetalMachineKeySetsClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewBareMetalMachineKeySetsClient().NewListByResourceGroupPager("resourceGroupName", "clusterName", nil) + pager := clientFactory.NewBareMetalMachineKeySetsClient().NewListByClusterPager("resourceGroupName", "clusterName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -47,7 +47,7 @@ func ExampleBareMetalMachineKeySetsClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("bareMetalMachineKeySetName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters/bareMetalMachineKeySets"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bareMetalMachineKeySets/bareMetalMachineKeySetName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bareMetalMachineKeySets/bareMetalMachineKeySetName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -62,7 +62,7 @@ func ExampleBareMetalMachineKeySetsClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BareMetalMachineKeySetProperties{ @@ -109,7 +109,7 @@ func ExampleBareMetalMachineKeySetsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachineKeySets_Get.json func ExampleBareMetalMachineKeySetsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +130,7 @@ func ExampleBareMetalMachineKeySetsClient_Get() { // res.BareMetalMachineKeySet = armnetworkcloud.BareMetalMachineKeySet{ // Name: to.Ptr("bareMetalMachineKeySetName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters/bareMetalMachineKeySets"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bareMetalMachineKeySets/bareMetalMachineKeySetName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bareMetalMachineKeySets/bareMetalMachineKeySetName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -145,7 +145,7 @@ func ExampleBareMetalMachineKeySetsClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BareMetalMachineKeySetProperties{ @@ -190,7 +190,7 @@ func ExampleBareMetalMachineKeySetsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachineKeySets_Create.json func ExampleBareMetalMachineKeySetsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -208,7 +208,7 @@ func ExampleBareMetalMachineKeySetsClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.BareMetalMachineKeySetProperties{ @@ -249,7 +249,7 @@ func ExampleBareMetalMachineKeySetsClient_BeginCreateOrUpdate() { // res.BareMetalMachineKeySet = armnetworkcloud.BareMetalMachineKeySet{ // Name: to.Ptr("bareMetalMachineKeySetName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters/bareMetalMachineKeySets"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bareMetalMachineKeySets/bareMetalMachineKeySetName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bareMetalMachineKeySets/bareMetalMachineKeySetName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -264,7 +264,7 @@ func ExampleBareMetalMachineKeySetsClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BareMetalMachineKeySetProperties{ @@ -309,7 +309,7 @@ func ExampleBareMetalMachineKeySetsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachineKeySets_Delete.json func ExampleBareMetalMachineKeySetsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -330,7 +330,7 @@ func ExampleBareMetalMachineKeySetsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachineKeySets_Patch.json func ExampleBareMetalMachineKeySetsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -381,7 +381,7 @@ func ExampleBareMetalMachineKeySetsClient_BeginUpdate() { // res.BareMetalMachineKeySet = armnetworkcloud.BareMetalMachineKeySet{ // Name: to.Ptr("bareMetalMachineKeySetName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters/bareMetalMachineKeySets"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bareMetalMachineKeySets/bareMetalMachineKeySetName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bareMetalMachineKeySets/bareMetalMachineKeySetName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -396,7 +396,7 @@ func ExampleBareMetalMachineKeySetsClient_BeginUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BareMetalMachineKeySetProperties{ diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachines_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachines_client.go index 790f92ad36ce..bd7d39d4dcce 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachines_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachines_client.go @@ -29,7 +29,7 @@ type BareMetalMachinesClient struct { } // NewBareMetalMachinesClient creates a new instance of BareMetalMachinesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewBareMetalMachinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BareMetalMachinesClient, error) { @@ -47,7 +47,7 @@ func NewBareMetalMachinesClient(subscriptionID string, credential azcore.TokenCr // BeginCordon - Cordon the provided bare metal machine's Kubernetes node. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - options - BareMetalMachinesClientBeginCordonOptions contains the optional parameters for the BareMetalMachinesClient.BeginCordon @@ -69,7 +69,7 @@ func (client *BareMetalMachinesClient) BeginCordon(ctx context.Context, resource // Cordon - Cordon the provided bare metal machine's Kubernetes node. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) cordon(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginCordonOptions) (*http.Response, error) { req, err := client.cordonCreateRequest(ctx, resourceGroupName, bareMetalMachineName, options) if err != nil { @@ -88,9 +88,6 @@ func (client *BareMetalMachinesClient) cordon(ctx context.Context, resourceGroup // cordonCreateRequest creates the Cordon request. func (client *BareMetalMachinesClient) cordonCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginCordonOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/cordon" - 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") @@ -105,7 +102,7 @@ func (client *BareMetalMachinesClient) cordonCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.BareMetalMachineCordonParameters != nil { @@ -118,7 +115,7 @@ func (client *BareMetalMachinesClient) cordonCreateRequest(ctx context.Context, // requests will be rejected as the life cycle of this resource is managed by the system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - bareMetalMachineParameters - The request body. @@ -142,7 +139,7 @@ func (client *BareMetalMachinesClient) BeginCreateOrUpdate(ctx context.Context, // will be rejected as the life cycle of this resource is managed by the system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) createOrUpdate(ctx context.Context, resourceGroupName string, bareMetalMachineName string, bareMetalMachineParameters BareMetalMachine, options *BareMetalMachinesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, bareMetalMachineName, bareMetalMachineParameters, options) if err != nil { @@ -161,9 +158,6 @@ func (client *BareMetalMachinesClient) createOrUpdate(ctx context.Context, resou // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *BareMetalMachinesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, bareMetalMachineParameters BareMetalMachine, options *BareMetalMachinesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}" - 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") @@ -178,7 +172,7 @@ func (client *BareMetalMachinesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bareMetalMachineParameters) @@ -188,7 +182,7 @@ func (client *BareMetalMachinesClient) createOrUpdateCreateRequest(ctx context.C // of this resource is managed by the system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - options - BareMetalMachinesClientBeginDeleteOptions contains the optional parameters for the BareMetalMachinesClient.BeginDelete @@ -211,7 +205,7 @@ func (client *BareMetalMachinesClient) BeginDelete(ctx context.Context, resource // this resource is managed by the system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) deleteOperation(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, bareMetalMachineName, options) if err != nil { @@ -230,9 +224,6 @@ func (client *BareMetalMachinesClient) deleteOperation(ctx context.Context, reso // deleteCreateRequest creates the Delete request. func (client *BareMetalMachinesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}" - 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") @@ -247,7 +238,7 @@ func (client *BareMetalMachinesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,7 +247,7 @@ func (client *BareMetalMachinesClient) deleteCreateRequest(ctx context.Context, // Get - Get properties of the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - options - BareMetalMachinesClientGetOptions contains the optional parameters for the BareMetalMachinesClient.Get method. @@ -278,9 +269,6 @@ func (client *BareMetalMachinesClient) Get(ctx context.Context, resourceGroupNam // getCreateRequest creates the Get request. func (client *BareMetalMachinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}" - 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") @@ -295,7 +283,7 @@ func (client *BareMetalMachinesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -312,7 +300,7 @@ func (client *BareMetalMachinesClient) getHandleResponse(resp *http.Response) (B // NewListByResourceGroupPager - Get a list of bare metal machines in the provided resource group. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - BareMetalMachinesClientListByResourceGroupOptions contains the optional parameters for the BareMetalMachinesClient.NewListByResourceGroupPager // method. @@ -347,9 +335,6 @@ func (client *BareMetalMachinesClient) NewListByResourceGroupPager(resourceGroup // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *BareMetalMachinesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *BareMetalMachinesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines" - 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") @@ -360,7 +345,7 @@ func (client *BareMetalMachinesClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -377,7 +362,7 @@ func (client *BareMetalMachinesClient) listByResourceGroupHandleResponse(resp *h // NewListBySubscriptionPager - Get a list of bare metal machines in the provided subscription. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - options - BareMetalMachinesClientListBySubscriptionOptions contains the optional parameters for the BareMetalMachinesClient.NewListBySubscriptionPager // method. func (client *BareMetalMachinesClient) NewListBySubscriptionPager(options *BareMetalMachinesClientListBySubscriptionOptions) *runtime.Pager[BareMetalMachinesClientListBySubscriptionResponse] { @@ -411,16 +396,13 @@ func (client *BareMetalMachinesClient) NewListBySubscriptionPager(options *BareM // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *BareMetalMachinesClient) listBySubscriptionCreateRequest(ctx context.Context, options *BareMetalMachinesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/bareMetalMachines" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) 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", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -438,7 +420,7 @@ func (client *BareMetalMachinesClient) listBySubscriptionHandleResponse(resp *ht // BeginPowerOff - Power off the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - options - BareMetalMachinesClientBeginPowerOffOptions contains the optional parameters for the BareMetalMachinesClient.BeginPowerOff @@ -460,7 +442,7 @@ func (client *BareMetalMachinesClient) BeginPowerOff(ctx context.Context, resour // PowerOff - Power off the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) powerOff(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginPowerOffOptions) (*http.Response, error) { req, err := client.powerOffCreateRequest(ctx, resourceGroupName, bareMetalMachineName, options) if err != nil { @@ -479,9 +461,6 @@ func (client *BareMetalMachinesClient) powerOff(ctx context.Context, resourceGro // powerOffCreateRequest creates the PowerOff request. func (client *BareMetalMachinesClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginPowerOffOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/powerOff" - 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") @@ -496,7 +475,7 @@ func (client *BareMetalMachinesClient) powerOffCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.BareMetalMachinePowerOffParameters != nil { @@ -508,7 +487,7 @@ func (client *BareMetalMachinesClient) powerOffCreateRequest(ctx context.Context // BeginReimage - Reimage the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - options - BareMetalMachinesClientBeginReimageOptions contains the optional parameters for the BareMetalMachinesClient.BeginReimage @@ -530,7 +509,7 @@ func (client *BareMetalMachinesClient) BeginReimage(ctx context.Context, resourc // Reimage - Reimage the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) reimage(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginReimageOptions) (*http.Response, error) { req, err := client.reimageCreateRequest(ctx, resourceGroupName, bareMetalMachineName, options) if err != nil { @@ -549,9 +528,6 @@ func (client *BareMetalMachinesClient) reimage(ctx context.Context, resourceGrou // reimageCreateRequest creates the Reimage request. func (client *BareMetalMachinesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginReimageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/reimage" - 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") @@ -566,7 +542,7 @@ func (client *BareMetalMachinesClient) reimageCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -575,7 +551,7 @@ func (client *BareMetalMachinesClient) reimageCreateRequest(ctx context.Context, // BeginReplace - Replace the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - options - BareMetalMachinesClientBeginReplaceOptions contains the optional parameters for the BareMetalMachinesClient.BeginReplace @@ -597,7 +573,7 @@ func (client *BareMetalMachinesClient) BeginReplace(ctx context.Context, resourc // Replace - Replace the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) replace(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginReplaceOptions) (*http.Response, error) { req, err := client.replaceCreateRequest(ctx, resourceGroupName, bareMetalMachineName, options) if err != nil { @@ -616,9 +592,6 @@ func (client *BareMetalMachinesClient) replace(ctx context.Context, resourceGrou // replaceCreateRequest creates the Replace request. func (client *BareMetalMachinesClient) replaceCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginReplaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/replace" - 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") @@ -633,7 +606,7 @@ func (client *BareMetalMachinesClient) replaceCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.BareMetalMachineReplaceParameters != nil { @@ -645,7 +618,7 @@ func (client *BareMetalMachinesClient) replaceCreateRequest(ctx context.Context, // BeginRestart - Restart the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - options - BareMetalMachinesClientBeginRestartOptions contains the optional parameters for the BareMetalMachinesClient.BeginRestart @@ -667,7 +640,7 @@ func (client *BareMetalMachinesClient) BeginRestart(ctx context.Context, resourc // Restart - Restart the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) restart(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginRestartOptions) (*http.Response, error) { req, err := client.restartCreateRequest(ctx, resourceGroupName, bareMetalMachineName, options) if err != nil { @@ -686,9 +659,6 @@ func (client *BareMetalMachinesClient) restart(ctx context.Context, resourceGrou // restartCreateRequest creates the Restart request. func (client *BareMetalMachinesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginRestartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/restart" - 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") @@ -703,7 +673,7 @@ func (client *BareMetalMachinesClient) restartCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -714,7 +684,7 @@ func (client *BareMetalMachinesClient) restartCreateRequest(ctx context.Context, // once available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - bareMetalMachineRunCommandParameters - The request body. @@ -739,7 +709,7 @@ func (client *BareMetalMachinesClient) BeginRunCommand(ctx context.Context, reso // once available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) runCommand(ctx context.Context, resourceGroupName string, bareMetalMachineName string, bareMetalMachineRunCommandParameters BareMetalMachineRunCommandParameters, options *BareMetalMachinesClientBeginRunCommandOptions) (*http.Response, error) { req, err := client.runCommandCreateRequest(ctx, resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters, options) if err != nil { @@ -758,9 +728,6 @@ func (client *BareMetalMachinesClient) runCommand(ctx context.Context, resourceG // runCommandCreateRequest creates the RunCommand request. func (client *BareMetalMachinesClient) runCommandCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, bareMetalMachineRunCommandParameters BareMetalMachineRunCommandParameters, options *BareMetalMachinesClientBeginRunCommandOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runCommand" - 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") @@ -775,7 +742,7 @@ func (client *BareMetalMachinesClient) runCommandCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bareMetalMachineRunCommandParameters) @@ -786,7 +753,7 @@ func (client *BareMetalMachinesClient) runCommandCreateRequest(ctx context.Conte // API once available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - bareMetalMachineRunDataExtractsParameters - The request body. @@ -811,7 +778,7 @@ func (client *BareMetalMachinesClient) BeginRunDataExtracts(ctx context.Context, // API once available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) runDataExtracts(ctx context.Context, resourceGroupName string, bareMetalMachineName string, bareMetalMachineRunDataExtractsParameters BareMetalMachineRunDataExtractsParameters, options *BareMetalMachinesClientBeginRunDataExtractsOptions) (*http.Response, error) { req, err := client.runDataExtractsCreateRequest(ctx, resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters, options) if err != nil { @@ -830,9 +797,6 @@ func (client *BareMetalMachinesClient) runDataExtracts(ctx context.Context, reso // runDataExtractsCreateRequest creates the RunDataExtracts request. func (client *BareMetalMachinesClient) runDataExtractsCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, bareMetalMachineRunDataExtractsParameters BareMetalMachineRunDataExtractsParameters, options *BareMetalMachinesClientBeginRunDataExtractsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts" - 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") @@ -847,7 +811,7 @@ func (client *BareMetalMachinesClient) runDataExtractsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bareMetalMachineRunDataExtractsParameters) @@ -858,7 +822,7 @@ func (client *BareMetalMachinesClient) runDataExtractsCreateRequest(ctx context. // status API once available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - bareMetalMachineRunReadCommandsParameters - The request body. @@ -883,7 +847,7 @@ func (client *BareMetalMachinesClient) BeginRunReadCommands(ctx context.Context, // status API once available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) runReadCommands(ctx context.Context, resourceGroupName string, bareMetalMachineName string, bareMetalMachineRunReadCommandsParameters BareMetalMachineRunReadCommandsParameters, options *BareMetalMachinesClientBeginRunReadCommandsOptions) (*http.Response, error) { req, err := client.runReadCommandsCreateRequest(ctx, resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters, options) if err != nil { @@ -902,9 +866,6 @@ func (client *BareMetalMachinesClient) runReadCommands(ctx context.Context, reso // runReadCommandsCreateRequest creates the RunReadCommands request. func (client *BareMetalMachinesClient) runReadCommandsCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, bareMetalMachineRunReadCommandsParameters BareMetalMachineRunReadCommandsParameters, options *BareMetalMachinesClientBeginRunReadCommandsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runReadCommands" - 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") @@ -919,7 +880,7 @@ func (client *BareMetalMachinesClient) runReadCommandsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bareMetalMachineRunReadCommandsParameters) @@ -928,7 +889,7 @@ func (client *BareMetalMachinesClient) runReadCommandsCreateRequest(ctx context. // BeginStart - Start the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - options - BareMetalMachinesClientBeginStartOptions contains the optional parameters for the BareMetalMachinesClient.BeginStart @@ -950,7 +911,7 @@ func (client *BareMetalMachinesClient) BeginStart(ctx context.Context, resourceG // Start - Start the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) start(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, bareMetalMachineName, options) if err != nil { @@ -969,9 +930,6 @@ func (client *BareMetalMachinesClient) start(ctx context.Context, resourceGroupN // startCreateRequest creates the Start request. func (client *BareMetalMachinesClient) startCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginStartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/start" - 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") @@ -986,7 +944,7 @@ func (client *BareMetalMachinesClient) startCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -995,7 +953,7 @@ func (client *BareMetalMachinesClient) startCreateRequest(ctx context.Context, r // BeginUncordon - Uncordon the provided bare metal machine's Kubernetes node. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - options - BareMetalMachinesClientBeginUncordonOptions contains the optional parameters for the BareMetalMachinesClient.BeginUncordon @@ -1017,7 +975,7 @@ func (client *BareMetalMachinesClient) BeginUncordon(ctx context.Context, resour // Uncordon - Uncordon the provided bare metal machine's Kubernetes node. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) uncordon(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginUncordonOptions) (*http.Response, error) { req, err := client.uncordonCreateRequest(ctx, resourceGroupName, bareMetalMachineName, options) if err != nil { @@ -1036,9 +994,6 @@ func (client *BareMetalMachinesClient) uncordon(ctx context.Context, resourceGro // uncordonCreateRequest creates the Uncordon request. func (client *BareMetalMachinesClient) uncordonCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, options *BareMetalMachinesClientBeginUncordonOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/uncordon" - 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") @@ -1053,7 +1008,7 @@ func (client *BareMetalMachinesClient) uncordonCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1063,7 +1018,7 @@ func (client *BareMetalMachinesClient) uncordonCreateRequest(ctx context.Context // Properties and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - bareMetalMachineUpdateParameters - The request body. @@ -1076,7 +1031,7 @@ func (client *BareMetalMachinesClient) BeginUpdate(ctx context.Context, resource return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BareMetalMachinesClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { return runtime.NewPollerFromResumeToken[BareMetalMachinesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -1087,7 +1042,7 @@ func (client *BareMetalMachinesClient) BeginUpdate(ctx context.Context, resource // and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) update(ctx context.Context, resourceGroupName string, bareMetalMachineName string, bareMetalMachineUpdateParameters BareMetalMachinePatchParameters, options *BareMetalMachinesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, bareMetalMachineName, bareMetalMachineUpdateParameters, options) if err != nil { @@ -1106,9 +1061,6 @@ func (client *BareMetalMachinesClient) update(ctx context.Context, resourceGroup // updateCreateRequest creates the Update request. func (client *BareMetalMachinesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, bareMetalMachineUpdateParameters BareMetalMachinePatchParameters, options *BareMetalMachinesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}" - 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") @@ -1123,7 +1075,7 @@ func (client *BareMetalMachinesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bareMetalMachineUpdateParameters) @@ -1132,7 +1084,7 @@ func (client *BareMetalMachinesClient) updateCreateRequest(ctx context.Context, // BeginValidateHardware - Validate the hardware of the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - bareMetalMachineName - The name of the bare metal machine. // - bareMetalMachineValidateHardwareParameters - The request body. @@ -1155,7 +1107,7 @@ func (client *BareMetalMachinesClient) BeginValidateHardware(ctx context.Context // ValidateHardware - Validate the hardware of the provided bare metal machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BareMetalMachinesClient) validateHardware(ctx context.Context, resourceGroupName string, bareMetalMachineName string, bareMetalMachineValidateHardwareParameters BareMetalMachineValidateHardwareParameters, options *BareMetalMachinesClientBeginValidateHardwareOptions) (*http.Response, error) { req, err := client.validateHardwareCreateRequest(ctx, resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters, options) if err != nil { @@ -1174,9 +1126,6 @@ func (client *BareMetalMachinesClient) validateHardware(ctx context.Context, res // validateHardwareCreateRequest creates the ValidateHardware request. func (client *BareMetalMachinesClient) validateHardwareCreateRequest(ctx context.Context, resourceGroupName string, bareMetalMachineName string, bareMetalMachineValidateHardwareParameters BareMetalMachineValidateHardwareParameters, options *BareMetalMachinesClientBeginValidateHardwareOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/validateHardware" - 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") @@ -1191,7 +1140,7 @@ func (client *BareMetalMachinesClient) validateHardwareCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bareMetalMachineValidateHardwareParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachines_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachines_client_example_test.go index 1d949d3ca7c1..d0eea67d7961 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachines_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/baremetalmachines_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_ListBySubscription.json func ExampleBareMetalMachinesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleBareMetalMachinesClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("bareMetalMachineName"), // Type: to.Ptr("Microsoft.NetworkCloud/bareMetalMachines"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -60,36 +60,36 @@ func ExampleBareMetalMachinesClient_NewListBySubscriptionPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BareMetalMachineProperties{ - // BmcConnectionString: to.Ptr("bmcconnectionstring"), - // BmcCredentials: &armnetworkcloud.AdministrativeCredentials{ - // Username: to.Ptr("bmcuser"), - // }, - // BmcMacAddress: to.Ptr("00:00:4f:00:57:00"), - // BootMacAddress: to.Ptr("00:00:4e:00:58:af"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // CordonStatus: to.Ptr(armnetworkcloud.BareMetalMachineCordonStatusUncordoned), - // DetailedStatus: to.Ptr(armnetworkcloud.BareMetalMachineDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("DetailedStatusMessage"), - // HardwareInventory: &armnetworkcloud.HardwareInventory{ - // AdditionalHostInformation: to.Ptr("Machine specific information..."), - // Interfaces: []*armnetworkcloud.HardwareInventoryNetworkInterface{ - // { - // Name: to.Ptr("networkInterfaceName"), - // LinkStatus: to.Ptr("Up"), - // MacAddress: to.Ptr("2C:54:91:88:C9:E3"), - // NetworkInterfaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), - // }}, - // }, - // HardwareValidationStatus: &armnetworkcloud.HardwareValidationStatus{ - // LastValidationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T13:27:03.008Z"); return t}()), - // Result: to.Ptr(armnetworkcloud.BareMetalMachineHardwareValidationResultPass), - // }, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // BmcConnectionString: to.Ptr("bmcconnectionstring"), + // BmcCredentials: &armnetworkcloud.AdministrativeCredentials{ + // Username: to.Ptr("bmcuser"), + // }, + // BmcMacAddress: to.Ptr("00:00:4f:00:57:00"), + // BootMacAddress: to.Ptr("00:00:4e:00:58:af"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // CordonStatus: to.Ptr(armnetworkcloud.BareMetalMachineCordonStatusUncordoned), + // DetailedStatus: to.Ptr(armnetworkcloud.BareMetalMachineDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("DetailedStatusMessage"), + // HardwareInventory: &armnetworkcloud.HardwareInventory{ + // AdditionalHostInformation: to.Ptr("Machine specific information..."), + // Interfaces: []*armnetworkcloud.HardwareInventoryNetworkInterface{ + // { + // Name: to.Ptr("networkInterfaceName"), + // LinkStatus: to.Ptr("Up"), + // MacAddress: to.Ptr("2C:54:91:88:C9:E3"), + // NetworkInterfaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), + // }}, + // }, + // HardwareValidationStatus: &armnetworkcloud.HardwareValidationStatus{ + // LastValidationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T13:27:03.008Z"); return t}()), + // Result: to.Ptr(armnetworkcloud.BareMetalMachineHardwareValidationResultPass), + // }, // KubernetesNodeName: to.Ptr("node01"), // KubernetesVersion: to.Ptr("1.21"), // MachineDetails: to.Ptr("User-provided machine details."), @@ -100,20 +100,18 @@ func ExampleBareMetalMachinesClient_NewListBySubscriptionPager() { // OSImage: to.Ptr("v20220805e"), // PowerState: to.Ptr(armnetworkcloud.BareMetalMachinePowerStateOn), // ProvisioningState: to.Ptr(armnetworkcloud.BareMetalMachineProvisioningStateSucceeded), - // RackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // RackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // RackSlot: to.Ptr[int64](1), // ReadyState: to.Ptr(armnetworkcloud.BareMetalMachineReadyStateTrue), // SerialNumber: to.Ptr("BM1219XXX"), // ServiceTag: to.Ptr("ST1219XXX"), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // }}, - // } + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_ListByResourceGroup.json func ExampleBareMetalMachinesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -140,7 +138,7 @@ func ExampleBareMetalMachinesClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("bareMetalMachineName"), // Type: to.Ptr("Microsoft.NetworkCloud/bareMetalMachines"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -155,36 +153,36 @@ func ExampleBareMetalMachinesClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BareMetalMachineProperties{ - // BmcConnectionString: to.Ptr("bmcconnectionstring"), - // BmcCredentials: &armnetworkcloud.AdministrativeCredentials{ - // Username: to.Ptr("bmcuser"), - // }, - // BmcMacAddress: to.Ptr("00:00:4f:00:57:00"), - // BootMacAddress: to.Ptr("00:00:4e:00:58:af"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // CordonStatus: to.Ptr(armnetworkcloud.BareMetalMachineCordonStatusUncordoned), - // DetailedStatus: to.Ptr(armnetworkcloud.BareMetalMachineDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("DetailedStatusMessage"), - // HardwareInventory: &armnetworkcloud.HardwareInventory{ - // AdditionalHostInformation: to.Ptr("Machine specific information..."), - // Interfaces: []*armnetworkcloud.HardwareInventoryNetworkInterface{ - // { - // Name: to.Ptr("networkInterfaceName"), - // LinkStatus: to.Ptr("Up"), - // MacAddress: to.Ptr("2C:54:91:88:C9:E3"), - // NetworkInterfaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), - // }}, - // }, - // HardwareValidationStatus: &armnetworkcloud.HardwareValidationStatus{ - // LastValidationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T13:27:03.008Z"); return t}()), - // Result: to.Ptr(armnetworkcloud.BareMetalMachineHardwareValidationResultPass), - // }, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // BmcConnectionString: to.Ptr("bmcconnectionstring"), + // BmcCredentials: &armnetworkcloud.AdministrativeCredentials{ + // Username: to.Ptr("bmcuser"), + // }, + // BmcMacAddress: to.Ptr("00:00:4f:00:57:00"), + // BootMacAddress: to.Ptr("00:00:4e:00:58:af"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // CordonStatus: to.Ptr(armnetworkcloud.BareMetalMachineCordonStatusUncordoned), + // DetailedStatus: to.Ptr(armnetworkcloud.BareMetalMachineDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("DetailedStatusMessage"), + // HardwareInventory: &armnetworkcloud.HardwareInventory{ + // AdditionalHostInformation: to.Ptr("Machine specific information..."), + // Interfaces: []*armnetworkcloud.HardwareInventoryNetworkInterface{ + // { + // Name: to.Ptr("networkInterfaceName"), + // LinkStatus: to.Ptr("Up"), + // MacAddress: to.Ptr("2C:54:91:88:C9:E3"), + // NetworkInterfaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), + // }}, + // }, + // HardwareValidationStatus: &armnetworkcloud.HardwareValidationStatus{ + // LastValidationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T13:27:03.008Z"); return t}()), + // Result: to.Ptr(armnetworkcloud.BareMetalMachineHardwareValidationResultPass), + // }, // KubernetesNodeName: to.Ptr("node01"), // KubernetesVersion: to.Ptr("1.21"), // MachineDetails: to.Ptr("User-provided machine details."), @@ -195,20 +193,18 @@ func ExampleBareMetalMachinesClient_NewListByResourceGroupPager() { // OSImage: to.Ptr("v20220805e"), // PowerState: to.Ptr(armnetworkcloud.BareMetalMachinePowerStateOn), // ProvisioningState: to.Ptr(armnetworkcloud.BareMetalMachineProvisioningStateSucceeded), - // RackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // RackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // RackSlot: to.Ptr[int64](1), // ReadyState: to.Ptr(armnetworkcloud.BareMetalMachineReadyStateTrue), // SerialNumber: to.Ptr("BM1219XXX"), // ServiceTag: to.Ptr("ST1219XXX"), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // }}, - // } + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_Get.json func ExampleBareMetalMachinesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -229,7 +225,7 @@ func ExampleBareMetalMachinesClient_Get() { // res.BareMetalMachine = armnetworkcloud.BareMetalMachine{ // Name: to.Ptr("bareMetalMachineName"), // Type: to.Ptr("Microsoft.NetworkCloud/bareMetalMachines"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -244,36 +240,36 @@ func ExampleBareMetalMachinesClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BareMetalMachineProperties{ - // BmcConnectionString: to.Ptr("bmcconnectionstring"), - // BmcCredentials: &armnetworkcloud.AdministrativeCredentials{ - // Username: to.Ptr("bmcuser"), - // }, - // BmcMacAddress: to.Ptr("00:00:4f:00:57:00"), - // BootMacAddress: to.Ptr("00:00:4e:00:58:af"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // CordonStatus: to.Ptr(armnetworkcloud.BareMetalMachineCordonStatusUncordoned), - // DetailedStatus: to.Ptr(armnetworkcloud.BareMetalMachineDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("DetailedStatusMessage"), - // HardwareInventory: &armnetworkcloud.HardwareInventory{ - // AdditionalHostInformation: to.Ptr("Machine specific information..."), - // Interfaces: []*armnetworkcloud.HardwareInventoryNetworkInterface{ - // { - // Name: to.Ptr("networkInterfaceName"), - // LinkStatus: to.Ptr("Up"), - // MacAddress: to.Ptr("2C:54:91:88:C9:E3"), - // NetworkInterfaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), - // }}, - // }, - // HardwareValidationStatus: &armnetworkcloud.HardwareValidationStatus{ - // LastValidationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T13:27:03.008Z"); return t}()), - // Result: to.Ptr(armnetworkcloud.BareMetalMachineHardwareValidationResultPass), - // }, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // BmcConnectionString: to.Ptr("bmcconnectionstring"), + // BmcCredentials: &armnetworkcloud.AdministrativeCredentials{ + // Username: to.Ptr("bmcuser"), + // }, + // BmcMacAddress: to.Ptr("00:00:4f:00:57:00"), + // BootMacAddress: to.Ptr("00:00:4e:00:58:af"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // CordonStatus: to.Ptr(armnetworkcloud.BareMetalMachineCordonStatusUncordoned), + // DetailedStatus: to.Ptr(armnetworkcloud.BareMetalMachineDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("DetailedStatusMessage"), + // HardwareInventory: &armnetworkcloud.HardwareInventory{ + // AdditionalHostInformation: to.Ptr("Machine specific information..."), + // Interfaces: []*armnetworkcloud.HardwareInventoryNetworkInterface{ + // { + // Name: to.Ptr("networkInterfaceName"), + // LinkStatus: to.Ptr("Up"), + // MacAddress: to.Ptr("2C:54:91:88:C9:E3"), + // NetworkInterfaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), + // }}, + // }, + // HardwareValidationStatus: &armnetworkcloud.HardwareValidationStatus{ + // LastValidationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T13:27:03.008Z"); return t}()), + // Result: to.Ptr(armnetworkcloud.BareMetalMachineHardwareValidationResultPass), + // }, // KubernetesNodeName: to.Ptr("node01"), // KubernetesVersion: to.Ptr("1.21"), // MachineDetails: to.Ptr("User-provided machine details."), @@ -284,18 +280,16 @@ func ExampleBareMetalMachinesClient_Get() { // OSImage: to.Ptr("v20220805e"), // PowerState: to.Ptr(armnetworkcloud.BareMetalMachinePowerStateOn), // ProvisioningState: to.Ptr(armnetworkcloud.BareMetalMachineProvisioningStateSucceeded), - // RackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // RackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // RackSlot: to.Ptr[int64](1), // ReadyState: to.Ptr(armnetworkcloud.BareMetalMachineReadyStateTrue), // SerialNumber: to.Ptr("BM1219XXX"), // ServiceTag: to.Ptr("ST1219XXX"), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_Create.json func ExampleBareMetalMachinesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -313,7 +307,7 @@ func ExampleBareMetalMachinesClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.BareMetalMachineProperties{ @@ -327,7 +321,7 @@ func ExampleBareMetalMachinesClient_BeginCreateOrUpdate() { MachineDetails: to.Ptr("User-provided machine details."), MachineName: to.Ptr("r01c001"), MachineSKUID: to.Ptr("684E-3B16-399E"), - RackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + RackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), RackSlot: to.Ptr[int64](1), SerialNumber: to.Ptr("BM1219XXX"), }, @@ -345,7 +339,7 @@ func ExampleBareMetalMachinesClient_BeginCreateOrUpdate() { // res.BareMetalMachine = armnetworkcloud.BareMetalMachine{ // Name: to.Ptr("bareMetalMachineName"), // Type: to.Ptr("Microsoft.NetworkCloud/bareMetalMachines"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -360,36 +354,36 @@ func ExampleBareMetalMachinesClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BareMetalMachineProperties{ - // BmcConnectionString: to.Ptr("bmcconnectionstring"), - // BmcCredentials: &armnetworkcloud.AdministrativeCredentials{ - // Username: to.Ptr("bmcuser"), - // }, - // BmcMacAddress: to.Ptr("00:00:4f:00:57:00"), - // BootMacAddress: to.Ptr("00:00:4e:00:58:af"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // CordonStatus: to.Ptr(armnetworkcloud.BareMetalMachineCordonStatusUncordoned), - // DetailedStatus: to.Ptr(armnetworkcloud.BareMetalMachineDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("DetailedStatusMessage"), - // HardwareInventory: &armnetworkcloud.HardwareInventory{ - // AdditionalHostInformation: to.Ptr("Machine specific information..."), - // Interfaces: []*armnetworkcloud.HardwareInventoryNetworkInterface{ - // { - // Name: to.Ptr("networkInterfaceName"), - // LinkStatus: to.Ptr("Up"), - // MacAddress: to.Ptr("2C:54:91:88:C9:E3"), - // NetworkInterfaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), - // }}, - // }, - // HardwareValidationStatus: &armnetworkcloud.HardwareValidationStatus{ - // LastValidationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T13:27:03.008Z"); return t}()), - // Result: to.Ptr(armnetworkcloud.BareMetalMachineHardwareValidationResultPass), - // }, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // BmcConnectionString: to.Ptr("bmcconnectionstring"), + // BmcCredentials: &armnetworkcloud.AdministrativeCredentials{ + // Username: to.Ptr("bmcuser"), + // }, + // BmcMacAddress: to.Ptr("00:00:4f:00:57:00"), + // BootMacAddress: to.Ptr("00:00:4e:00:58:af"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // CordonStatus: to.Ptr(armnetworkcloud.BareMetalMachineCordonStatusUncordoned), + // DetailedStatus: to.Ptr(armnetworkcloud.BareMetalMachineDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("DetailedStatusMessage"), + // HardwareInventory: &armnetworkcloud.HardwareInventory{ + // AdditionalHostInformation: to.Ptr("Machine specific information..."), + // Interfaces: []*armnetworkcloud.HardwareInventoryNetworkInterface{ + // { + // Name: to.Ptr("networkInterfaceName"), + // LinkStatus: to.Ptr("Up"), + // MacAddress: to.Ptr("2C:54:91:88:C9:E3"), + // NetworkInterfaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), + // }}, + // }, + // HardwareValidationStatus: &armnetworkcloud.HardwareValidationStatus{ + // LastValidationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T13:27:03.008Z"); return t}()), + // Result: to.Ptr(armnetworkcloud.BareMetalMachineHardwareValidationResultPass), + // }, // KubernetesNodeName: to.Ptr("node01"), // KubernetesVersion: to.Ptr("1.21"), // MachineDetails: to.Ptr("User-provided machine details."), @@ -400,18 +394,16 @@ func ExampleBareMetalMachinesClient_BeginCreateOrUpdate() { // OSImage: to.Ptr("v20220805e"), // PowerState: to.Ptr(armnetworkcloud.BareMetalMachinePowerStateOn), // ProvisioningState: to.Ptr(armnetworkcloud.BareMetalMachineProvisioningStateSucceeded), - // RackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // RackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // RackSlot: to.Ptr[int64](1), // ReadyState: to.Ptr(armnetworkcloud.BareMetalMachineReadyStateTrue), // SerialNumber: to.Ptr("BM1219XXX"), // ServiceTag: to.Ptr("ST1219XXX"), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_Delete.json func ExampleBareMetalMachinesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -432,7 +424,7 @@ func ExampleBareMetalMachinesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_Patch.json func ExampleBareMetalMachinesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -465,7 +457,7 @@ func ExampleBareMetalMachinesClient_BeginUpdate() { // res.BareMetalMachine = armnetworkcloud.BareMetalMachine{ // Name: to.Ptr("bareMetalMachineName"), // Type: to.Ptr("Microsoft.NetworkCloud/bareMetalMachines"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -480,36 +472,36 @@ func ExampleBareMetalMachinesClient_BeginUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BareMetalMachineProperties{ - // BmcConnectionString: to.Ptr("bmcconnectionstring"), - // BmcCredentials: &armnetworkcloud.AdministrativeCredentials{ - // Username: to.Ptr("bmcuser"), - // }, - // BmcMacAddress: to.Ptr("00:00:4f:00:57:00"), - // BootMacAddress: to.Ptr("00:00:4e:00:58:af"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // CordonStatus: to.Ptr(armnetworkcloud.BareMetalMachineCordonStatusUncordoned), - // DetailedStatus: to.Ptr(armnetworkcloud.BareMetalMachineDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("DetailedStatusMessage"), - // HardwareInventory: &armnetworkcloud.HardwareInventory{ - // AdditionalHostInformation: to.Ptr("Machine specific information..."), - // Interfaces: []*armnetworkcloud.HardwareInventoryNetworkInterface{ - // { - // Name: to.Ptr("networkInterfaceName"), - // LinkStatus: to.Ptr("Up"), - // MacAddress: to.Ptr("2C:54:91:88:C9:E3"), - // NetworkInterfaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), - // }}, - // }, - // HardwareValidationStatus: &armnetworkcloud.HardwareValidationStatus{ - // LastValidationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T13:27:03.008Z"); return t}()), - // Result: to.Ptr(armnetworkcloud.BareMetalMachineHardwareValidationResultPass), - // }, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // BmcConnectionString: to.Ptr("bmcconnectionstring"), + // BmcCredentials: &armnetworkcloud.AdministrativeCredentials{ + // Username: to.Ptr("bmcuser"), + // }, + // BmcMacAddress: to.Ptr("00:00:4f:00:57:00"), + // BootMacAddress: to.Ptr("00:00:4e:00:58:af"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // CordonStatus: to.Ptr(armnetworkcloud.BareMetalMachineCordonStatusUncordoned), + // DetailedStatus: to.Ptr(armnetworkcloud.BareMetalMachineDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("DetailedStatusMessage"), + // HardwareInventory: &armnetworkcloud.HardwareInventory{ + // AdditionalHostInformation: to.Ptr("Machine specific information..."), + // Interfaces: []*armnetworkcloud.HardwareInventoryNetworkInterface{ + // { + // Name: to.Ptr("networkInterfaceName"), + // LinkStatus: to.Ptr("Up"), + // MacAddress: to.Ptr("2C:54:91:88:C9:E3"), + // NetworkInterfaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkDevices/networkDeviceName/networkInterfaces/networkInterfaceName"), + // }}, + // }, + // HardwareValidationStatus: &armnetworkcloud.HardwareValidationStatus{ + // LastValidationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-30T13:27:03.008Z"); return t}()), + // Result: to.Ptr(armnetworkcloud.BareMetalMachineHardwareValidationResultPass), + // }, // KubernetesNodeName: to.Ptr("node01"), // KubernetesVersion: to.Ptr("1.21"), // MachineDetails: to.Ptr("User-provided machine details."), @@ -520,18 +512,16 @@ func ExampleBareMetalMachinesClient_BeginUpdate() { // OSImage: to.Ptr("v20220805e"), // PowerState: to.Ptr(armnetworkcloud.BareMetalMachinePowerStateOn), // ProvisioningState: to.Ptr(armnetworkcloud.BareMetalMachineProvisioningStateSucceeded), - // RackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // RackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // RackSlot: to.Ptr[int64](1), // ReadyState: to.Ptr(armnetworkcloud.BareMetalMachineReadyStateTrue), // SerialNumber: to.Ptr("BM1219XXX"), // ServiceTag: to.Ptr("ST1219XXX"), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Cordon.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_Cordon.json func ExampleBareMetalMachinesClient_BeginCordon() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -555,7 +545,7 @@ func ExampleBareMetalMachinesClient_BeginCordon() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_PowerOff.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_PowerOff.json func ExampleBareMetalMachinesClient_BeginPowerOff() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -579,7 +569,7 @@ func ExampleBareMetalMachinesClient_BeginPowerOff() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Reimage.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_Reimage.json func ExampleBareMetalMachinesClient_BeginReimage() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -600,7 +590,7 @@ func ExampleBareMetalMachinesClient_BeginReimage() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Replace.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_Replace.json func ExampleBareMetalMachinesClient_BeginReplace() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -631,7 +621,7 @@ func ExampleBareMetalMachinesClient_BeginReplace() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Restart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_Restart.json func ExampleBareMetalMachinesClient_BeginRestart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -652,7 +642,7 @@ func ExampleBareMetalMachinesClient_BeginRestart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunCommand.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_RunCommand.json func ExampleBareMetalMachinesClient_BeginRunCommand() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -679,7 +669,7 @@ func ExampleBareMetalMachinesClient_BeginRunCommand() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunDataExtracts.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_RunDataExtracts.json func ExampleBareMetalMachinesClient_BeginRunDataExtracts() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -694,7 +684,10 @@ func ExampleBareMetalMachinesClient_BeginRunDataExtracts() { LimitTimeSeconds: to.Ptr[int64](60), Commands: []*armnetworkcloud.BareMetalMachineCommandSpecification{ { - Command: to.Ptr("networkInfo"), + Arguments: []*string{ + to.Ptr("SysInfo"), + to.Ptr("TTYLog")}, + Command: to.Ptr("hardware-support-data-collection"), }}, }, nil) if err != nil { @@ -706,7 +699,7 @@ func ExampleBareMetalMachinesClient_BeginRunDataExtracts() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunReadCommands.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_RunReadCommands.json func ExampleBareMetalMachinesClient_BeginRunReadCommands() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -743,7 +736,7 @@ func ExampleBareMetalMachinesClient_BeginRunReadCommands() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Start.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_Start.json func ExampleBareMetalMachinesClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -764,7 +757,7 @@ func ExampleBareMetalMachinesClient_BeginStart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Uncordon.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_Uncordon.json func ExampleBareMetalMachinesClient_BeginUncordon() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -785,7 +778,7 @@ func ExampleBareMetalMachinesClient_BeginUncordon() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ValidateHardware.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BareMetalMachines_ValidateHardware.json func ExampleBareMetalMachinesClient_BeginValidateHardware() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/bmckeysets_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/bmckeysets_client.go index 81532d38598c..e5bf5f12a8b1 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/bmckeysets_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/bmckeysets_client.go @@ -29,7 +29,7 @@ type BmcKeySetsClient struct { } // NewBmcKeySetsClient creates a new instance of BmcKeySetsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewBmcKeySetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BmcKeySetsClient, error) { @@ -48,7 +48,7 @@ func NewBmcKeySetsClient(subscriptionID string, credential azcore.TokenCredentia // cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - bmcKeySetName - The name of the baseboard management controller key set. @@ -72,7 +72,7 @@ func (client *BmcKeySetsClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Create a new baseboard management controller key set or update the existing one for the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BmcKeySetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, bmcKeySetName string, bmcKeySetParameters BmcKeySet, options *BmcKeySetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, bmcKeySetName, bmcKeySetParameters, options) if err != nil { @@ -91,9 +91,6 @@ func (client *BmcKeySetsClient) createOrUpdate(ctx context.Context, resourceGrou // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *BmcKeySetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, bmcKeySetName string, bmcKeySetParameters BmcKeySet, options *BmcKeySetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" - 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") @@ -112,7 +109,7 @@ func (client *BmcKeySetsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bmcKeySetParameters) @@ -121,7 +118,7 @@ func (client *BmcKeySetsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Delete the baseboard management controller key set of the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - bmcKeySetName - The name of the baseboard management controller key set. @@ -143,7 +140,7 @@ func (client *BmcKeySetsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete the baseboard management controller key set of the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BmcKeySetsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, bmcKeySetName string, options *BmcKeySetsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, bmcKeySetName, options) if err != nil { @@ -162,9 +159,6 @@ func (client *BmcKeySetsClient) deleteOperation(ctx context.Context, resourceGro // deleteCreateRequest creates the Delete request. func (client *BmcKeySetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, bmcKeySetName string, options *BmcKeySetsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" - 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") @@ -183,7 +177,7 @@ func (client *BmcKeySetsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +186,7 @@ func (client *BmcKeySetsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get baseboard management controller key set of the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - bmcKeySetName - The name of the baseboard management controller key set. @@ -215,9 +209,6 @@ func (client *BmcKeySetsClient) Get(ctx context.Context, resourceGroupName strin // getCreateRequest creates the Get request. func (client *BmcKeySetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, bmcKeySetName string, options *BmcKeySetsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" - 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") @@ -236,7 +227,7 @@ func (client *BmcKeySetsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,48 +242,44 @@ func (client *BmcKeySetsClient) getHandleResponse(resp *http.Response) (BmcKeySe return result, nil } -// NewListByResourceGroupPager - Get a list of baseboard management controller key sets of the cluster in the provided resource -// group. +// NewListByClusterPager - Get a list of baseboard management controller key sets for the provided cluster. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. -// - options - BmcKeySetsClientListByResourceGroupOptions contains the optional parameters for the BmcKeySetsClient.NewListByResourceGroupPager +// - options - BmcKeySetsClientListByClusterOptions contains the optional parameters for the BmcKeySetsClient.NewListByClusterPager // method. -func (client *BmcKeySetsClient) NewListByResourceGroupPager(resourceGroupName string, clusterName string, options *BmcKeySetsClientListByResourceGroupOptions) *runtime.Pager[BmcKeySetsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[BmcKeySetsClientListByResourceGroupResponse]{ - More: func(page BmcKeySetsClientListByResourceGroupResponse) bool { +func (client *BmcKeySetsClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *BmcKeySetsClientListByClusterOptions) *runtime.Pager[BmcKeySetsClientListByClusterResponse] { + return runtime.NewPager(runtime.PagingHandler[BmcKeySetsClientListByClusterResponse]{ + More: func(page BmcKeySetsClientListByClusterResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *BmcKeySetsClientListByResourceGroupResponse) (BmcKeySetsClientListByResourceGroupResponse, error) { + Fetcher: func(ctx context.Context, page *BmcKeySetsClientListByClusterResponse) (BmcKeySetsClientListByClusterResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, clusterName, options) + req, err = client.listByClusterCreateRequest(ctx, resourceGroupName, clusterName, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return BmcKeySetsClientListByResourceGroupResponse{}, err + return BmcKeySetsClientListByClusterResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return BmcKeySetsClientListByResourceGroupResponse{}, err + return BmcKeySetsClientListByClusterResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BmcKeySetsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + return BmcKeySetsClientListByClusterResponse{}, runtime.NewResponseError(resp) } - return client.listByResourceGroupHandleResponse(resp) + return client.listByClusterHandleResponse(resp) }, }) } -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *BmcKeySetsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *BmcKeySetsClientListByResourceGroupOptions) (*policy.Request, error) { +// listByClusterCreateRequest creates the ListByCluster request. +func (client *BmcKeySetsClient) listByClusterCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *BmcKeySetsClientListByClusterOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets" - 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") @@ -307,17 +294,17 @@ func (client *BmcKeySetsClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *BmcKeySetsClient) listByResourceGroupHandleResponse(resp *http.Response) (BmcKeySetsClientListByResourceGroupResponse, error) { - result := BmcKeySetsClientListByResourceGroupResponse{} +// listByClusterHandleResponse handles the ListByCluster response. +func (client *BmcKeySetsClient) listByClusterHandleResponse(resp *http.Response) (BmcKeySetsClientListByClusterResponse, error) { + result := BmcKeySetsClientListByClusterResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.BmcKeySetList); err != nil { - return BmcKeySetsClientListByResourceGroupResponse{}, err + return BmcKeySetsClientListByClusterResponse{}, err } return result, nil } @@ -326,7 +313,7 @@ func (client *BmcKeySetsClient) listByResourceGroupHandleResponse(resp *http.Res // associated with it. Properties and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - bmcKeySetName - The name of the baseboard management controller key set. @@ -339,7 +326,7 @@ func (client *BmcKeySetsClient) BeginUpdate(ctx context.Context, resourceGroupNa return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BmcKeySetsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { return runtime.NewPollerFromResumeToken[BmcKeySetsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -350,7 +337,7 @@ func (client *BmcKeySetsClient) BeginUpdate(ctx context.Context, resourceGroupNa // with it. Properties and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *BmcKeySetsClient) update(ctx context.Context, resourceGroupName string, clusterName string, bmcKeySetName string, bmcKeySetUpdateParameters BmcKeySetPatchParameters, options *BmcKeySetsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, bmcKeySetName, bmcKeySetUpdateParameters, options) if err != nil { @@ -369,9 +356,6 @@ func (client *BmcKeySetsClient) update(ctx context.Context, resourceGroupName st // updateCreateRequest creates the Update request. func (client *BmcKeySetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, bmcKeySetName string, bmcKeySetUpdateParameters BmcKeySetPatchParameters, options *BmcKeySetsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" - 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") @@ -390,7 +374,7 @@ func (client *BmcKeySetsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bmcKeySetUpdateParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/bmckeysets_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/bmckeysets_client_example_test.go index fccf9b2d03ca..bb2650dcfafc 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/bmckeysets_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/bmckeysets_client_example_test.go @@ -20,8 +20,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_ListByResourceGroup.json -func ExampleBmcKeySetsClient_NewListByResourceGroupPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BmcKeySets_ListByCluster.json +func ExampleBmcKeySetsClient_NewListByClusterPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -31,7 +31,7 @@ func ExampleBmcKeySetsClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewBmcKeySetsClient().NewListByResourceGroupPager("resourceGroupName", "clusterName", nil) + pager := clientFactory.NewBmcKeySetsClient().NewListByClusterPager("resourceGroupName", "clusterName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -47,7 +47,7 @@ func ExampleBmcKeySetsClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("bmcKeySetName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters/bmcKeySets"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bmcKeySets/bmcKeySetName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bmcKeySets/bmcKeySetName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -62,7 +62,7 @@ func ExampleBmcKeySetsClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BmcKeySetProperties{ @@ -105,7 +105,7 @@ func ExampleBmcKeySetsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BmcKeySets_Get.json func ExampleBmcKeySetsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -126,7 +126,7 @@ func ExampleBmcKeySetsClient_Get() { // res.BmcKeySet = armnetworkcloud.BmcKeySet{ // Name: to.Ptr("bmcKeySetName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters/bmcKeySets"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bmcKeySets/bmcKeySetName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bmcKeySets/bmcKeySetName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -141,7 +141,7 @@ func ExampleBmcKeySetsClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BmcKeySetProperties{ @@ -182,7 +182,7 @@ func ExampleBmcKeySetsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BmcKeySets_Create.json func ExampleBmcKeySetsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -200,7 +200,7 @@ func ExampleBmcKeySetsClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.BmcKeySetProperties{ @@ -237,7 +237,7 @@ func ExampleBmcKeySetsClient_BeginCreateOrUpdate() { // res.BmcKeySet = armnetworkcloud.BmcKeySet{ // Name: to.Ptr("bmcKeySetName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters/bmcKeySets"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bmcKeySets/bmcKeySetName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bmcKeySets/bmcKeySetName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -252,7 +252,7 @@ func ExampleBmcKeySetsClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BmcKeySetProperties{ @@ -293,7 +293,7 @@ func ExampleBmcKeySetsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BmcKeySets_Delete.json func ExampleBmcKeySetsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -314,7 +314,7 @@ func ExampleBmcKeySetsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/BmcKeySets_Patch.json func ExampleBmcKeySetsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -362,7 +362,7 @@ func ExampleBmcKeySetsClient_BeginUpdate() { // res.BmcKeySet = armnetworkcloud.BmcKeySet{ // Name: to.Ptr("bmcKeySetName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters/bmcKeySets"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bmcKeySets/bmcKeySetName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/bmcKeySets/bmcKeySetName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -377,7 +377,7 @@ func ExampleBmcKeySetsClient_BeginUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.BmcKeySetProperties{ diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/client_factory.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/client_factory.go index 14c1b84e9abd..65689f60e2c8 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/client_factory.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/client_factory.go @@ -24,7 +24,7 @@ type ClientFactory struct { // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - 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) { @@ -63,13 +63,8 @@ func (c *ClientFactory) NewClustersClient() *ClustersClient { return subClient } -func (c *ClientFactory) NewDefaultCniNetworksClient() *DefaultCniNetworksClient { - subClient, _ := NewDefaultCniNetworksClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewHybridAksClustersClient() *HybridAksClustersClient { - subClient, _ := NewHybridAksClustersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewKubernetesClustersClient() *KubernetesClustersClient { + subClient, _ := NewKubernetesClustersClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -128,6 +123,11 @@ func (c *ClientFactory) NewMetricsConfigurationsClient() *MetricsConfigurationsC return subClient } +func (c *ClientFactory) NewAgentPoolsClient() *AgentPoolsClient { + subClient, _ := NewAgentPoolsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewConsolesClient() *ConsolesClient { subClient, _ := NewConsolesClient(c.subscriptionID, c.credential, c.options) return subClient diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/cloudservicesnetworks_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/cloudservicesnetworks_client.go index 2ce9e31f543d..7cc6466d40b2 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/cloudservicesnetworks_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/cloudservicesnetworks_client.go @@ -29,7 +29,7 @@ type CloudServicesNetworksClient struct { } // NewCloudServicesNetworksClient creates a new instance of CloudServicesNetworksClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewCloudServicesNetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServicesNetworksClient, error) { @@ -47,7 +47,7 @@ func NewCloudServicesNetworksClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Create a new cloud services network or update the properties of the existing cloud services network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudServicesNetworkName - The name of the cloud services network. // - cloudServicesNetworkParameters - The request body. @@ -70,7 +70,7 @@ func (client *CloudServicesNetworksClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Create a new cloud services network or update the properties of the existing cloud services network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *CloudServicesNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudServicesNetworkName string, cloudServicesNetworkParameters CloudServicesNetwork, options *CloudServicesNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkParameters, options) if err != nil { @@ -89,9 +89,6 @@ func (client *CloudServicesNetworksClient) createOrUpdate(ctx context.Context, r // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *CloudServicesNetworksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudServicesNetworkName string, cloudServicesNetworkParameters CloudServicesNetwork, options *CloudServicesNetworksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" - 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") @@ -106,7 +103,7 @@ func (client *CloudServicesNetworksClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, cloudServicesNetworkParameters) @@ -115,7 +112,7 @@ func (client *CloudServicesNetworksClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Delete the provided cloud services network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudServicesNetworkName - The name of the cloud services network. // - options - CloudServicesNetworksClientBeginDeleteOptions contains the optional parameters for the CloudServicesNetworksClient.BeginDelete @@ -137,7 +134,7 @@ func (client *CloudServicesNetworksClient) BeginDelete(ctx context.Context, reso // Delete - Delete the provided cloud services network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *CloudServicesNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudServicesNetworkName string, options *CloudServicesNetworksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, cloudServicesNetworkName, options) if err != nil { @@ -156,9 +153,6 @@ func (client *CloudServicesNetworksClient) deleteOperation(ctx context.Context, // deleteCreateRequest creates the Delete request. func (client *CloudServicesNetworksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cloudServicesNetworkName string, options *CloudServicesNetworksClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" - 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") @@ -173,7 +167,7 @@ func (client *CloudServicesNetworksClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +176,7 @@ func (client *CloudServicesNetworksClient) deleteCreateRequest(ctx context.Conte // Get - Get properties of the provided cloud services network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudServicesNetworkName - The name of the cloud services network. // - options - CloudServicesNetworksClientGetOptions contains the optional parameters for the CloudServicesNetworksClient.Get @@ -205,9 +199,6 @@ func (client *CloudServicesNetworksClient) Get(ctx context.Context, resourceGrou // getCreateRequest creates the Get request. func (client *CloudServicesNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudServicesNetworkName string, options *CloudServicesNetworksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" - 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") @@ -222,7 +213,7 @@ func (client *CloudServicesNetworksClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,7 +230,7 @@ func (client *CloudServicesNetworksClient) getHandleResponse(resp *http.Response // NewListByResourceGroupPager - Get a list of cloud services networks in the provided resource group. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CloudServicesNetworksClientListByResourceGroupOptions contains the optional parameters for the CloudServicesNetworksClient.NewListByResourceGroupPager // method. @@ -274,9 +265,6 @@ func (client *CloudServicesNetworksClient) NewListByResourceGroupPager(resourceG // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *CloudServicesNetworksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CloudServicesNetworksClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks" - 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") @@ -287,7 +275,7 @@ func (client *CloudServicesNetworksClient) listByResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,7 +292,7 @@ func (client *CloudServicesNetworksClient) listByResourceGroupHandleResponse(res // NewListBySubscriptionPager - Get a list of cloud services networks in the provided subscription. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - options - CloudServicesNetworksClientListBySubscriptionOptions contains the optional parameters for the CloudServicesNetworksClient.NewListBySubscriptionPager // method. func (client *CloudServicesNetworksClient) NewListBySubscriptionPager(options *CloudServicesNetworksClientListBySubscriptionOptions) *runtime.Pager[CloudServicesNetworksClientListBySubscriptionResponse] { @@ -338,16 +326,13 @@ func (client *CloudServicesNetworksClient) NewListBySubscriptionPager(options *C // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *CloudServicesNetworksClient) listBySubscriptionCreateRequest(ctx context.Context, options *CloudServicesNetworksClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/cloudServicesNetworks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) 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", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -366,7 +351,7 @@ func (client *CloudServicesNetworksClient) listBySubscriptionHandleResponse(resp // and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudServicesNetworkName - The name of the cloud services network. // - cloudServicesNetworkUpdateParameters - The request body. @@ -379,7 +364,7 @@ func (client *CloudServicesNetworksClient) BeginUpdate(ctx context.Context, reso return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesNetworksClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { return runtime.NewPollerFromResumeToken[CloudServicesNetworksClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -390,7 +375,7 @@ func (client *CloudServicesNetworksClient) BeginUpdate(ctx context.Context, reso // tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *CloudServicesNetworksClient) update(ctx context.Context, resourceGroupName string, cloudServicesNetworkName string, cloudServicesNetworkUpdateParameters CloudServicesNetworkPatchParameters, options *CloudServicesNetworksClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkUpdateParameters, options) if err != nil { @@ -409,9 +394,6 @@ func (client *CloudServicesNetworksClient) update(ctx context.Context, resourceG // updateCreateRequest creates the Update request. func (client *CloudServicesNetworksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, cloudServicesNetworkName string, cloudServicesNetworkUpdateParameters CloudServicesNetworkPatchParameters, options *CloudServicesNetworksClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" - 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") @@ -426,7 +408,7 @@ func (client *CloudServicesNetworksClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, cloudServicesNetworkUpdateParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/cloudservicesnetworks_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/cloudservicesnetworks_client_example_test.go index ac62af14ee0a..8a0c1c2a5e2f 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/cloudservicesnetworks_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/cloudservicesnetworks_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/CloudServicesNetworks_ListBySubscription.json func ExampleCloudServicesNetworksClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleCloudServicesNetworksClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("cloudServicesNetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/cloudServicesNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -60,7 +60,7 @@ func ExampleCloudServicesNetworksClient_NewListBySubscriptionPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.CloudServicesNetworkProperties{ @@ -73,32 +73,30 @@ func ExampleCloudServicesNetworksClient_NewListBySubscriptionPager() { // Port: to.Ptr[int64](443), // }}, // }}, - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.CloudServicesNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Cloud services network is up"), - // EnableDefaultEgressEndpoints: to.Ptr(armnetworkcloud.CloudServicesNetworkEnableDefaultEgressEndpointsFalse), - // EnabledEgressEndpoints: []*armnetworkcloud.EgressEndpoint{ - // { - // Category: to.Ptr("azure-resource-management"), - // Endpoints: []*armnetworkcloud.EndpointDependency{ - // { - // DomainName: to.Ptr("https://storageaccountex.blob.core.windows.net"), - // Port: to.Ptr[int64](443), - // }}, - // }}, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.CloudServicesNetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Cloud services network is up"), + // EnableDefaultEgressEndpoints: to.Ptr(armnetworkcloud.CloudServicesNetworkEnableDefaultEgressEndpointsFalse), + // EnabledEgressEndpoints: []*armnetworkcloud.EgressEndpoint{ + // { + // Category: to.Ptr("azure-resource-management"), + // Endpoints: []*armnetworkcloud.EndpointDependency{ + // { + // DomainName: to.Ptr("https://storageaccountex.blob.core.windows.net"), + // Port: to.Ptr[int64](443), + // }}, + // }}, // InterfaceName: to.Ptr("eth0"), // ProvisioningState: to.Ptr(armnetworkcloud.CloudServicesNetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // }}, - // } + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/CloudServicesNetworks_ListByResourceGroup.json func ExampleCloudServicesNetworksClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -125,7 +123,7 @@ func ExampleCloudServicesNetworksClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("cloudServicesNetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/cloudServicesNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -140,7 +138,7 @@ func ExampleCloudServicesNetworksClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.CloudServicesNetworkProperties{ @@ -153,32 +151,30 @@ func ExampleCloudServicesNetworksClient_NewListByResourceGroupPager() { // Port: to.Ptr[int64](443), // }}, // }}, - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.CloudServicesNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Cloud services network is up"), - // EnableDefaultEgressEndpoints: to.Ptr(armnetworkcloud.CloudServicesNetworkEnableDefaultEgressEndpointsFalse), - // EnabledEgressEndpoints: []*armnetworkcloud.EgressEndpoint{ - // { - // Category: to.Ptr("azure-resource-management"), - // Endpoints: []*armnetworkcloud.EndpointDependency{ - // { - // DomainName: to.Ptr("https://storageaccountex.blob.core.windows.net"), - // Port: to.Ptr[int64](443), - // }}, - // }}, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.CloudServicesNetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Cloud services network is up"), + // EnableDefaultEgressEndpoints: to.Ptr(armnetworkcloud.CloudServicesNetworkEnableDefaultEgressEndpointsFalse), + // EnabledEgressEndpoints: []*armnetworkcloud.EgressEndpoint{ + // { + // Category: to.Ptr("azure-resource-management"), + // Endpoints: []*armnetworkcloud.EndpointDependency{ + // { + // DomainName: to.Ptr("https://storageaccountex.blob.core.windows.net"), + // Port: to.Ptr[int64](443), + // }}, + // }}, // InterfaceName: to.Ptr("eth0"), // ProvisioningState: to.Ptr(armnetworkcloud.CloudServicesNetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // }}, - // } + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/CloudServicesNetworks_Get.json func ExampleCloudServicesNetworksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -199,7 +195,7 @@ func ExampleCloudServicesNetworksClient_Get() { // res.CloudServicesNetwork = armnetworkcloud.CloudServicesNetwork{ // Name: to.Ptr("cloudServicesNetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/cloudServicesNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -214,7 +210,7 @@ func ExampleCloudServicesNetworksClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.CloudServicesNetworkProperties{ @@ -227,30 +223,28 @@ func ExampleCloudServicesNetworksClient_Get() { // Port: to.Ptr[int64](443), // }}, // }}, - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.CloudServicesNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Cloud services network is up"), - // EnableDefaultEgressEndpoints: to.Ptr(armnetworkcloud.CloudServicesNetworkEnableDefaultEgressEndpointsFalse), - // EnabledEgressEndpoints: []*armnetworkcloud.EgressEndpoint{ - // { - // Category: to.Ptr("azure-resource-management"), - // Endpoints: []*armnetworkcloud.EndpointDependency{ - // { - // DomainName: to.Ptr("https://storageaccountex.blob.core.windows.net"), - // Port: to.Ptr[int64](443), - // }}, - // }}, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.CloudServicesNetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Cloud services network is up"), + // EnableDefaultEgressEndpoints: to.Ptr(armnetworkcloud.CloudServicesNetworkEnableDefaultEgressEndpointsFalse), + // EnabledEgressEndpoints: []*armnetworkcloud.EgressEndpoint{ + // { + // Category: to.Ptr("azure-resource-management"), + // Endpoints: []*armnetworkcloud.EndpointDependency{ + // { + // DomainName: to.Ptr("https://storageaccountex.blob.core.windows.net"), + // Port: to.Ptr[int64](443), + // }}, + // }}, // InterfaceName: to.Ptr("eth0"), // ProvisioningState: to.Ptr(armnetworkcloud.CloudServicesNetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/CloudServicesNetworks_Create.json func ExampleCloudServicesNetworksClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -268,7 +262,7 @@ func ExampleCloudServicesNetworksClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.CloudServicesNetworkProperties{ @@ -297,7 +291,7 @@ func ExampleCloudServicesNetworksClient_BeginCreateOrUpdate() { // res.CloudServicesNetwork = armnetworkcloud.CloudServicesNetwork{ // Name: to.Ptr("cloudServicesNetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/cloudServicesNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -312,7 +306,7 @@ func ExampleCloudServicesNetworksClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.CloudServicesNetworkProperties{ @@ -325,30 +319,28 @@ func ExampleCloudServicesNetworksClient_BeginCreateOrUpdate() { // Port: to.Ptr[int64](443), // }}, // }}, - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.CloudServicesNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Cloud services network is up"), - // EnableDefaultEgressEndpoints: to.Ptr(armnetworkcloud.CloudServicesNetworkEnableDefaultEgressEndpointsFalse), - // EnabledEgressEndpoints: []*armnetworkcloud.EgressEndpoint{ - // { - // Category: to.Ptr("azure-resource-management"), - // Endpoints: []*armnetworkcloud.EndpointDependency{ - // { - // DomainName: to.Ptr("https://storageaccountex.blob.core.windows.net"), - // Port: to.Ptr[int64](443), - // }}, - // }}, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.CloudServicesNetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Cloud services network is up"), + // EnableDefaultEgressEndpoints: to.Ptr(armnetworkcloud.CloudServicesNetworkEnableDefaultEgressEndpointsFalse), + // EnabledEgressEndpoints: []*armnetworkcloud.EgressEndpoint{ + // { + // Category: to.Ptr("azure-resource-management"), + // Endpoints: []*armnetworkcloud.EndpointDependency{ + // { + // DomainName: to.Ptr("https://storageaccountex.blob.core.windows.net"), + // Port: to.Ptr[int64](443), + // }}, + // }}, // InterfaceName: to.Ptr("eth0"), // ProvisioningState: to.Ptr(armnetworkcloud.CloudServicesNetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/CloudServicesNetworks_Delete.json func ExampleCloudServicesNetworksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -369,7 +361,7 @@ func ExampleCloudServicesNetworksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/CloudServicesNetworks_Patch.json func ExampleCloudServicesNetworksClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -411,7 +403,7 @@ func ExampleCloudServicesNetworksClient_BeginUpdate() { // res.CloudServicesNetwork = armnetworkcloud.CloudServicesNetwork{ // Name: to.Ptr("cloudServicesNetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/cloudServicesNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -426,7 +418,7 @@ func ExampleCloudServicesNetworksClient_BeginUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.CloudServicesNetworkProperties{ @@ -439,25 +431,23 @@ func ExampleCloudServicesNetworksClient_BeginUpdate() { // Port: to.Ptr[int64](443), // }}, // }}, - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.CloudServicesNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Cloud services network is up"), - // EnableDefaultEgressEndpoints: to.Ptr(armnetworkcloud.CloudServicesNetworkEnableDefaultEgressEndpointsFalse), - // EnabledEgressEndpoints: []*armnetworkcloud.EgressEndpoint{ - // { - // Category: to.Ptr("azure-resource-management"), - // Endpoints: []*armnetworkcloud.EndpointDependency{ - // { - // DomainName: to.Ptr("https://storageaccountex.blob.core.windows.net"), - // Port: to.Ptr[int64](443), - // }}, - // }}, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.CloudServicesNetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Cloud services network is up"), + // EnableDefaultEgressEndpoints: to.Ptr(armnetworkcloud.CloudServicesNetworkEnableDefaultEgressEndpointsFalse), + // EnabledEgressEndpoints: []*armnetworkcloud.EgressEndpoint{ + // { + // Category: to.Ptr("azure-resource-management"), + // Endpoints: []*armnetworkcloud.EndpointDependency{ + // { + // DomainName: to.Ptr("https://storageaccountex.blob.core.windows.net"), + // Port: to.Ptr[int64](443), + // }}, + // }}, // InterfaceName: to.Ptr("eth0"), // ProvisioningState: to.Ptr(armnetworkcloud.CloudServicesNetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // } + // }, + // } } diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/clustermanagers_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/clustermanagers_client.go index 33251a7f6784..5a6888074c31 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/clustermanagers_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/clustermanagers_client.go @@ -29,7 +29,7 @@ type ClusterManagersClient struct { } // NewClusterManagersClient creates a new instance of ClusterManagersClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClusterManagersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClusterManagersClient, error) { @@ -47,7 +47,7 @@ func NewClusterManagersClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Create a new cluster manager or update properties of the cluster manager if it exists. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterManagerName - The name of the cluster manager. // - clusterManagerParameters - The request body. @@ -70,7 +70,7 @@ func (client *ClusterManagersClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Create a new cluster manager or update properties of the cluster manager if it exists. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *ClusterManagersClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterManagerName string, clusterManagerParameters ClusterManager, options *ClusterManagersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterManagerName, clusterManagerParameters, options) if err != nil { @@ -89,9 +89,6 @@ func (client *ClusterManagersClient) createOrUpdate(ctx context.Context, resourc // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ClusterManagersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterManagerName string, clusterManagerParameters ClusterManager, options *ClusterManagersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" - 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") @@ -106,7 +103,7 @@ func (client *ClusterManagersClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, clusterManagerParameters) @@ -115,7 +112,7 @@ func (client *ClusterManagersClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Delete the provided cluster manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterManagerName - The name of the cluster manager. // - options - ClusterManagersClientBeginDeleteOptions contains the optional parameters for the ClusterManagersClient.BeginDelete @@ -137,7 +134,7 @@ func (client *ClusterManagersClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete the provided cluster manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *ClusterManagersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterManagerName string, options *ClusterManagersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterManagerName, options) if err != nil { @@ -156,9 +153,6 @@ func (client *ClusterManagersClient) deleteOperation(ctx context.Context, resour // deleteCreateRequest creates the Delete request. func (client *ClusterManagersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterManagerName string, options *ClusterManagersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" - 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") @@ -173,7 +167,7 @@ func (client *ClusterManagersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +176,7 @@ func (client *ClusterManagersClient) deleteCreateRequest(ctx context.Context, re // Get - Get the properties of the provided cluster manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterManagerName - The name of the cluster manager. // - options - ClusterManagersClientGetOptions contains the optional parameters for the ClusterManagersClient.Get method. @@ -204,9 +198,6 @@ func (client *ClusterManagersClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *ClusterManagersClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterManagerName string, options *ClusterManagersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" - 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") @@ -221,7 +212,7 @@ func (client *ClusterManagersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +229,7 @@ func (client *ClusterManagersClient) getHandleResponse(resp *http.Response) (Clu // NewListByResourceGroupPager - Get a list of cluster managers in the provided resource group. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ClusterManagersClientListByResourceGroupOptions contains the optional parameters for the ClusterManagersClient.NewListByResourceGroupPager // method. @@ -273,9 +264,6 @@ func (client *ClusterManagersClient) NewListByResourceGroupPager(resourceGroupNa // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *ClusterManagersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClusterManagersClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers" - 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") @@ -286,7 +274,7 @@ func (client *ClusterManagersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,7 +291,7 @@ func (client *ClusterManagersClient) listByResourceGroupHandleResponse(resp *htt // NewListBySubscriptionPager - Get a list of cluster managers in the provided subscription. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - options - ClusterManagersClientListBySubscriptionOptions contains the optional parameters for the ClusterManagersClient.NewListBySubscriptionPager // method. func (client *ClusterManagersClient) NewListBySubscriptionPager(options *ClusterManagersClientListBySubscriptionOptions) *runtime.Pager[ClusterManagersClientListBySubscriptionResponse] { @@ -337,16 +325,13 @@ func (client *ClusterManagersClient) NewListBySubscriptionPager(options *Cluster // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *ClusterManagersClient) listBySubscriptionCreateRequest(ctx context.Context, options *ClusterManagersClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusterManagers" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) 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", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,7 +350,7 @@ func (client *ClusterManagersClient) listBySubscriptionHandleResponse(resp *http // and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterManagerName - The name of the cluster manager. // - clusterManagerUpdateParameters - The request body. @@ -388,9 +373,6 @@ func (client *ClusterManagersClient) Update(ctx context.Context, resourceGroupNa // updateCreateRequest creates the Update request. func (client *ClusterManagersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterManagerName string, clusterManagerUpdateParameters ClusterManagerPatchParameters, options *ClusterManagersClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" - 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") @@ -405,7 +387,7 @@ func (client *ClusterManagersClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, clusterManagerUpdateParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/clustermanagers_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/clustermanagers_client_example_test.go index 2eca84cf5b74..e0cece5dfe11 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/clustermanagers_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/clustermanagers_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/ClusterManagers_ListBySubscription.json func ExampleClusterManagersClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleClusterManagersClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("clusterManagerName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusterManagers"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -60,7 +60,7 @@ func ExampleClusterManagersClient_NewListBySubscriptionPager() { // "key2": to.Ptr("myvalue2"), // }, // Properties: &armnetworkcloud.ClusterManagerProperties{ - // AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + // AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), // ClusterVersions: []*armnetworkcloud.ClusterAvailableVersion{ // { // SupportExpiryDate: to.Ptr("2023-04-29"), @@ -72,13 +72,13 @@ func ExampleClusterManagersClient_NewListBySubscriptionPager() { // }}, // DetailedStatus: to.Ptr(armnetworkcloud.ClusterManagerDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("cluster manager is up and running"), - // FabricControllerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), + // FabricControllerID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ // Name: to.Ptr("my-managed-rg"), // Location: to.Ptr("East US"), // }, // ManagerExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // ProvisioningState: to.Ptr(armnetworkcloud.ClusterManagerProvisioningStateSucceeded), @@ -88,7 +88,7 @@ func ExampleClusterManagersClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/ClusterManagers_ListByResourceGroup.json func ExampleClusterManagersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -115,7 +115,7 @@ func ExampleClusterManagersClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("clusterManagerName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusterManagers"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -130,7 +130,7 @@ func ExampleClusterManagersClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // Properties: &armnetworkcloud.ClusterManagerProperties{ - // AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + // AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), // ClusterVersions: []*armnetworkcloud.ClusterAvailableVersion{ // { // SupportExpiryDate: to.Ptr("2023-04-29"), @@ -142,13 +142,13 @@ func ExampleClusterManagersClient_NewListByResourceGroupPager() { // }}, // DetailedStatus: to.Ptr(armnetworkcloud.ClusterManagerDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("cluster manager is up and running"), - // FabricControllerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), + // FabricControllerID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ // Name: to.Ptr("my-managed-rg"), // Location: to.Ptr("East US"), // }, // ManagerExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // ProvisioningState: to.Ptr(armnetworkcloud.ClusterManagerProvisioningStateSucceeded), @@ -158,7 +158,7 @@ func ExampleClusterManagersClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/ClusterManagers_Get.json func ExampleClusterManagersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -179,7 +179,7 @@ func ExampleClusterManagersClient_Get() { // res.ClusterManager = armnetworkcloud.ClusterManager{ // Name: to.Ptr("clusterManagerName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusterManagers"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -194,7 +194,7 @@ func ExampleClusterManagersClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // Properties: &armnetworkcloud.ClusterManagerProperties{ - // AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + // AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), // ClusterVersions: []*armnetworkcloud.ClusterAvailableVersion{ // { // SupportExpiryDate: to.Ptr("2023-04-29"), @@ -206,13 +206,13 @@ func ExampleClusterManagersClient_Get() { // }}, // DetailedStatus: to.Ptr(armnetworkcloud.ClusterManagerDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("cluster manager is up and running"), - // FabricControllerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), + // FabricControllerID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ // Name: to.Ptr("my-managed-rg"), // Location: to.Ptr("East US"), // }, // ManagerExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // ProvisioningState: to.Ptr(armnetworkcloud.ClusterManagerProvisioningStateSucceeded), @@ -220,7 +220,7 @@ func ExampleClusterManagersClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/ClusterManagers_Create.json func ExampleClusterManagersClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -238,8 +238,8 @@ func ExampleClusterManagersClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, Properties: &armnetworkcloud.ClusterManagerProperties{ - AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), - FabricControllerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), + AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + FabricControllerID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ Name: to.Ptr("my-managed-rg"), Location: to.Ptr("East US"), @@ -259,7 +259,7 @@ func ExampleClusterManagersClient_BeginCreateOrUpdate() { // res.ClusterManager = armnetworkcloud.ClusterManager{ // Name: to.Ptr("clusterManagerName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusterManagers"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -274,7 +274,7 @@ func ExampleClusterManagersClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // Properties: &armnetworkcloud.ClusterManagerProperties{ - // AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + // AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), // ClusterVersions: []*armnetworkcloud.ClusterAvailableVersion{ // { // SupportExpiryDate: to.Ptr("2023-04-29"), @@ -286,13 +286,13 @@ func ExampleClusterManagersClient_BeginCreateOrUpdate() { // }}, // DetailedStatus: to.Ptr(armnetworkcloud.ClusterManagerDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("cluster manager is up and running"), - // FabricControllerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), + // FabricControllerID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ // Name: to.Ptr("my-managed-rg"), // Location: to.Ptr("East US"), // }, // ManagerExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // ProvisioningState: to.Ptr(armnetworkcloud.ClusterManagerProvisioningStateSucceeded), @@ -300,7 +300,7 @@ func ExampleClusterManagersClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/ClusterManagers_Delete.json func ExampleClusterManagersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -321,7 +321,7 @@ func ExampleClusterManagersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/ClusterManagers_Patch.json func ExampleClusterManagersClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -347,7 +347,7 @@ func ExampleClusterManagersClient_Update() { // res.ClusterManager = armnetworkcloud.ClusterManager{ // Name: to.Ptr("clusterManagerName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusterManagers"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -362,7 +362,7 @@ func ExampleClusterManagersClient_Update() { // "key2": to.Ptr("myvalue2"), // }, // Properties: &armnetworkcloud.ClusterManagerProperties{ - // AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + // AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), // ClusterVersions: []*armnetworkcloud.ClusterAvailableVersion{ // { // SupportExpiryDate: to.Ptr("2023-04-29"), @@ -374,13 +374,13 @@ func ExampleClusterManagersClient_Update() { // }}, // DetailedStatus: to.Ptr(armnetworkcloud.ClusterManagerDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("cluster manager is up and running"), - // FabricControllerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), + // FabricControllerID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName"), // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ // Name: to.Ptr("my-managed-rg"), // Location: to.Ptr("East US"), // }, // ManagerExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // ProvisioningState: to.Ptr(armnetworkcloud.ClusterManagerProvisioningStateSucceeded), diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/clusters_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/clusters_client.go index 10d44dfb64b6..8758638c8232 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/clusters_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/clusters_client.go @@ -29,7 +29,7 @@ type ClustersClient struct { } // NewClustersClient creates a new instance of ClustersClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClustersClient, error) { @@ -47,7 +47,7 @@ func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create a new cluster or update the properties of the cluster if it exists. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - clusterParameters - The request body. @@ -70,7 +70,7 @@ func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a new cluster or update the properties of the cluster if it exists. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *ClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, clusterParameters Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, clusterParameters, options) if err != nil { @@ -89,9 +89,6 @@ func (client *ClustersClient) createOrUpdate(ctx context.Context, resourceGroupN // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, clusterParameters Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" - 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") @@ -106,7 +103,7 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, clusterParameters) @@ -115,7 +112,7 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. @@ -136,7 +133,7 @@ func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -155,9 +152,6 @@ func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroup // deleteCreateRequest creates the Delete request. func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" - 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") @@ -172,7 +166,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +175,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG // BeginDeploy - Deploy the cluster to the provided rack. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ClustersClientBeginDeployOptions contains the optional parameters for the ClustersClient.BeginDeploy method. @@ -202,7 +196,7 @@ func (client *ClustersClient) BeginDeploy(ctx context.Context, resourceGroupName // Deploy - Deploy the cluster to the provided rack. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *ClustersClient) deploy(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeployOptions) (*http.Response, error) { req, err := client.deployCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -221,9 +215,6 @@ func (client *ClustersClient) deploy(ctx context.Context, resourceGroupName stri // deployCreateRequest creates the Deploy request. func (client *ClustersClient) deployCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeployOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/deploy" - 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") @@ -238,7 +229,7 @@ func (client *ClustersClient) deployCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ClusterDeployParameters != nil { @@ -250,7 +241,7 @@ func (client *ClustersClient) deployCreateRequest(ctx context.Context, resourceG // Get - Get properties of the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. @@ -272,9 +263,6 @@ func (client *ClustersClient) Get(ctx context.Context, resourceGroupName string, // getCreateRequest creates the Get request. func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" - 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") @@ -289,7 +277,7 @@ func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,7 +294,7 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl // NewListByResourceGroupPager - Get a list of clusters in the provided resource group. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager // method. @@ -341,9 +329,6 @@ func (client *ClustersClient) NewListByResourceGroupPager(resourceGroupName stri // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClustersClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters" - 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") @@ -354,7 +339,7 @@ func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -371,7 +356,7 @@ func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Get a list of clusters in the provided subscription. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - options - ClustersClientListBySubscriptionOptions contains the optional parameters for the ClustersClient.NewListBySubscriptionPager // method. func (client *ClustersClient) NewListBySubscriptionPager(options *ClustersClientListBySubscriptionOptions) *runtime.Pager[ClustersClientListBySubscriptionResponse] { @@ -405,16 +390,13 @@ func (client *ClustersClient) NewListBySubscriptionPager(options *ClustersClient // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *ClustersClient) listBySubscriptionCreateRequest(ctx context.Context, options *ClustersClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusters" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) 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", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -433,7 +415,7 @@ func (client *ClustersClient) listBySubscriptionHandleResponse(resp *http.Respon // and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - clusterUpdateParameters - The request body. @@ -445,7 +427,7 @@ func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { return runtime.NewPollerFromResumeToken[ClustersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -456,7 +438,7 @@ func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName // updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *ClustersClient) update(ctx context.Context, resourceGroupName string, clusterName string, clusterUpdateParameters ClusterPatchParameters, options *ClustersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, clusterUpdateParameters, options) if err != nil { @@ -475,9 +457,6 @@ func (client *ClustersClient) update(ctx context.Context, resourceGroupName stri // updateCreateRequest creates the Update request. func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, clusterUpdateParameters ClusterPatchParameters, options *ClustersClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" - 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") @@ -492,7 +471,7 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, clusterUpdateParameters) @@ -501,7 +480,7 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG // BeginUpdateVersion - Update the version of the provided cluster to one of the available supported versions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - clusterUpdateVersionParameters - The request body. @@ -524,7 +503,7 @@ func (client *ClustersClient) BeginUpdateVersion(ctx context.Context, resourceGr // UpdateVersion - Update the version of the provided cluster to one of the available supported versions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *ClustersClient) updateVersion(ctx context.Context, resourceGroupName string, clusterName string, clusterUpdateVersionParameters ClusterUpdateVersionParameters, options *ClustersClientBeginUpdateVersionOptions) (*http.Response, error) { req, err := client.updateVersionCreateRequest(ctx, resourceGroupName, clusterName, clusterUpdateVersionParameters, options) if err != nil { @@ -543,9 +522,6 @@ func (client *ClustersClient) updateVersion(ctx context.Context, resourceGroupNa // updateVersionCreateRequest creates the UpdateVersion request. func (client *ClustersClient) updateVersionCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, clusterUpdateVersionParameters ClusterUpdateVersionParameters, options *ClustersClientBeginUpdateVersionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion" - 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") @@ -560,7 +536,7 @@ func (client *ClustersClient) updateVersionCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, clusterUpdateVersionParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/clusters_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/clusters_client_example_test.go index 4d4a87bcc904..f1d78ed5e10f 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/clusters_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/clusters_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Clusters_ListBySubscription.json func ExampleClustersClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleClustersClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("clusterName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -60,7 +60,7 @@ func ExampleClustersClient_NewListBySubscriptionPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ClusterProperties{ @@ -90,10 +90,10 @@ func ExampleClustersClient_NewListBySubscriptionPager() { // RackSlot: to.Ptr[int64](2), // SerialNumber: to.Ptr("BM1219YYY"), // }}, - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), // RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), // RackSerialNumber: to.Ptr("AA1234"), - // RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ // { // AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -104,7 +104,7 @@ func ExampleClustersClient_NewListBySubscriptionPager() { // StorageApplianceName: to.Ptr("vmName"), // }}, // }, - // AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + // AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), // AvailableUpgradeVersions: []*armnetworkcloud.ClusterAvailableUpgradeVersion{ // { // ControlImpact: to.Ptr(armnetworkcloud.ControlImpactFalse), @@ -126,12 +126,12 @@ func ExampleClustersClient_NewListBySubscriptionPager() { // }, // ClusterConnectionStatus: to.Ptr(armnetworkcloud.ClusterConnectionStatusConnected), // ClusterExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // ClusterLocation: to.Ptr("Foo Street, 3rd Floor, row 9"), // ClusterManagerConnectionStatus: to.Ptr(armnetworkcloud.ClusterManagerConnectionStatusConnected), - // ClusterManagerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), + // ClusterManagerID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), // ClusterServicePrincipal: &armnetworkcloud.ServicePrincipalInformation{ // ApplicationID: to.Ptr("12345678-1234-1234-1234-123456789012"), // PrincipalID: to.Ptr("00000008-0004-0004-0004-000000000012"), @@ -171,10 +171,10 @@ func ExampleClustersClient_NewListBySubscriptionPager() { // RackSlot: to.Ptr[int64](2), // SerialNumber: to.Ptr("BM1219YYY"), // }}, - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), // RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), // RackSerialNumber: to.Ptr("AA1234"), - // RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ // { // AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -187,27 +187,23 @@ func ExampleClustersClient_NewListBySubscriptionPager() { // }}, // DetailedStatus: to.Ptr(armnetworkcloud.ClusterDetailedStatusRunning), // DetailedStatusMessage: to.Ptr("Cluster is running and healthy"), - // HybridAksExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/hybridAKSExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ // Name: to.Ptr("my-managed-rg"), // Location: to.Ptr("East US"), // }, // ManualActionCount: to.Ptr[int64](0), - // NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), + // NetworkFabricID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), // ProvisioningState: to.Ptr(armnetworkcloud.ClusterProvisioningStateSucceeded), // SupportExpiryDate: to.Ptr("2023-04-29"), // WorkloadResourceIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")}, // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Clusters_ListByResourceGroup.json func ExampleClustersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -234,7 +230,7 @@ func ExampleClustersClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("clusterName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -249,7 +245,7 @@ func ExampleClustersClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ClusterProperties{ @@ -279,10 +275,10 @@ func ExampleClustersClient_NewListByResourceGroupPager() { // RackSlot: to.Ptr[int64](2), // SerialNumber: to.Ptr("BM1219YYY"), // }}, - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), // RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), // RackSerialNumber: to.Ptr("AA1234"), - // RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ // { // AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -293,7 +289,7 @@ func ExampleClustersClient_NewListByResourceGroupPager() { // StorageApplianceName: to.Ptr("vmName"), // }}, // }, - // AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + // AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), // AvailableUpgradeVersions: []*armnetworkcloud.ClusterAvailableUpgradeVersion{ // { // ControlImpact: to.Ptr(armnetworkcloud.ControlImpactFalse), @@ -315,12 +311,12 @@ func ExampleClustersClient_NewListByResourceGroupPager() { // }, // ClusterConnectionStatus: to.Ptr(armnetworkcloud.ClusterConnectionStatusConnected), // ClusterExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // ClusterLocation: to.Ptr("Foo Street, 3rd Floor, row 9"), // ClusterManagerConnectionStatus: to.Ptr(armnetworkcloud.ClusterManagerConnectionStatusConnected), - // ClusterManagerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), + // ClusterManagerID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), // ClusterServicePrincipal: &armnetworkcloud.ServicePrincipalInformation{ // ApplicationID: to.Ptr("12345678-1234-1234-1234-123456789012"), // PrincipalID: to.Ptr("00000008-0004-0004-0004-000000000012"), @@ -360,10 +356,10 @@ func ExampleClustersClient_NewListByResourceGroupPager() { // RackSlot: to.Ptr[int64](2), // SerialNumber: to.Ptr("BM1219YYY"), // }}, - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), // RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), // RackSerialNumber: to.Ptr("AA1234"), - // RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ // { // AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -376,27 +372,23 @@ func ExampleClustersClient_NewListByResourceGroupPager() { // }}, // DetailedStatus: to.Ptr(armnetworkcloud.ClusterDetailedStatusRunning), // DetailedStatusMessage: to.Ptr("Cluster is running and healthy"), - // HybridAksExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/hybridAKSExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ // Name: to.Ptr("my-managed-rg"), // Location: to.Ptr("East US"), // }, // ManualActionCount: to.Ptr[int64](0), - // NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), + // NetworkFabricID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), // ProvisioningState: to.Ptr(armnetworkcloud.ClusterProvisioningStateSucceeded), // SupportExpiryDate: to.Ptr("2023-04-29"), // WorkloadResourceIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")}, // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Clusters_Get.json func ExampleClustersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -417,7 +409,7 @@ func ExampleClustersClient_Get() { // res.Cluster = armnetworkcloud.Cluster{ // Name: to.Ptr("clusterName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -432,7 +424,7 @@ func ExampleClustersClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ClusterProperties{ @@ -462,10 +454,10 @@ func ExampleClustersClient_Get() { // RackSlot: to.Ptr[int64](2), // SerialNumber: to.Ptr("BM1219YYY"), // }}, - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), // RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), // RackSerialNumber: to.Ptr("AA1234"), - // RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ // { // AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -476,7 +468,7 @@ func ExampleClustersClient_Get() { // StorageApplianceName: to.Ptr("vmName"), // }}, // }, - // AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + // AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), // AvailableUpgradeVersions: []*armnetworkcloud.ClusterAvailableUpgradeVersion{ // { // ControlImpact: to.Ptr(armnetworkcloud.ControlImpactFalse), @@ -498,12 +490,12 @@ func ExampleClustersClient_Get() { // }, // ClusterConnectionStatus: to.Ptr(armnetworkcloud.ClusterConnectionStatusConnected), // ClusterExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // ClusterLocation: to.Ptr("Foo Street, 3rd Floor, row 9"), // ClusterManagerConnectionStatus: to.Ptr(armnetworkcloud.ClusterManagerConnectionStatusConnected), - // ClusterManagerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), + // ClusterManagerID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), // ClusterServicePrincipal: &armnetworkcloud.ServicePrincipalInformation{ // ApplicationID: to.Ptr("12345678-1234-1234-1234-123456789012"), // PrincipalID: to.Ptr("00000008-0004-0004-0004-000000000012"), @@ -543,10 +535,10 @@ func ExampleClustersClient_Get() { // RackSlot: to.Ptr[int64](2), // SerialNumber: to.Ptr("BM1219YYY"), // }}, - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), // RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), // RackSerialNumber: to.Ptr("AA1234"), - // RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ // { // AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -559,25 +551,21 @@ func ExampleClustersClient_Get() { // }}, // DetailedStatus: to.Ptr(armnetworkcloud.ClusterDetailedStatusRunning), // DetailedStatusMessage: to.Ptr("Cluster is running and healthy"), - // HybridAksExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/hybridAKSExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ // Name: to.Ptr("my-managed-rg"), // Location: to.Ptr("East US"), // }, // ManualActionCount: to.Ptr[int64](0), - // NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), + // NetworkFabricID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), // ProvisioningState: to.Ptr(armnetworkcloud.ClusterProvisioningStateSucceeded), // SupportExpiryDate: to.Ptr("2023-04-29"), // WorkloadResourceIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")}, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Clusters_Create.json func ExampleClustersClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -595,7 +583,7 @@ func ExampleClustersClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.ClusterProperties{ @@ -625,10 +613,10 @@ func ExampleClustersClient_BeginCreateOrUpdate() { RackSlot: to.Ptr[int64](2), SerialNumber: to.Ptr("BM1219YYY"), }}, - NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), RackSerialNumber: to.Ptr("AA1234"), - RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ { AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -640,7 +628,7 @@ func ExampleClustersClient_BeginCreateOrUpdate() { StorageApplianceName: to.Ptr("vmName"), }}, }, - AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), ClusterLocation: to.Ptr("Foo Street, 3rd Floor, row 9"), ClusterServicePrincipal: &armnetworkcloud.ServicePrincipalInformation{ ApplicationID: to.Ptr("12345678-1234-1234-1234-123456789012"), @@ -682,10 +670,10 @@ func ExampleClustersClient_BeginCreateOrUpdate() { RackSlot: to.Ptr[int64](2), SerialNumber: to.Ptr("BM1219YYY"), }}, - NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), RackSerialNumber: to.Ptr("AA1234"), - RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ { AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -701,7 +689,7 @@ func ExampleClustersClient_BeginCreateOrUpdate() { Name: to.Ptr("my-managed-rg"), Location: to.Ptr("East US"), }, - NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), + NetworkFabricID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), }, }, nil) if err != nil { @@ -717,7 +705,7 @@ func ExampleClustersClient_BeginCreateOrUpdate() { // res.Cluster = armnetworkcloud.Cluster{ // Name: to.Ptr("clusterName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -732,7 +720,7 @@ func ExampleClustersClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ClusterProperties{ @@ -762,10 +750,10 @@ func ExampleClustersClient_BeginCreateOrUpdate() { // RackSlot: to.Ptr[int64](2), // SerialNumber: to.Ptr("BM1219YYY"), // }}, - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), // RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), // RackSerialNumber: to.Ptr("AA1234"), - // RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ // { // AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -776,7 +764,7 @@ func ExampleClustersClient_BeginCreateOrUpdate() { // StorageApplianceName: to.Ptr("vmName"), // }}, // }, - // AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + // AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), // AvailableUpgradeVersions: []*armnetworkcloud.ClusterAvailableUpgradeVersion{ // { // ControlImpact: to.Ptr(armnetworkcloud.ControlImpactFalse), @@ -798,12 +786,12 @@ func ExampleClustersClient_BeginCreateOrUpdate() { // }, // ClusterConnectionStatus: to.Ptr(armnetworkcloud.ClusterConnectionStatusConnected), // ClusterExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // ClusterLocation: to.Ptr("Foo Street, 3rd Floor, row 9"), // ClusterManagerConnectionStatus: to.Ptr(armnetworkcloud.ClusterManagerConnectionStatusConnected), - // ClusterManagerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), + // ClusterManagerID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), // ClusterServicePrincipal: &armnetworkcloud.ServicePrincipalInformation{ // ApplicationID: to.Ptr("12345678-1234-1234-1234-123456789012"), // PrincipalID: to.Ptr("00000008-0004-0004-0004-000000000012"), @@ -843,10 +831,10 @@ func ExampleClustersClient_BeginCreateOrUpdate() { // RackSlot: to.Ptr[int64](2), // SerialNumber: to.Ptr("BM1219YYY"), // }}, - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), // RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), // RackSerialNumber: to.Ptr("AA1234"), - // RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ // { // AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -859,25 +847,21 @@ func ExampleClustersClient_BeginCreateOrUpdate() { // }}, // DetailedStatus: to.Ptr(armnetworkcloud.ClusterDetailedStatusRunning), // DetailedStatusMessage: to.Ptr("Cluster is running and healthy"), - // HybridAksExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/hybridAKSExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ // Name: to.Ptr("my-managed-rg"), // Location: to.Ptr("East US"), // }, // ManualActionCount: to.Ptr[int64](0), - // NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), + // NetworkFabricID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), // ProvisioningState: to.Ptr(armnetworkcloud.ClusterProvisioningStateSucceeded), // SupportExpiryDate: to.Ptr("2023-04-29"), // WorkloadResourceIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")}, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Clusters_Delete.json func ExampleClustersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -898,7 +882,7 @@ func ExampleClustersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_AggregatorOrSingleRackDefinition.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Clusters_Patch_AggregatorOrSingleRackDefinition.json func ExampleClustersClient_BeginUpdate_patchClusterAggregatorOrSingleRackDefinition() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -937,10 +921,10 @@ func ExampleClustersClient_BeginUpdate_patchClusterAggregatorOrSingleRackDefinit RackSlot: to.Ptr[int64](2), SerialNumber: to.Ptr("BM1219YYY"), }}, - NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), RackSerialNumber: to.Ptr("newSerialNumber"), - RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ { AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -976,7 +960,7 @@ func ExampleClustersClient_BeginUpdate_patchClusterAggregatorOrSingleRackDefinit // res.Cluster = armnetworkcloud.Cluster{ // Name: to.Ptr("clusterName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -991,7 +975,7 @@ func ExampleClustersClient_BeginUpdate_patchClusterAggregatorOrSingleRackDefinit // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ClusterProperties{ @@ -1021,10 +1005,10 @@ func ExampleClustersClient_BeginUpdate_patchClusterAggregatorOrSingleRackDefinit // RackSlot: to.Ptr[int64](2), // SerialNumber: to.Ptr("BM1219YYY"), // }}, - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), // RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), // RackSerialNumber: to.Ptr("newSerialNumber"), - // RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ // { // AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -1035,7 +1019,7 @@ func ExampleClustersClient_BeginUpdate_patchClusterAggregatorOrSingleRackDefinit // StorageApplianceName: to.Ptr("vmName"), // }}, // }, - // AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + // AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), // AvailableUpgradeVersions: []*armnetworkcloud.ClusterAvailableUpgradeVersion{ // { // ControlImpact: to.Ptr(armnetworkcloud.ControlImpactFalse), @@ -1057,12 +1041,12 @@ func ExampleClustersClient_BeginUpdate_patchClusterAggregatorOrSingleRackDefinit // }, // ClusterConnectionStatus: to.Ptr(armnetworkcloud.ClusterConnectionStatusConnected), // ClusterExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // ClusterLocation: to.Ptr("Foo Street, 3rd Floor, row 9"), // ClusterManagerConnectionStatus: to.Ptr(armnetworkcloud.ClusterManagerConnectionStatusConnected), - // ClusterManagerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), + // ClusterManagerID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), // ClusterServicePrincipal: &armnetworkcloud.ServicePrincipalInformation{ // ApplicationID: to.Ptr("12345678-1234-1234-1234-123456789012"), // PrincipalID: to.Ptr("00000008-0004-0004-0004-000000000012"), @@ -1102,10 +1086,10 @@ func ExampleClustersClient_BeginUpdate_patchClusterAggregatorOrSingleRackDefinit // RackSlot: to.Ptr[int64](2), // SerialNumber: to.Ptr("BM1219YYY"), // }}, - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), // RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), // RackSerialNumber: to.Ptr("AA1234"), - // RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ // { // AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -1118,25 +1102,21 @@ func ExampleClustersClient_BeginUpdate_patchClusterAggregatorOrSingleRackDefinit // }}, // DetailedStatus: to.Ptr(armnetworkcloud.ClusterDetailedStatusRunning), // DetailedStatusMessage: to.Ptr("Cluster is running and healthy"), - // HybridAksExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/hybridAKSExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ // Name: to.Ptr("my-managed-rg"), // Location: to.Ptr("East US"), // }, // ManualActionCount: to.Ptr[int64](0), - // NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), + // NetworkFabricID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), // ProvisioningState: to.Ptr(armnetworkcloud.ClusterProvisioningStateSucceeded), // SupportExpiryDate: to.Ptr("2023-04-29"), // WorkloadResourceIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")}, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_Location.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Clusters_Patch_Location.json func ExampleClustersClient_BeginUpdate_patchClusterLocation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1169,7 +1149,7 @@ func ExampleClustersClient_BeginUpdate_patchClusterLocation() { // res.Cluster = armnetworkcloud.Cluster{ // Name: to.Ptr("clusterName"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -1184,7 +1164,7 @@ func ExampleClustersClient_BeginUpdate_patchClusterLocation() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ClusterProperties{ @@ -1214,10 +1194,10 @@ func ExampleClustersClient_BeginUpdate_patchClusterLocation() { // RackSlot: to.Ptr[int64](2), // SerialNumber: to.Ptr("BM1219YYY"), // }}, - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), // RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), // RackSerialNumber: to.Ptr("AA1234"), - // RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ // { // AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -1228,7 +1208,7 @@ func ExampleClustersClient_BeginUpdate_patchClusterLocation() { // StorageApplianceName: to.Ptr("vmName"), // }}, // }, - // AnalyticsWorkspaceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), + // AnalyticsWorkspaceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName"), // AvailableUpgradeVersions: []*armnetworkcloud.ClusterAvailableUpgradeVersion{ // { // ControlImpact: to.Ptr(armnetworkcloud.ControlImpactFalse), @@ -1250,12 +1230,12 @@ func ExampleClustersClient_BeginUpdate_patchClusterLocation() { // }, // ClusterConnectionStatus: to.Ptr(armnetworkcloud.ClusterConnectionStatusConnected), // ClusterExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // ClusterLocation: to.Ptr("Foo Street, 3rd Floor, row 9"), // ClusterManagerConnectionStatus: to.Ptr(armnetworkcloud.ClusterManagerConnectionStatusConnected), - // ClusterManagerID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), + // ClusterManagerID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusterManagers/clusterManagerName"), // ClusterServicePrincipal: &armnetworkcloud.ServicePrincipalInformation{ // ApplicationID: to.Ptr("12345678-1234-1234-1234-123456789012"), // PrincipalID: to.Ptr("00000008-0004-0004-0004-000000000012"), @@ -1295,10 +1275,10 @@ func ExampleClustersClient_BeginUpdate_patchClusterLocation() { // RackSlot: to.Ptr[int64](2), // SerialNumber: to.Ptr("BM1219YYY"), // }}, - // NetworkRackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), + // NetworkRackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName"), // RackLocation: to.Ptr("Foo Datacenter, Floor 3, Aisle 9, Rack 2"), // RackSerialNumber: to.Ptr("AA1234"), - // RackSKUID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // RackSKUID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // StorageApplianceConfigurationData: []*armnetworkcloud.StorageApplianceConfigurationData{ // { // AdminCredentials: &armnetworkcloud.AdministrativeCredentials{ @@ -1311,25 +1291,21 @@ func ExampleClustersClient_BeginUpdate_patchClusterLocation() { // }}, // DetailedStatus: to.Ptr(armnetworkcloud.ClusterDetailedStatusRunning), // DetailedStatusMessage: to.Ptr("Cluster is running and healthy"), - // HybridAksExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/hybridAKSExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ // Name: to.Ptr("my-managed-rg"), // Location: to.Ptr("East US"), // }, // ManualActionCount: to.Ptr[int64](0), - // NetworkFabricID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), + // NetworkFabricID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName"), // ProvisioningState: to.Ptr(armnetworkcloud.ClusterProvisioningStateSucceeded), // SupportExpiryDate: to.Ptr("2023-04-29"), // WorkloadResourceIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName")}, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Clusters_Deploy.json func ExampleClustersClient_BeginDeploy_deployCluster() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1350,7 +1326,7 @@ func ExampleClustersClient_BeginDeploy_deployCluster() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy_SkipValidation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Clusters_Deploy_SkipValidation.json func ExampleClustersClient_BeginDeploy_deployClusterSkippingValidation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1375,7 +1351,7 @@ func ExampleClustersClient_BeginDeploy_deployClusterSkippingValidation() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_UpdateVersion.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Clusters_UpdateVersion.json func ExampleClustersClient_BeginUpdateVersion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/consoles_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/consoles_client.go index d8f95c5cafa4..2b6d2063dfe1 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/consoles_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/consoles_client.go @@ -29,7 +29,7 @@ type ConsolesClient struct { } // NewConsolesClient creates a new instance of ConsolesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewConsolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConsolesClient, error) { @@ -47,7 +47,7 @@ func NewConsolesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create a new virtual machine console or update the properties of the existing virtual machine console. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - consoleName - The name of the virtual machine console. @@ -71,7 +71,7 @@ func (client *ConsolesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a new virtual machine console or update the properties of the existing virtual machine console. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *ConsolesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualMachineName string, consoleName string, consoleParameters Console, options *ConsolesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualMachineName, consoleName, consoleParameters, options) if err != nil { @@ -90,9 +90,6 @@ func (client *ConsolesClient) createOrUpdate(ctx context.Context, resourceGroupN // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ConsolesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, consoleName string, consoleParameters Console, options *ConsolesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" - 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") @@ -111,7 +108,7 @@ func (client *ConsolesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, consoleParameters) @@ -120,7 +117,7 @@ func (client *ConsolesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete the provided virtual machine console. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - consoleName - The name of the virtual machine console. @@ -142,7 +139,7 @@ func (client *ConsolesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete the provided virtual machine console. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *ConsolesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualMachineName string, consoleName string, options *ConsolesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualMachineName, consoleName, options) if err != nil { @@ -161,9 +158,6 @@ func (client *ConsolesClient) deleteOperation(ctx context.Context, resourceGroup // deleteCreateRequest creates the Delete request. func (client *ConsolesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, consoleName string, options *ConsolesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" - 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") @@ -182,7 +176,7 @@ func (client *ConsolesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +185,7 @@ func (client *ConsolesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get properties of the provided virtual machine console. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - consoleName - The name of the virtual machine console. @@ -214,9 +208,6 @@ func (client *ConsolesClient) Get(ctx context.Context, resourceGroupName string, // getCreateRequest creates the Get request. func (client *ConsolesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, consoleName string, options *ConsolesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" - 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") @@ -235,7 +226,7 @@ func (client *ConsolesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,47 +241,44 @@ func (client *ConsolesClient) getHandleResponse(resp *http.Response) (ConsolesCl return result, nil } -// NewListByResourceGroupPager - Get a list of virtual machine consoles in the provided resource group. +// NewListByVirtualMachinePager - Get a list of consoles for the provided virtual machine. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. -// - options - ConsolesClientListByResourceGroupOptions contains the optional parameters for the ConsolesClient.NewListByResourceGroupPager +// - options - ConsolesClientListByVirtualMachineOptions contains the optional parameters for the ConsolesClient.NewListByVirtualMachinePager // method. -func (client *ConsolesClient) NewListByResourceGroupPager(resourceGroupName string, virtualMachineName string, options *ConsolesClientListByResourceGroupOptions) *runtime.Pager[ConsolesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ConsolesClientListByResourceGroupResponse]{ - More: func(page ConsolesClientListByResourceGroupResponse) bool { +func (client *ConsolesClient) NewListByVirtualMachinePager(resourceGroupName string, virtualMachineName string, options *ConsolesClientListByVirtualMachineOptions) *runtime.Pager[ConsolesClientListByVirtualMachineResponse] { + return runtime.NewPager(runtime.PagingHandler[ConsolesClientListByVirtualMachineResponse]{ + More: func(page ConsolesClientListByVirtualMachineResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *ConsolesClientListByResourceGroupResponse) (ConsolesClientListByResourceGroupResponse, error) { + Fetcher: func(ctx context.Context, page *ConsolesClientListByVirtualMachineResponse) (ConsolesClientListByVirtualMachineResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, virtualMachineName, options) + req, err = client.listByVirtualMachineCreateRequest(ctx, resourceGroupName, virtualMachineName, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return ConsolesClientListByResourceGroupResponse{}, err + return ConsolesClientListByVirtualMachineResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return ConsolesClientListByResourceGroupResponse{}, err + return ConsolesClientListByVirtualMachineResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConsolesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + return ConsolesClientListByVirtualMachineResponse{}, runtime.NewResponseError(resp) } - return client.listByResourceGroupHandleResponse(resp) + return client.listByVirtualMachineHandleResponse(resp) }, }) } -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ConsolesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, options *ConsolesClientListByResourceGroupOptions) (*policy.Request, error) { +// listByVirtualMachineCreateRequest creates the ListByVirtualMachine request. +func (client *ConsolesClient) listByVirtualMachineCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, options *ConsolesClientListByVirtualMachineOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles" - 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") @@ -305,17 +293,17 @@ func (client *ConsolesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ConsolesClient) listByResourceGroupHandleResponse(resp *http.Response) (ConsolesClientListByResourceGroupResponse, error) { - result := ConsolesClientListByResourceGroupResponse{} +// listByVirtualMachineHandleResponse handles the ListByVirtualMachine response. +func (client *ConsolesClient) listByVirtualMachineHandleResponse(resp *http.Response) (ConsolesClientListByVirtualMachineResponse, error) { + result := ConsolesClientListByVirtualMachineResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ConsoleList); err != nil { - return ConsolesClientListByResourceGroupResponse{}, err + return ConsolesClientListByVirtualMachineResponse{}, err } return result, nil } @@ -324,7 +312,7 @@ func (client *ConsolesClient) listByResourceGroupHandleResponse(resp *http.Respo // machine console. Properties and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - consoleName - The name of the virtual machine console. @@ -337,7 +325,7 @@ func (client *ConsolesClient) BeginUpdate(ctx context.Context, resourceGroupName return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConsolesClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { return runtime.NewPollerFromResumeToken[ConsolesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -348,7 +336,7 @@ func (client *ConsolesClient) BeginUpdate(ctx context.Context, resourceGroupName // console. Properties and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *ConsolesClient) update(ctx context.Context, resourceGroupName string, virtualMachineName string, consoleName string, consoleUpdateParameters ConsolePatchParameters, options *ConsolesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, virtualMachineName, consoleName, consoleUpdateParameters, options) if err != nil { @@ -367,9 +355,6 @@ func (client *ConsolesClient) update(ctx context.Context, resourceGroupName stri // updateCreateRequest creates the Update request. func (client *ConsolesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, consoleName string, consoleUpdateParameters ConsolePatchParameters, options *ConsolesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" - 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") @@ -388,7 +373,7 @@ func (client *ConsolesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, consoleUpdateParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/consoles_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/consoles_client_example_test.go index cd82d00792ef..3f221a756a35 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/consoles_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/consoles_client_example_test.go @@ -20,8 +20,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_ListByResourceGroup.json -func ExampleConsolesClient_NewListByResourceGroupPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Consoles_ListByVirtualMachine.json +func ExampleConsolesClient_NewListByVirtualMachinePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -31,7 +31,7 @@ func ExampleConsolesClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewConsolesClient().NewListByResourceGroupPager("resourceGroupName", "virtualMachineName", nil) + pager := clientFactory.NewConsolesClient().NewListByVirtualMachinePager("resourceGroupName", "virtualMachineName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -47,7 +47,7 @@ func ExampleConsolesClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.NetworkCloud/virtualMachines/consoles"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName/consoles/default"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName/consoles/default"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -62,7 +62,7 @@ func ExampleConsolesClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ConsoleProperties{ @@ -70,7 +70,7 @@ func ExampleConsolesClient_NewListByResourceGroupPager() { // DetailedStatusMessage: to.Ptr("Console is ready for use"), // Enabled: to.Ptr(armnetworkcloud.ConsoleEnabledTrue), // Expiration: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-06-01T01:27:03.008Z"); return t}()), - // PrivateLinkServiceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateLinkServices/console-pls"), + // PrivateLinkServiceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateLinkServices/console-pls"), // ProvisioningState: to.Ptr(armnetworkcloud.ConsoleProvisioningStateSucceeded), // SSHPublicKey: &armnetworkcloud.SSHPublicKey{ // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), @@ -82,7 +82,7 @@ func ExampleConsolesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Consoles_Get.json func ExampleConsolesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,7 +103,7 @@ func ExampleConsolesClient_Get() { // res.Console = armnetworkcloud.Console{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.NetworkCloud/virtualMachines/consoles"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName/consoles/default"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName/consoles/default"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -118,7 +118,7 @@ func ExampleConsolesClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ConsoleProperties{ @@ -126,7 +126,7 @@ func ExampleConsolesClient_Get() { // DetailedStatusMessage: to.Ptr("Console is ready for use"), // Enabled: to.Ptr(armnetworkcloud.ConsoleEnabledTrue), // Expiration: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-06-01T01:27:03.008Z"); return t}()), - // PrivateLinkServiceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateLinkServices/console-pls"), + // PrivateLinkServiceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateLinkServices/console-pls"), // ProvisioningState: to.Ptr(armnetworkcloud.ConsoleProvisioningStateSucceeded), // SSHPublicKey: &armnetworkcloud.SSHPublicKey{ // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), @@ -136,7 +136,7 @@ func ExampleConsolesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Consoles_Create.json func ExampleConsolesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -154,7 +154,7 @@ func ExampleConsolesClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.ConsoleProperties{ @@ -178,7 +178,7 @@ func ExampleConsolesClient_BeginCreateOrUpdate() { // res.Console = armnetworkcloud.Console{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.NetworkCloud/virtualMachines/consoles"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName/consoles/default"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName/consoles/default"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -193,7 +193,7 @@ func ExampleConsolesClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ConsoleProperties{ @@ -201,7 +201,7 @@ func ExampleConsolesClient_BeginCreateOrUpdate() { // DetailedStatusMessage: to.Ptr("Console is ready for use"), // Enabled: to.Ptr(armnetworkcloud.ConsoleEnabledTrue), // Expiration: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-06-01T01:27:03.008Z"); return t}()), - // PrivateLinkServiceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateLinkServices/console-pls"), + // PrivateLinkServiceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateLinkServices/console-pls"), // ProvisioningState: to.Ptr(armnetworkcloud.ConsoleProvisioningStateSucceeded), // SSHPublicKey: &armnetworkcloud.SSHPublicKey{ // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), @@ -211,7 +211,7 @@ func ExampleConsolesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Consoles_Delete.json func ExampleConsolesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -232,7 +232,7 @@ func ExampleConsolesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Consoles_Patch.json func ExampleConsolesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -269,7 +269,7 @@ func ExampleConsolesClient_BeginUpdate() { // res.Console = armnetworkcloud.Console{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.NetworkCloud/virtualMachines/consoles"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName/consoles/default"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName/consoles/default"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -284,7 +284,7 @@ func ExampleConsolesClient_BeginUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ConsoleProperties{ @@ -292,7 +292,7 @@ func ExampleConsolesClient_BeginUpdate() { // DetailedStatusMessage: to.Ptr("Console is ready for use"), // Enabled: to.Ptr(armnetworkcloud.ConsoleEnabledTrue), // Expiration: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-06-01T01:27:03.008Z"); return t}()), - // PrivateLinkServiceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateLinkServices/console-pls"), + // PrivateLinkServiceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateLinkServices/console-pls"), // ProvisioningState: to.Ptr(armnetworkcloud.ConsoleProvisioningStateSucceeded), // SSHPublicKey: &armnetworkcloud.SSHPublicKey{ // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/constants.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/constants.go index 3829f1f60076..845f03271583 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/constants.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/constants.go @@ -11,7 +11,7 @@ package armnetworkcloud const ( moduleName = "armnetworkcloud" - moduleVersion = "v0.1.0" + moduleVersion = "v0.2.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -28,6 +28,103 @@ func PossibleActionTypeValues() []ActionType { } } +// AdvertiseToFabric - The indicator of if this advertisement is also made to the network fabric associated with the Network +// Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False. +type AdvertiseToFabric string + +const ( + AdvertiseToFabricFalse AdvertiseToFabric = "False" + AdvertiseToFabricTrue AdvertiseToFabric = "True" +) + +// PossibleAdvertiseToFabricValues returns the possible values for the AdvertiseToFabric const type. +func PossibleAdvertiseToFabricValues() []AdvertiseToFabric { + return []AdvertiseToFabric{ + AdvertiseToFabricFalse, + AdvertiseToFabricTrue, + } +} + +// AgentPoolDetailedStatus - The current status of the agent pool. +type AgentPoolDetailedStatus string + +const ( + AgentPoolDetailedStatusAvailable AgentPoolDetailedStatus = "Available" + AgentPoolDetailedStatusError AgentPoolDetailedStatus = "Error" + AgentPoolDetailedStatusProvisioning AgentPoolDetailedStatus = "Provisioning" +) + +// PossibleAgentPoolDetailedStatusValues returns the possible values for the AgentPoolDetailedStatus const type. +func PossibleAgentPoolDetailedStatusValues() []AgentPoolDetailedStatus { + return []AgentPoolDetailedStatus{ + AgentPoolDetailedStatusAvailable, + AgentPoolDetailedStatusError, + AgentPoolDetailedStatusProvisioning, + } +} + +// AgentPoolMode - The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools +// run the features and critical services for the Kubernetes Cluster, while user pools are dedicated +// to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. +type AgentPoolMode string + +const ( + AgentPoolModeNotApplicable AgentPoolMode = "NotApplicable" + AgentPoolModeSystem AgentPoolMode = "System" + AgentPoolModeUser AgentPoolMode = "User" +) + +// PossibleAgentPoolModeValues returns the possible values for the AgentPoolMode const type. +func PossibleAgentPoolModeValues() []AgentPoolMode { + return []AgentPoolMode{ + AgentPoolModeNotApplicable, + AgentPoolModeSystem, + AgentPoolModeUser, + } +} + +// AgentPoolProvisioningState - The provisioning state of the agent pool. +type AgentPoolProvisioningState string + +const ( + AgentPoolProvisioningStateAccepted AgentPoolProvisioningState = "Accepted" + AgentPoolProvisioningStateCanceled AgentPoolProvisioningState = "Canceled" + AgentPoolProvisioningStateDeleting AgentPoolProvisioningState = "Deleting" + AgentPoolProvisioningStateFailed AgentPoolProvisioningState = "Failed" + AgentPoolProvisioningStateInProgress AgentPoolProvisioningState = "InProgress" + AgentPoolProvisioningStateSucceeded AgentPoolProvisioningState = "Succeeded" + AgentPoolProvisioningStateUpdating AgentPoolProvisioningState = "Updating" +) + +// PossibleAgentPoolProvisioningStateValues returns the possible values for the AgentPoolProvisioningState const type. +func PossibleAgentPoolProvisioningStateValues() []AgentPoolProvisioningState { + return []AgentPoolProvisioningState{ + AgentPoolProvisioningStateAccepted, + AgentPoolProvisioningStateCanceled, + AgentPoolProvisioningStateDeleting, + AgentPoolProvisioningStateFailed, + AgentPoolProvisioningStateInProgress, + AgentPoolProvisioningStateSucceeded, + AgentPoolProvisioningStateUpdating, + } +} + +// AvailabilityLifecycle - The version lifecycle indicator. +type AvailabilityLifecycle string + +const ( + AvailabilityLifecycleGenerallyAvailable AvailabilityLifecycle = "GenerallyAvailable" + AvailabilityLifecyclePreview AvailabilityLifecycle = "Preview" +) + +// PossibleAvailabilityLifecycleValues returns the possible values for the AvailabilityLifecycle const type. +func PossibleAvailabilityLifecycleValues() []AvailabilityLifecycle { + return []AvailabilityLifecycle{ + AvailabilityLifecycleGenerallyAvailable, + AvailabilityLifecyclePreview, + } +} + // BareMetalMachineCordonStatus - The cordon status of the bare metal machine. type BareMetalMachineCordonStatus string @@ -259,6 +356,38 @@ func PossibleBareMetalMachineSkipShutdownValues() []BareMetalMachineSkipShutdown } } +// BfdEnabled - The indicator to determine if automatic allocation from the pool should occur. +type BfdEnabled string + +const ( + BfdEnabledFalse BfdEnabled = "False" + BfdEnabledTrue BfdEnabled = "True" +) + +// PossibleBfdEnabledValues returns the possible values for the BfdEnabled const type. +func PossibleBfdEnabledValues() []BfdEnabled { + return []BfdEnabled{ + BfdEnabledFalse, + BfdEnabledTrue, + } +} + +// BgpMultiHop - The indicator to enable multi-hop peering support. +type BgpMultiHop string + +const ( + BgpMultiHopFalse BgpMultiHop = "False" + BgpMultiHopTrue BgpMultiHop = "True" +) + +// PossibleBgpMultiHopValues returns the possible values for the BgpMultiHop const type. +func PossibleBgpMultiHopValues() []BgpMultiHop { + return []BgpMultiHop{ + BgpMultiHopFalse, + BgpMultiHopTrue, + } +} + // BmcKeySetDetailedStatus - The more detailed status of the key set. type BmcKeySetDetailedStatus string @@ -668,46 +797,6 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// DefaultCniNetworkDetailedStatus - The more detailed status of the default CNI network. -type DefaultCniNetworkDetailedStatus string - -const ( - DefaultCniNetworkDetailedStatusAvailable DefaultCniNetworkDetailedStatus = "Available" - DefaultCniNetworkDetailedStatusError DefaultCniNetworkDetailedStatus = "Error" - DefaultCniNetworkDetailedStatusProvisioning DefaultCniNetworkDetailedStatus = "Provisioning" -) - -// PossibleDefaultCniNetworkDetailedStatusValues returns the possible values for the DefaultCniNetworkDetailedStatus const type. -func PossibleDefaultCniNetworkDetailedStatusValues() []DefaultCniNetworkDetailedStatus { - return []DefaultCniNetworkDetailedStatus{ - DefaultCniNetworkDetailedStatusAvailable, - DefaultCniNetworkDetailedStatusError, - DefaultCniNetworkDetailedStatusProvisioning, - } -} - -// DefaultCniNetworkProvisioningState - The provisioning state of the default CNI network. -type DefaultCniNetworkProvisioningState string - -const ( - DefaultCniNetworkProvisioningStateAccepted DefaultCniNetworkProvisioningState = "Accepted" - DefaultCniNetworkProvisioningStateCanceled DefaultCniNetworkProvisioningState = "Canceled" - DefaultCniNetworkProvisioningStateFailed DefaultCniNetworkProvisioningState = "Failed" - DefaultCniNetworkProvisioningStateProvisioning DefaultCniNetworkProvisioningState = "Provisioning" - DefaultCniNetworkProvisioningStateSucceeded DefaultCniNetworkProvisioningState = "Succeeded" -) - -// PossibleDefaultCniNetworkProvisioningStateValues returns the possible values for the DefaultCniNetworkProvisioningState const type. -func PossibleDefaultCniNetworkProvisioningStateValues() []DefaultCniNetworkProvisioningState { - return []DefaultCniNetworkProvisioningState{ - DefaultCniNetworkProvisioningStateAccepted, - DefaultCniNetworkProvisioningStateCanceled, - DefaultCniNetworkProvisioningStateFailed, - DefaultCniNetworkProvisioningStateProvisioning, - DefaultCniNetworkProvisioningStateSucceeded, - } -} - // DefaultGateway - The indicator of whether this is the default gateway. Only one of the attached networks (including the // CloudServicesNetwork attachment) for a single machine may be specified as True. type DefaultGateway string @@ -755,60 +844,59 @@ func PossibleDiskTypeValues() []DiskType { } } -// HybridAksClusterDetailedStatus - The more detailed status of this Hybrid AKS cluster. -type HybridAksClusterDetailedStatus string +// FabricPeeringEnabled - The indicator to specify if the load balancer peers with the network fabric. +type FabricPeeringEnabled string const ( - HybridAksClusterDetailedStatusAvailable HybridAksClusterDetailedStatus = "Available" - HybridAksClusterDetailedStatusError HybridAksClusterDetailedStatus = "Error" - HybridAksClusterDetailedStatusProvisioning HybridAksClusterDetailedStatus = "Provisioning" + FabricPeeringEnabledFalse FabricPeeringEnabled = "False" + FabricPeeringEnabledTrue FabricPeeringEnabled = "True" ) -// PossibleHybridAksClusterDetailedStatusValues returns the possible values for the HybridAksClusterDetailedStatus const type. -func PossibleHybridAksClusterDetailedStatusValues() []HybridAksClusterDetailedStatus { - return []HybridAksClusterDetailedStatus{ - HybridAksClusterDetailedStatusAvailable, - HybridAksClusterDetailedStatusError, - HybridAksClusterDetailedStatusProvisioning, +// PossibleFabricPeeringEnabledValues returns the possible values for the FabricPeeringEnabled const type. +func PossibleFabricPeeringEnabledValues() []FabricPeeringEnabled { + return []FabricPeeringEnabled{ + FabricPeeringEnabledFalse, + FabricPeeringEnabledTrue, } } -// HybridAksClusterMachinePowerState - The power state (On | Off) of the node. -type HybridAksClusterMachinePowerState string +// FeatureDetailedStatus - The status representing the state of this feature. +type FeatureDetailedStatus string const ( - HybridAksClusterMachinePowerStateOff HybridAksClusterMachinePowerState = "Off" - HybridAksClusterMachinePowerStateOn HybridAksClusterMachinePowerState = "On" + FeatureDetailedStatusFailed FeatureDetailedStatus = "Failed" + FeatureDetailedStatusRunning FeatureDetailedStatus = "Running" + FeatureDetailedStatusUnknown FeatureDetailedStatus = "Unknown" ) -// PossibleHybridAksClusterMachinePowerStateValues returns the possible values for the HybridAksClusterMachinePowerState const type. -func PossibleHybridAksClusterMachinePowerStateValues() []HybridAksClusterMachinePowerState { - return []HybridAksClusterMachinePowerState{ - HybridAksClusterMachinePowerStateOff, - HybridAksClusterMachinePowerStateOn, +// PossibleFeatureDetailedStatusValues returns the possible values for the FeatureDetailedStatus const type. +func PossibleFeatureDetailedStatusValues() []FeatureDetailedStatus { + return []FeatureDetailedStatus{ + FeatureDetailedStatusFailed, + FeatureDetailedStatusRunning, + FeatureDetailedStatusUnknown, } } -// HybridAksClusterProvisioningState - The provisioning state of the Hybrid AKS cluster resource. -type HybridAksClusterProvisioningState string +// HugepagesSize - The size of the hugepages to allocate. +type HugepagesSize string const ( - HybridAksClusterProvisioningStateCanceled HybridAksClusterProvisioningState = "Canceled" - HybridAksClusterProvisioningStateFailed HybridAksClusterProvisioningState = "Failed" - HybridAksClusterProvisioningStateSucceeded HybridAksClusterProvisioningState = "Succeeded" + HugepagesSizeOneG HugepagesSize = "1G" + HugepagesSizeTwoM HugepagesSize = "2M" ) -// PossibleHybridAksClusterProvisioningStateValues returns the possible values for the HybridAksClusterProvisioningState const type. -func PossibleHybridAksClusterProvisioningStateValues() []HybridAksClusterProvisioningState { - return []HybridAksClusterProvisioningState{ - HybridAksClusterProvisioningStateCanceled, - HybridAksClusterProvisioningStateFailed, - HybridAksClusterProvisioningStateSucceeded, +// PossibleHugepagesSizeValues returns the possible values for the HugepagesSize const type. +func PossibleHugepagesSizeValues() []HugepagesSize { + return []HugepagesSize{ + HugepagesSizeOneG, + HugepagesSizeTwoM, } } -// HybridAksIpamEnabled - The indicator of whether or not to disable IPAM allocation on the network attachment definition -// injected into the Hybrid AKS Cluster. +// HybridAksIpamEnabled - Field Deprecated. The field was previously optional, now it will have no defined behavior and will +// be ignored. The indicator of whether or not to disable IPAM allocation on the network attachment +// definition injected into the Hybrid AKS Cluster. type HybridAksIpamEnabled string const ( @@ -824,7 +912,8 @@ func PossibleHybridAksIpamEnabledValues() []HybridAksIpamEnabled { } } -// HybridAksPluginType - The network plugin type for Hybrid AKS. +// HybridAksPluginType - Field Deprecated. The field was previously optional, now it will have no defined behavior and will +// be ignored. The network plugin type for Hybrid AKS. type HybridAksPluginType string const ( @@ -842,7 +931,7 @@ func PossibleHybridAksPluginTypeValues() []HybridAksPluginType { } } -// IPAllocationType - The type of the IP address allocation. +// IPAllocationType - The type of the IP address allocation, defaulted to "DualStack". type IPAllocationType string const ( @@ -860,6 +949,136 @@ func PossibleIPAllocationTypeValues() []IPAllocationType { } } +// KubernetesClusterDetailedStatus - The current status of the Kubernetes cluster. +type KubernetesClusterDetailedStatus string + +const ( + KubernetesClusterDetailedStatusAvailable KubernetesClusterDetailedStatus = "Available" + KubernetesClusterDetailedStatusError KubernetesClusterDetailedStatus = "Error" + KubernetesClusterDetailedStatusProvisioning KubernetesClusterDetailedStatus = "Provisioning" +) + +// PossibleKubernetesClusterDetailedStatusValues returns the possible values for the KubernetesClusterDetailedStatus const type. +func PossibleKubernetesClusterDetailedStatusValues() []KubernetesClusterDetailedStatus { + return []KubernetesClusterDetailedStatus{ + KubernetesClusterDetailedStatusAvailable, + KubernetesClusterDetailedStatusError, + KubernetesClusterDetailedStatusProvisioning, + } +} + +// KubernetesClusterNodeDetailedStatus - The detailed state of this node. +type KubernetesClusterNodeDetailedStatus string + +const ( + KubernetesClusterNodeDetailedStatusAvailable KubernetesClusterNodeDetailedStatus = "Available" + KubernetesClusterNodeDetailedStatusError KubernetesClusterNodeDetailedStatus = "Error" + KubernetesClusterNodeDetailedStatusProvisioning KubernetesClusterNodeDetailedStatus = "Provisioning" + KubernetesClusterNodeDetailedStatusRunning KubernetesClusterNodeDetailedStatus = "Running" + KubernetesClusterNodeDetailedStatusScheduling KubernetesClusterNodeDetailedStatus = "Scheduling" + KubernetesClusterNodeDetailedStatusStopped KubernetesClusterNodeDetailedStatus = "Stopped" + KubernetesClusterNodeDetailedStatusTerminating KubernetesClusterNodeDetailedStatus = "Terminating" + KubernetesClusterNodeDetailedStatusUnknown KubernetesClusterNodeDetailedStatus = "Unknown" +) + +// PossibleKubernetesClusterNodeDetailedStatusValues returns the possible values for the KubernetesClusterNodeDetailedStatus const type. +func PossibleKubernetesClusterNodeDetailedStatusValues() []KubernetesClusterNodeDetailedStatus { + return []KubernetesClusterNodeDetailedStatus{ + KubernetesClusterNodeDetailedStatusAvailable, + KubernetesClusterNodeDetailedStatusError, + KubernetesClusterNodeDetailedStatusProvisioning, + KubernetesClusterNodeDetailedStatusRunning, + KubernetesClusterNodeDetailedStatusScheduling, + KubernetesClusterNodeDetailedStatusStopped, + KubernetesClusterNodeDetailedStatusTerminating, + KubernetesClusterNodeDetailedStatusUnknown, + } +} + +// KubernetesClusterProvisioningState - The provisioning state of the Kubernetes cluster resource. +type KubernetesClusterProvisioningState string + +const ( + KubernetesClusterProvisioningStateAccepted KubernetesClusterProvisioningState = "Accepted" + KubernetesClusterProvisioningStateCanceled KubernetesClusterProvisioningState = "Canceled" + KubernetesClusterProvisioningStateCreated KubernetesClusterProvisioningState = "Created" + KubernetesClusterProvisioningStateDeleting KubernetesClusterProvisioningState = "Deleting" + KubernetesClusterProvisioningStateFailed KubernetesClusterProvisioningState = "Failed" + KubernetesClusterProvisioningStateInProgress KubernetesClusterProvisioningState = "InProgress" + KubernetesClusterProvisioningStateSucceeded KubernetesClusterProvisioningState = "Succeeded" + KubernetesClusterProvisioningStateUpdating KubernetesClusterProvisioningState = "Updating" +) + +// PossibleKubernetesClusterProvisioningStateValues returns the possible values for the KubernetesClusterProvisioningState const type. +func PossibleKubernetesClusterProvisioningStateValues() []KubernetesClusterProvisioningState { + return []KubernetesClusterProvisioningState{ + KubernetesClusterProvisioningStateAccepted, + KubernetesClusterProvisioningStateCanceled, + KubernetesClusterProvisioningStateCreated, + KubernetesClusterProvisioningStateDeleting, + KubernetesClusterProvisioningStateFailed, + KubernetesClusterProvisioningStateInProgress, + KubernetesClusterProvisioningStateSucceeded, + KubernetesClusterProvisioningStateUpdating, + } +} + +// KubernetesNodePowerState - The power state of this node. +type KubernetesNodePowerState string + +const ( + KubernetesNodePowerStateOff KubernetesNodePowerState = "Off" + KubernetesNodePowerStateOn KubernetesNodePowerState = "On" + KubernetesNodePowerStateUnknown KubernetesNodePowerState = "Unknown" +) + +// PossibleKubernetesNodePowerStateValues returns the possible values for the KubernetesNodePowerState const type. +func PossibleKubernetesNodePowerStateValues() []KubernetesNodePowerState { + return []KubernetesNodePowerState{ + KubernetesNodePowerStateOff, + KubernetesNodePowerStateOn, + KubernetesNodePowerStateUnknown, + } +} + +// KubernetesNodeRole - The role of this node in the cluster. +type KubernetesNodeRole string + +const ( + KubernetesNodeRoleControlPlane KubernetesNodeRole = "ControlPlane" + KubernetesNodeRoleWorker KubernetesNodeRole = "Worker" +) + +// PossibleKubernetesNodeRoleValues returns the possible values for the KubernetesNodeRole const type. +func PossibleKubernetesNodeRoleValues() []KubernetesNodeRole { + return []KubernetesNodeRole{ + KubernetesNodeRoleControlPlane, + KubernetesNodeRoleWorker, + } +} + +// KubernetesPluginType - The indicator of how this network will be utilized by the Kubernetes cluster. +type KubernetesPluginType string + +const ( + KubernetesPluginTypeDPDK KubernetesPluginType = "DPDK" + KubernetesPluginTypeIPVLAN KubernetesPluginType = "IPVLAN" + KubernetesPluginTypeMACVLAN KubernetesPluginType = "MACVLAN" + KubernetesPluginTypeOSDevice KubernetesPluginType = "OSDevice" + KubernetesPluginTypeSRIOV KubernetesPluginType = "SRIOV" +) + +// PossibleKubernetesPluginTypeValues returns the possible values for the KubernetesPluginType const type. +func PossibleKubernetesPluginTypeValues() []KubernetesPluginType { + return []KubernetesPluginType{ + KubernetesPluginTypeDPDK, + KubernetesPluginTypeIPVLAN, + KubernetesPluginTypeMACVLAN, + KubernetesPluginTypeOSDevice, + KubernetesPluginTypeSRIOV, + } +} + // L2NetworkDetailedStatus - The more detailed status of the L2 network. type L2NetworkDetailedStatus string @@ -900,6 +1119,23 @@ func PossibleL2NetworkProvisioningStateValues() []L2NetworkProvisioningState { } } +// L3NetworkConfigurationIpamEnabled - The indication of whether this network will or will not perform IP address management +// and allocate IP addresses when attached. +type L3NetworkConfigurationIpamEnabled string + +const ( + L3NetworkConfigurationIpamEnabledFalse L3NetworkConfigurationIpamEnabled = "False" + L3NetworkConfigurationIpamEnabledTrue L3NetworkConfigurationIpamEnabled = "True" +) + +// PossibleL3NetworkConfigurationIpamEnabledValues returns the possible values for the L3NetworkConfigurationIpamEnabled const type. +func PossibleL3NetworkConfigurationIpamEnabledValues() []L3NetworkConfigurationIpamEnabled { + return []L3NetworkConfigurationIpamEnabled{ + L3NetworkConfigurationIpamEnabledFalse, + L3NetworkConfigurationIpamEnabledTrue, + } +} + // L3NetworkDetailedStatus - The more detailed status of the L3 network. type L3NetworkDetailedStatus string @@ -1148,20 +1384,6 @@ func PossibleStorageApplianceDetailedStatusValues() []StorageApplianceDetailedSt } } -// StorageApplianceHardwareValidationCategory - The category of hardware validation to perform. -type StorageApplianceHardwareValidationCategory string - -const ( - StorageApplianceHardwareValidationCategoryBasicValidation StorageApplianceHardwareValidationCategory = "BasicValidation" -) - -// PossibleStorageApplianceHardwareValidationCategoryValues returns the possible values for the StorageApplianceHardwareValidationCategory const type. -func PossibleStorageApplianceHardwareValidationCategoryValues() []StorageApplianceHardwareValidationCategory { - return []StorageApplianceHardwareValidationCategory{ - StorageApplianceHardwareValidationCategoryBasicValidation, - } -} - // StorageApplianceProvisioningState - The provisioning state of the storage appliance. type StorageApplianceProvisioningState string @@ -1279,6 +1501,11 @@ const ( VirtualMachineDetailedStatusAvailable VirtualMachineDetailedStatus = "Available" VirtualMachineDetailedStatusError VirtualMachineDetailedStatus = "Error" VirtualMachineDetailedStatusProvisioning VirtualMachineDetailedStatus = "Provisioning" + VirtualMachineDetailedStatusRunning VirtualMachineDetailedStatus = "Running" + VirtualMachineDetailedStatusScheduling VirtualMachineDetailedStatus = "Scheduling" + VirtualMachineDetailedStatusStopped VirtualMachineDetailedStatus = "Stopped" + VirtualMachineDetailedStatusTerminating VirtualMachineDetailedStatus = "Terminating" + VirtualMachineDetailedStatusUnknown VirtualMachineDetailedStatus = "Unknown" ) // PossibleVirtualMachineDetailedStatusValues returns the possible values for the VirtualMachineDetailedStatus const type. @@ -1287,6 +1514,11 @@ func PossibleVirtualMachineDetailedStatusValues() []VirtualMachineDetailedStatus VirtualMachineDetailedStatusAvailable, VirtualMachineDetailedStatusError, VirtualMachineDetailedStatusProvisioning, + VirtualMachineDetailedStatusRunning, + VirtualMachineDetailedStatusScheduling, + VirtualMachineDetailedStatusStopped, + VirtualMachineDetailedStatusTerminating, + VirtualMachineDetailedStatusUnknown, } } @@ -1380,8 +1612,9 @@ func PossibleVirtualMachinePlacementHintTypeValues() []VirtualMachinePlacementHi type VirtualMachinePowerState string const ( - VirtualMachinePowerStateOff VirtualMachinePowerState = "Off" - VirtualMachinePowerStateOn VirtualMachinePowerState = "On" + VirtualMachinePowerStateOff VirtualMachinePowerState = "Off" + VirtualMachinePowerStateOn VirtualMachinePowerState = "On" + VirtualMachinePowerStateUnknown VirtualMachinePowerState = "Unknown" ) // PossibleVirtualMachinePowerStateValues returns the possible values for the VirtualMachinePowerState const type. @@ -1389,6 +1622,7 @@ func PossibleVirtualMachinePowerStateValues() []VirtualMachinePowerState { return []VirtualMachinePowerState{ VirtualMachinePowerStateOff, VirtualMachinePowerStateOn, + VirtualMachinePowerStateUnknown, } } diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/defaultcninetworks_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/defaultcninetworks_client.go deleted file mode 100644 index ac42e1798dec..000000000000 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/defaultcninetworks_client.go +++ /dev/null @@ -1,421 +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 armnetworkcloud - -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" -) - -// DefaultCniNetworksClient contains the methods for the DefaultCniNetworks group. -// Don't use this type directly, use NewDefaultCniNetworksClient() instead. -type DefaultCniNetworksClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDefaultCniNetworksClient creates a new instance of DefaultCniNetworksClient 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 NewDefaultCniNetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DefaultCniNetworksClient, error) { - cl, err := arm.NewClient(moduleName+".DefaultCniNetworksClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DefaultCniNetworksClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create a new default CNI network or update the properties of the existing default CNI network. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - defaultCniNetworkName - The name of the default CNI network. -// - defaultCniNetworkParameters - The request body. -// - options - DefaultCniNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the DefaultCniNetworksClient.BeginCreateOrUpdate -// method. -func (client *DefaultCniNetworksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, defaultCniNetworkName string, defaultCniNetworkParameters DefaultCniNetwork, options *DefaultCniNetworksClientBeginCreateOrUpdateOptions) (*runtime.Poller[DefaultCniNetworksClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, defaultCniNetworkName, defaultCniNetworkParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DefaultCniNetworksClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[DefaultCniNetworksClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// CreateOrUpdate - Create a new default CNI network or update the properties of the existing default CNI network. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -func (client *DefaultCniNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, defaultCniNetworkName string, defaultCniNetworkParameters DefaultCniNetwork, options *DefaultCniNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, defaultCniNetworkName, defaultCniNetworkParameters, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DefaultCniNetworksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, defaultCniNetworkName string, defaultCniNetworkParameters DefaultCniNetwork, options *DefaultCniNetworksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks/{defaultCniNetworkName}" - 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 defaultCniNetworkName == "" { - return nil, errors.New("parameter defaultCniNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{defaultCniNetworkName}", url.PathEscape(defaultCniNetworkName)) - 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", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, defaultCniNetworkParameters) -} - -// BeginDelete - Delete the provided default CNI network. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - defaultCniNetworkName - The name of the default CNI network. -// - options - DefaultCniNetworksClientBeginDeleteOptions contains the optional parameters for the DefaultCniNetworksClient.BeginDelete -// method. -func (client *DefaultCniNetworksClient) BeginDelete(ctx context.Context, resourceGroupName string, defaultCniNetworkName string, options *DefaultCniNetworksClientBeginDeleteOptions) (*runtime.Poller[DefaultCniNetworksClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, defaultCniNetworkName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DefaultCniNetworksClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[DefaultCniNetworksClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Delete - Delete the provided default CNI network. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -func (client *DefaultCniNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, defaultCniNetworkName string, options *DefaultCniNetworksClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, defaultCniNetworkName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DefaultCniNetworksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, defaultCniNetworkName string, options *DefaultCniNetworksClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks/{defaultCniNetworkName}" - 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 defaultCniNetworkName == "" { - return nil, errors.New("parameter defaultCniNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{defaultCniNetworkName}", url.PathEscape(defaultCniNetworkName)) - 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", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get properties of the provided default CNI network. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - defaultCniNetworkName - The name of the default CNI network. -// - options - DefaultCniNetworksClientGetOptions contains the optional parameters for the DefaultCniNetworksClient.Get method. -func (client *DefaultCniNetworksClient) Get(ctx context.Context, resourceGroupName string, defaultCniNetworkName string, options *DefaultCniNetworksClientGetOptions) (DefaultCniNetworksClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, defaultCniNetworkName, options) - if err != nil { - return DefaultCniNetworksClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DefaultCniNetworksClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DefaultCniNetworksClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DefaultCniNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, defaultCniNetworkName string, options *DefaultCniNetworksClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks/{defaultCniNetworkName}" - 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 defaultCniNetworkName == "" { - return nil, errors.New("parameter defaultCniNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{defaultCniNetworkName}", url.PathEscape(defaultCniNetworkName)) - 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", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DefaultCniNetworksClient) getHandleResponse(resp *http.Response) (DefaultCniNetworksClientGetResponse, error) { - result := DefaultCniNetworksClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DefaultCniNetwork); err != nil { - return DefaultCniNetworksClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Get a list of default CNI networks in the provided resource group. -// -// Generated from API version 2022-12-12-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - options - DefaultCniNetworksClientListByResourceGroupOptions contains the optional parameters for the DefaultCniNetworksClient.NewListByResourceGroupPager -// method. -func (client *DefaultCniNetworksClient) NewListByResourceGroupPager(resourceGroupName string, options *DefaultCniNetworksClientListByResourceGroupOptions) *runtime.Pager[DefaultCniNetworksClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DefaultCniNetworksClientListByResourceGroupResponse]{ - More: func(page DefaultCniNetworksClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DefaultCniNetworksClientListByResourceGroupResponse) (DefaultCniNetworksClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DefaultCniNetworksClientListByResourceGroupResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DefaultCniNetworksClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DefaultCniNetworksClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DefaultCniNetworksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DefaultCniNetworksClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks" - 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)) - 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", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DefaultCniNetworksClient) listByResourceGroupHandleResponse(resp *http.Response) (DefaultCniNetworksClientListByResourceGroupResponse, error) { - result := DefaultCniNetworksClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DefaultCniNetworkList); err != nil { - return DefaultCniNetworksClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Get a list of default CNI networks in the provided subscription. -// -// Generated from API version 2022-12-12-preview -// - options - DefaultCniNetworksClientListBySubscriptionOptions contains the optional parameters for the DefaultCniNetworksClient.NewListBySubscriptionPager -// method. -func (client *DefaultCniNetworksClient) NewListBySubscriptionPager(options *DefaultCniNetworksClientListBySubscriptionOptions) *runtime.Pager[DefaultCniNetworksClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[DefaultCniNetworksClientListBySubscriptionResponse]{ - More: func(page DefaultCniNetworksClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DefaultCniNetworksClientListBySubscriptionResponse) (DefaultCniNetworksClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DefaultCniNetworksClientListBySubscriptionResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DefaultCniNetworksClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DefaultCniNetworksClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *DefaultCniNetworksClient) listBySubscriptionCreateRequest(ctx context.Context, options *DefaultCniNetworksClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/defaultCniNetworks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - 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", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *DefaultCniNetworksClient) listBySubscriptionHandleResponse(resp *http.Response) (DefaultCniNetworksClientListBySubscriptionResponse, error) { - result := DefaultCniNetworksClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DefaultCniNetworkList); err != nil { - return DefaultCniNetworksClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update tags associated with the provided default CNI network. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - defaultCniNetworkName - The name of the default CNI network. -// - defaultCniNetworkUpdateParameters - The request body. -// - options - DefaultCniNetworksClientUpdateOptions contains the optional parameters for the DefaultCniNetworksClient.Update -// method. -func (client *DefaultCniNetworksClient) Update(ctx context.Context, resourceGroupName string, defaultCniNetworkName string, defaultCniNetworkUpdateParameters DefaultCniNetworkPatchParameters, options *DefaultCniNetworksClientUpdateOptions) (DefaultCniNetworksClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, defaultCniNetworkName, defaultCniNetworkUpdateParameters, options) - if err != nil { - return DefaultCniNetworksClientUpdateResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DefaultCniNetworksClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DefaultCniNetworksClientUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.updateHandleResponse(resp) -} - -// updateCreateRequest creates the Update request. -func (client *DefaultCniNetworksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, defaultCniNetworkName string, defaultCniNetworkUpdateParameters DefaultCniNetworkPatchParameters, options *DefaultCniNetworksClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks/{defaultCniNetworkName}" - 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 defaultCniNetworkName == "" { - return nil, errors.New("parameter defaultCniNetworkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{defaultCniNetworkName}", url.PathEscape(defaultCniNetworkName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, defaultCniNetworkUpdateParameters) -} - -// updateHandleResponse handles the Update response. -func (client *DefaultCniNetworksClient) updateHandleResponse(resp *http.Response) (DefaultCniNetworksClientUpdateResponse, error) { - result := DefaultCniNetworksClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DefaultCniNetwork); err != nil { - return DefaultCniNetworksClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/defaultcninetworks_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/defaultcninetworks_client_example_test.go deleted file mode 100644 index 7aa77e6aecd4..000000000000 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/defaultcninetworks_client_example_test.go +++ /dev/null @@ -1,514 +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 armnetworkcloud_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/networkcloud/armnetworkcloud" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListBySubscription.json -func ExampleDefaultCniNetworksClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDefaultCniNetworksClient().NewListBySubscriptionPager(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.DefaultCniNetworkList = armnetworkcloud.DefaultCniNetworkList{ - // Value: []*armnetworkcloud.DefaultCniNetwork{ - // { - // Name: to.Ptr("defaultcniNetworkName"), - // Type: to.Ptr("Microsoft.NetworkCloud/defaultcniNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/defaultcniNetworks/defaultcniNetworkName"), - // SystemData: &armnetworkcloud.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), - // CreatedBy: to.Ptr("identityA"), - // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), - // LastModifiedBy: to.Ptr("identityB"), - // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), - // }, - // Location: to.Ptr("location"), - // Tags: map[string]*string{ - // "key1": to.Ptr("myvalue1"), - // "key2": to.Ptr("myvalue2"), - // }, - // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, - // Properties: &armnetworkcloud.DefaultCniNetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // CniAsNumber: to.Ptr[int64](64512), - // CniBgpConfiguration: &armnetworkcloud.CniBgpConfiguration{ - // BgpPeers: []*armnetworkcloud.BgpPeer{ - // { - // AsNumber: to.Ptr[int64](64497), - // PeerIP: to.Ptr("203.0.113.254"), - // }}, - // CommunityAdvertisements: []*armnetworkcloud.CommunityAdvertisement{ - // { - // Communities: []*string{ - // to.Ptr("64512:100")}, - // SubnetPrefix: to.Ptr("192.0.2.0/27"), - // }}, - // ServiceExternalPrefixes: []*string{ - // to.Ptr("192.0.2.0/28")}, - // ServiceLoadBalancerPrefixes: []*string{ - // to.Ptr("192.0.2.16/28")}, - // }, - // DetailedStatus: to.Ptr(armnetworkcloud.DefaultCniNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Default CNI network is up"), - // FabricBgpPeers: []*armnetworkcloud.BgpPeer{ - // { - // AsNumber: to.Ptr[int64](64496), - // PeerIP: to.Ptr("203.0.113.2"), - // }, - // { - // AsNumber: to.Ptr[int64](64496), - // PeerIP: to.Ptr("203.0.113.3"), - // }}, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // InterfaceName: to.Ptr("eth0"), - // IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), - // IPv4ConnectedPrefix: to.Ptr("203.0.113.0/24"), - // IPv6ConnectedPrefix: to.Ptr("2001:db8:0:3::/64"), - // L3IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), - // ProvisioningState: to.Ptr(armnetworkcloud.DefaultCniNetworkProvisioningStateSucceeded), - // Vlan: to.Ptr[int64](12), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListByResourceGroup.json -func ExampleDefaultCniNetworksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDefaultCniNetworksClient().NewListByResourceGroupPager("resourceGroupName", 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.DefaultCniNetworkList = armnetworkcloud.DefaultCniNetworkList{ - // Value: []*armnetworkcloud.DefaultCniNetwork{ - // { - // Name: to.Ptr("defaultcniNetworkName"), - // Type: to.Ptr("Microsoft.NetworkCloud/defaultcniNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/defaultcniNetworks/defaultcniNetworkName"), - // SystemData: &armnetworkcloud.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), - // CreatedBy: to.Ptr("identityA"), - // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), - // LastModifiedBy: to.Ptr("identityB"), - // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), - // }, - // Location: to.Ptr("location"), - // Tags: map[string]*string{ - // "key1": to.Ptr("myvalue1"), - // "key2": to.Ptr("myvalue2"), - // }, - // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, - // Properties: &armnetworkcloud.DefaultCniNetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // CniAsNumber: to.Ptr[int64](64512), - // CniBgpConfiguration: &armnetworkcloud.CniBgpConfiguration{ - // BgpPeers: []*armnetworkcloud.BgpPeer{ - // { - // AsNumber: to.Ptr[int64](64497), - // PeerIP: to.Ptr("203.0.113.254"), - // }}, - // CommunityAdvertisements: []*armnetworkcloud.CommunityAdvertisement{ - // { - // Communities: []*string{ - // to.Ptr("64512:100")}, - // SubnetPrefix: to.Ptr("192.0.2.0/27"), - // }}, - // ServiceExternalPrefixes: []*string{ - // to.Ptr("192.0.2.0/28")}, - // ServiceLoadBalancerPrefixes: []*string{ - // to.Ptr("192.0.2.16/28")}, - // }, - // DetailedStatus: to.Ptr(armnetworkcloud.DefaultCniNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Default CNI network is up"), - // FabricBgpPeers: []*armnetworkcloud.BgpPeer{ - // { - // AsNumber: to.Ptr[int64](64496), - // PeerIP: to.Ptr("203.0.113.2"), - // }, - // { - // AsNumber: to.Ptr[int64](64496), - // PeerIP: to.Ptr("203.0.113.3"), - // }}, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // InterfaceName: to.Ptr("eth0"), - // IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), - // IPv4ConnectedPrefix: to.Ptr("203.0.113.0/24"), - // IPv6ConnectedPrefix: to.Ptr("2001:db8:0:3::/64"), - // L3IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), - // ProvisioningState: to.Ptr(armnetworkcloud.DefaultCniNetworkProvisioningStateSucceeded), - // Vlan: to.Ptr[int64](12), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Get.json -func ExampleDefaultCniNetworksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDefaultCniNetworksClient().Get(ctx, "resourceGroupName", "defaultCniNetworkName", 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.DefaultCniNetwork = armnetworkcloud.DefaultCniNetwork{ - // Name: to.Ptr("defaultcniNetworkName"), - // Type: to.Ptr("Microsoft.NetworkCloud/defaultcniNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/defaultcniNetworks/defaultcniNetworkName"), - // SystemData: &armnetworkcloud.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), - // CreatedBy: to.Ptr("identityA"), - // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), - // LastModifiedBy: to.Ptr("identityB"), - // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), - // }, - // Location: to.Ptr("location"), - // Tags: map[string]*string{ - // "key1": to.Ptr("myvalue1"), - // "key2": to.Ptr("myvalue2"), - // }, - // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, - // Properties: &armnetworkcloud.DefaultCniNetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // CniAsNumber: to.Ptr[int64](64512), - // CniBgpConfiguration: &armnetworkcloud.CniBgpConfiguration{ - // BgpPeers: []*armnetworkcloud.BgpPeer{ - // { - // AsNumber: to.Ptr[int64](64497), - // PeerIP: to.Ptr("203.0.113.254"), - // }}, - // CommunityAdvertisements: []*armnetworkcloud.CommunityAdvertisement{ - // { - // Communities: []*string{ - // to.Ptr("64512:100")}, - // SubnetPrefix: to.Ptr("192.0.2.0/27"), - // }}, - // ServiceExternalPrefixes: []*string{ - // to.Ptr("192.0.2.0/28")}, - // ServiceLoadBalancerPrefixes: []*string{ - // to.Ptr("192.0.2.16/28")}, - // }, - // DetailedStatus: to.Ptr(armnetworkcloud.DefaultCniNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Default CNI network is up"), - // FabricBgpPeers: []*armnetworkcloud.BgpPeer{ - // { - // AsNumber: to.Ptr[int64](64496), - // PeerIP: to.Ptr("203.0.113.2"), - // }, - // { - // AsNumber: to.Ptr[int64](64496), - // PeerIP: to.Ptr("203.0.113.3"), - // }}, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // InterfaceName: to.Ptr("eth0"), - // IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), - // IPv4ConnectedPrefix: to.Ptr("203.0.113.0/24"), - // IPv6ConnectedPrefix: to.Ptr("2001:db8:0:3::/64"), - // L3IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), - // ProvisioningState: to.Ptr(armnetworkcloud.DefaultCniNetworkProvisioningStateSucceeded), - // Vlan: to.Ptr[int64](12), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Create.json -func ExampleDefaultCniNetworksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDefaultCniNetworksClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "defaultCniNetworkName", armnetworkcloud.DefaultCniNetwork{ - Location: to.Ptr("location"), - Tags: map[string]*string{ - "key1": to.Ptr("myvalue1"), - "key2": to.Ptr("myvalue2"), - }, - ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), - Type: to.Ptr("CustomLocation"), - }, - Properties: &armnetworkcloud.DefaultCniNetworkProperties{ - CniBgpConfiguration: &armnetworkcloud.CniBgpConfiguration{ - BgpPeers: []*armnetworkcloud.BgpPeer{ - { - AsNumber: to.Ptr[int64](64497), - PeerIP: to.Ptr("203.0.113.254"), - }}, - CommunityAdvertisements: []*armnetworkcloud.CommunityAdvertisement{ - { - Communities: []*string{ - to.Ptr("64512:100")}, - SubnetPrefix: to.Ptr("192.0.2.0/27"), - }}, - ServiceExternalPrefixes: []*string{ - to.Ptr("192.0.2.0/28")}, - ServiceLoadBalancerPrefixes: []*string{ - to.Ptr("192.0.2.16/28")}, - }, - IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), - IPv4ConnectedPrefix: to.Ptr("203.0.113.0/24"), - IPv6ConnectedPrefix: to.Ptr("2001:db8:0:3::/64"), - L3IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), - Vlan: to.Ptr[int64](12), - }, - }, 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.DefaultCniNetwork = armnetworkcloud.DefaultCniNetwork{ - // Name: to.Ptr("defaultcniNetworkName"), - // Type: to.Ptr("Microsoft.NetworkCloud/defaultcniNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/defaultcniNetworks/defaultcniNetworkName"), - // SystemData: &armnetworkcloud.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), - // CreatedBy: to.Ptr("identityA"), - // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), - // LastModifiedBy: to.Ptr("identityB"), - // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), - // }, - // Location: to.Ptr("location"), - // Tags: map[string]*string{ - // "key1": to.Ptr("myvalue1"), - // "key2": to.Ptr("myvalue2"), - // }, - // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, - // Properties: &armnetworkcloud.DefaultCniNetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // CniAsNumber: to.Ptr[int64](64512), - // CniBgpConfiguration: &armnetworkcloud.CniBgpConfiguration{ - // BgpPeers: []*armnetworkcloud.BgpPeer{ - // { - // AsNumber: to.Ptr[int64](64497), - // PeerIP: to.Ptr("203.0.113.254"), - // }}, - // CommunityAdvertisements: []*armnetworkcloud.CommunityAdvertisement{ - // { - // Communities: []*string{ - // to.Ptr("64512:100")}, - // SubnetPrefix: to.Ptr("192.0.2.0/27"), - // }}, - // ServiceExternalPrefixes: []*string{ - // to.Ptr("192.0.2.0/28")}, - // ServiceLoadBalancerPrefixes: []*string{ - // to.Ptr("192.0.2.16/28")}, - // }, - // DetailedStatus: to.Ptr(armnetworkcloud.DefaultCniNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Default CNI network is up"), - // FabricBgpPeers: []*armnetworkcloud.BgpPeer{ - // { - // AsNumber: to.Ptr[int64](64496), - // PeerIP: to.Ptr("203.0.113.2"), - // }, - // { - // AsNumber: to.Ptr[int64](64496), - // PeerIP: to.Ptr("203.0.113.3"), - // }}, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // InterfaceName: to.Ptr("eth0"), - // IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), - // IPv4ConnectedPrefix: to.Ptr("203.0.113.0/24"), - // IPv6ConnectedPrefix: to.Ptr("2001:db8:0:3::/64"), - // L3IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), - // ProvisioningState: to.Ptr(armnetworkcloud.DefaultCniNetworkProvisioningStateSucceeded), - // Vlan: to.Ptr[int64](12), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Delete.json -func ExampleDefaultCniNetworksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDefaultCniNetworksClient().BeginDelete(ctx, "resourceGroupName", "defaultCniNetworkName", 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/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Patch.json -func ExampleDefaultCniNetworksClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDefaultCniNetworksClient().Update(ctx, "resourceGroupName", "defaultCniNetworkName", armnetworkcloud.DefaultCniNetworkPatchParameters{ - Tags: map[string]*string{ - "key1": to.Ptr("myvalue1"), - "key2": to.Ptr("myvalue2"), - }, - }, 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.DefaultCniNetwork = armnetworkcloud.DefaultCniNetwork{ - // Name: to.Ptr("defaultcniNetworkName"), - // Type: to.Ptr("Microsoft.NetworkCloud/defaultcniNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/defaultcniNetworks/defaultcniNetworkName"), - // SystemData: &armnetworkcloud.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), - // CreatedBy: to.Ptr("identityA"), - // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), - // LastModifiedBy: to.Ptr("identityB"), - // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), - // }, - // Location: to.Ptr("location"), - // Tags: map[string]*string{ - // "key1": to.Ptr("myvalue1"), - // "key2": to.Ptr("myvalue2"), - // }, - // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, - // Properties: &armnetworkcloud.DefaultCniNetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // CniAsNumber: to.Ptr[int64](64512), - // CniBgpConfiguration: &armnetworkcloud.CniBgpConfiguration{ - // BgpPeers: []*armnetworkcloud.BgpPeer{ - // { - // AsNumber: to.Ptr[int64](64497), - // PeerIP: to.Ptr("203.0.113.254"), - // }}, - // CommunityAdvertisements: []*armnetworkcloud.CommunityAdvertisement{ - // { - // Communities: []*string{ - // to.Ptr("64512:100")}, - // SubnetPrefix: to.Ptr("192.0.2.0/27"), - // }}, - // ServiceExternalPrefixes: []*string{ - // to.Ptr("192.0.2.0/28")}, - // ServiceLoadBalancerPrefixes: []*string{ - // to.Ptr("192.0.2.16/28")}, - // }, - // DetailedStatus: to.Ptr(armnetworkcloud.DefaultCniNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Default CNI network is up"), - // FabricBgpPeers: []*armnetworkcloud.BgpPeer{ - // { - // AsNumber: to.Ptr[int64](64496), - // PeerIP: to.Ptr("203.0.113.2"), - // }, - // { - // AsNumber: to.Ptr[int64](64496), - // PeerIP: to.Ptr("203.0.113.3"), - // }}, - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // InterfaceName: to.Ptr("eth0"), - // IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), - // IPv4ConnectedPrefix: to.Ptr("203.0.113.0/24"), - // IPv6ConnectedPrefix: to.Ptr("2001:db8:0:3::/64"), - // L3IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), - // ProvisioningState: to.Ptr(armnetworkcloud.DefaultCniNetworkProvisioningStateSucceeded), - // Vlan: to.Ptr[int64](12), - // }, - // } -} diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/go.mod b/sdk/resourcemanager/networkcloud/armnetworkcloud/go.mod index 46afbe41b12a..a962e7e1392b 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/go.mod +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/go.mod @@ -3,19 +3,19 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnet go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/crypto v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect ) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/go.sum b/sdk/resourcemanager/networkcloud/armnetworkcloud/go.sum index 8ba445a8c4da..21718b486698 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/go.sum +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/go.sum @@ -1,13 +1,13 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 h1:8kDqDngH+DmVBiCtIjCFTGa7MBnsIOkF9IccInFEbjk= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= +github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= +github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= +github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= @@ -18,14 +18,14 @@ github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9 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.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/hybridaksclusters_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/hybridaksclusters_client.go deleted file mode 100644 index 33766cf4e0fa..000000000000 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/hybridaksclusters_client.go +++ /dev/null @@ -1,497 +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 armnetworkcloud - -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" -) - -// HybridAksClustersClient contains the methods for the HybridAksClusters group. -// Don't use this type directly, use NewHybridAksClustersClient() instead. -type HybridAksClustersClient struct { - internal *arm.Client - subscriptionID string -} - -// NewHybridAksClustersClient creates a new instance of HybridAksClustersClient 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 NewHybridAksClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HybridAksClustersClient, error) { - cl, err := arm.NewClient(moduleName+".HybridAksClustersClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &HybridAksClustersClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create new additional details related to the Hybrid AKS provisioned cluster or update the existing -// one. All customer initiated requests will be rejected as the life cycle of this resource is managed -// by the system. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - hybridAksClusterName - The name of the Hybrid AKS cluster. -// - hybridAksClusterParameters - The request body. -// - options - HybridAksClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the HybridAksClustersClient.BeginCreateOrUpdate -// method. -func (client *HybridAksClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, hybridAksClusterName string, hybridAksClusterParameters HybridAksCluster, options *HybridAksClustersClientBeginCreateOrUpdateOptions) (*runtime.Poller[HybridAksClustersClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, hybridAksClusterName, hybridAksClusterParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HybridAksClustersClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[HybridAksClustersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// CreateOrUpdate - Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. -// All customer initiated requests will be rejected as the life cycle of this resource is managed -// by the system. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -func (client *HybridAksClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, hybridAksClusterName string, hybridAksClusterParameters HybridAksCluster, options *HybridAksClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, hybridAksClusterName, hybridAksClusterParameters, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *HybridAksClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hybridAksClusterName string, hybridAksClusterParameters HybridAksCluster, options *HybridAksClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}" - 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 hybridAksClusterName == "" { - return nil, errors.New("parameter hybridAksClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hybridAksClusterName}", url.PathEscape(hybridAksClusterName)) - 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", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, hybridAksClusterParameters) -} - -// BeginDelete - Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated -// requests will be rejected as the life cycle of this resource is managed by the system. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - hybridAksClusterName - The name of the Hybrid AKS cluster. -// - options - HybridAksClustersClientBeginDeleteOptions contains the optional parameters for the HybridAksClustersClient.BeginDelete -// method. -func (client *HybridAksClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, hybridAksClusterName string, options *HybridAksClustersClientBeginDeleteOptions) (*runtime.Poller[HybridAksClustersClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, hybridAksClusterName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HybridAksClustersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[HybridAksClustersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Delete - Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated requests -// will be rejected as the life cycle of this resource is managed by the system. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -func (client *HybridAksClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, hybridAksClusterName string, options *HybridAksClustersClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, hybridAksClusterName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *HybridAksClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, hybridAksClusterName string, options *HybridAksClustersClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}" - 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 hybridAksClusterName == "" { - return nil, errors.New("parameter hybridAksClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hybridAksClusterName}", url.PathEscape(hybridAksClusterName)) - 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", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get the additional details related to the provided Hybrid AKS provisioned cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - hybridAksClusterName - The name of the Hybrid AKS cluster. -// - options - HybridAksClustersClientGetOptions contains the optional parameters for the HybridAksClustersClient.Get method. -func (client *HybridAksClustersClient) Get(ctx context.Context, resourceGroupName string, hybridAksClusterName string, options *HybridAksClustersClientGetOptions) (HybridAksClustersClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, hybridAksClusterName, options) - if err != nil { - return HybridAksClustersClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return HybridAksClustersClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return HybridAksClustersClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *HybridAksClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, hybridAksClusterName string, options *HybridAksClustersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}" - 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 hybridAksClusterName == "" { - return nil, errors.New("parameter hybridAksClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hybridAksClusterName}", url.PathEscape(hybridAksClusterName)) - 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", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *HybridAksClustersClient) getHandleResponse(resp *http.Response) (HybridAksClustersClientGetResponse, error) { - result := HybridAksClustersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HybridAksCluster); err != nil { - return HybridAksClustersClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource -// group. -// -// Generated from API version 2022-12-12-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - options - HybridAksClustersClientListByResourceGroupOptions contains the optional parameters for the HybridAksClustersClient.NewListByResourceGroupPager -// method. -func (client *HybridAksClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *HybridAksClustersClientListByResourceGroupOptions) *runtime.Pager[HybridAksClustersClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[HybridAksClustersClientListByResourceGroupResponse]{ - More: func(page HybridAksClustersClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *HybridAksClustersClientListByResourceGroupResponse) (HybridAksClustersClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return HybridAksClustersClientListByResourceGroupResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return HybridAksClustersClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return HybridAksClustersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *HybridAksClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *HybridAksClustersClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters" - 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)) - 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", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *HybridAksClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (HybridAksClustersClientListByResourceGroupResponse, error) { - result := HybridAksClustersClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HybridAksClusterList); err != nil { - return HybridAksClustersClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Get a list of additional details related to Hybrid AKS provisioned clusters in the provided -// subscription. -// -// Generated from API version 2022-12-12-preview -// - options - HybridAksClustersClientListBySubscriptionOptions contains the optional parameters for the HybridAksClustersClient.NewListBySubscriptionPager -// method. -func (client *HybridAksClustersClient) NewListBySubscriptionPager(options *HybridAksClustersClientListBySubscriptionOptions) *runtime.Pager[HybridAksClustersClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[HybridAksClustersClientListBySubscriptionResponse]{ - More: func(page HybridAksClustersClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *HybridAksClustersClientListBySubscriptionResponse) (HybridAksClustersClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return HybridAksClustersClientListBySubscriptionResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return HybridAksClustersClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return HybridAksClustersClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } - return client.listBySubscriptionHandleResponse(resp) - }, - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *HybridAksClustersClient) listBySubscriptionCreateRequest(ctx context.Context, options *HybridAksClustersClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/hybridAksClusters" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - 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", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *HybridAksClustersClient) listBySubscriptionHandleResponse(resp *http.Response) (HybridAksClustersClientListBySubscriptionResponse, error) { - result := HybridAksClustersClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HybridAksClusterList); err != nil { - return HybridAksClustersClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// BeginRestartNode - Restart a targeted node of a Hybrid AKS cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - hybridAksClusterName - The name of the Hybrid AKS cluster. -// - hybridAksClusterRestartNodeParameters - The request body. -// - options - HybridAksClustersClientBeginRestartNodeOptions contains the optional parameters for the HybridAksClustersClient.BeginRestartNode -// method. -func (client *HybridAksClustersClient) BeginRestartNode(ctx context.Context, resourceGroupName string, hybridAksClusterName string, hybridAksClusterRestartNodeParameters HybridAksClusterRestartNodeParameters, options *HybridAksClustersClientBeginRestartNodeOptions) (*runtime.Poller[HybridAksClustersClientRestartNodeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restartNode(ctx, resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HybridAksClustersClientRestartNodeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[HybridAksClustersClientRestartNodeResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// RestartNode - Restart a targeted node of a Hybrid AKS cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -func (client *HybridAksClustersClient) restartNode(ctx context.Context, resourceGroupName string, hybridAksClusterName string, hybridAksClusterRestartNodeParameters HybridAksClusterRestartNodeParameters, options *HybridAksClustersClientBeginRestartNodeOptions) (*http.Response, error) { - req, err := client.restartNodeCreateRequest(ctx, resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// restartNodeCreateRequest creates the RestartNode request. -func (client *HybridAksClustersClient) restartNodeCreateRequest(ctx context.Context, resourceGroupName string, hybridAksClusterName string, hybridAksClusterRestartNodeParameters HybridAksClusterRestartNodeParameters, options *HybridAksClustersClientBeginRestartNodeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}/restartNode" - 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 hybridAksClusterName == "" { - return nil, errors.New("parameter hybridAksClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hybridAksClusterName}", url.PathEscape(hybridAksClusterName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, hybridAksClusterRestartNodeParameters) -} - -// Update - Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - hybridAksClusterName - The name of the Hybrid AKS cluster. -// - hybridAksClusterUpdateParameters - The request body. -// - options - HybridAksClustersClientUpdateOptions contains the optional parameters for the HybridAksClustersClient.Update -// method. -func (client *HybridAksClustersClient) Update(ctx context.Context, resourceGroupName string, hybridAksClusterName string, hybridAksClusterUpdateParameters HybridAksClusterPatchParameters, options *HybridAksClustersClientUpdateOptions) (HybridAksClustersClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, hybridAksClusterName, hybridAksClusterUpdateParameters, options) - if err != nil { - return HybridAksClustersClientUpdateResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return HybridAksClustersClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return HybridAksClustersClientUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.updateHandleResponse(resp) -} - -// updateCreateRequest creates the Update request. -func (client *HybridAksClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, hybridAksClusterName string, hybridAksClusterUpdateParameters HybridAksClusterPatchParameters, options *HybridAksClustersClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}" - 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 hybridAksClusterName == "" { - return nil, errors.New("parameter hybridAksClusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hybridAksClusterName}", url.PathEscape(hybridAksClusterName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, hybridAksClusterUpdateParameters) -} - -// updateHandleResponse handles the Update response. -func (client *HybridAksClustersClient) updateHandleResponse(resp *http.Response) (HybridAksClustersClientUpdateResponse, error) { - result := HybridAksClustersClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HybridAksCluster); err != nil { - return HybridAksClustersClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/hybridaksclusters_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/hybridaksclusters_client_example_test.go deleted file mode 100644 index 5ec5a691084e..000000000000 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/hybridaksclusters_client_example_test.go +++ /dev/null @@ -1,1510 +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 armnetworkcloud_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/networkcloud/armnetworkcloud" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListBySubscription.json -func ExampleHybridAksClustersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHybridAksClustersClient().NewListBySubscriptionPager(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.HybridAksClusterList = armnetworkcloud.HybridAksClusterList{ - // Value: []*armnetworkcloud.HybridAksCluster{ - // { - // Name: to.Ptr("HybridAksClusterName"), - // Type: to.Ptr("Microsoft.NetworkCloud/hybridAksClusters"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName"), - // SystemData: &armnetworkcloud.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), - // CreatedBy: to.Ptr("identityA"), - // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), - // LastModifiedBy: to.Ptr("identityB"), - // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), - // }, - // Location: to.Ptr("location"), - // Tags: map[string]*string{ - // "key1": to.Ptr("myvalue1"), - // "key2": to.Ptr("myvalue2"), - // }, - // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, - // Properties: &armnetworkcloud.HybridAksClusterProperties{ - // AssociatedNetworkIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName")}, - // CloudServicesNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // ControlPlaneCount: to.Ptr[int64](4), - // ControlPlaneNodes: []*armnetworkcloud.NodeConfiguration{ - // { - // CPUCores: to.Ptr[int64](2), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](8), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control2"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control3"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](4), - // VMSize: to.Ptr("NC_G2_v1"), - // }}, - // DefaultCniNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/defaultCniNetworks/defaultCniNetworkName"), - // DetailedStatus: to.Ptr(armnetworkcloud.HybridAksClusterDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Hybrid AKS cluster is operational"), - // HybridAksProvisionedClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/hybridAksClusterName"), - // ProvisioningState: to.Ptr(armnetworkcloud.HybridAksClusterProvisioningStateSucceeded), - // Volumes: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, - // WorkerCount: to.Ptr[int64](8), - // WorkerNodes: []*armnetworkcloud.NodeConfiguration{ - // { - // AgentPoolID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/provisionedClustersName/agentPools/regularWorkers"), - // AgentPoolName: to.Ptr("regularWorkers"), - // CPUCores: to.Ptr[int64](2), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](8), - // NodePoolName: to.Ptr("regularWorkers"), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker2"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker3"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker4"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker5"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](6), - // VMSize: to.Ptr("NC_Gr_v1"), - // }, - // { - // AgentPoolID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/provisionedClustersName/agentPools/highMemory"), - // AgentPoolName: to.Ptr("highMemory"), - // CPUCores: to.Ptr[int64](32), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](128), - // NodePoolName: to.Ptr("highMemory"), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("highmemworker0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("highmemworker1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](2), - // VMSize: to.Ptr("NC_Gh_v1"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListByResourceGroup.json -func ExampleHybridAksClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHybridAksClustersClient().NewListByResourceGroupPager("resourceGroupName", 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.HybridAksClusterList = armnetworkcloud.HybridAksClusterList{ - // Value: []*armnetworkcloud.HybridAksCluster{ - // { - // Name: to.Ptr("HybridAksClusterName"), - // Type: to.Ptr("Microsoft.NetworkCloud/hybridAksClusters"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName"), - // SystemData: &armnetworkcloud.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), - // CreatedBy: to.Ptr("identityA"), - // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), - // LastModifiedBy: to.Ptr("identityB"), - // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), - // }, - // Location: to.Ptr("location"), - // Tags: map[string]*string{ - // "key1": to.Ptr("myvalue1"), - // "key2": to.Ptr("myvalue2"), - // }, - // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, - // Properties: &armnetworkcloud.HybridAksClusterProperties{ - // AssociatedNetworkIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName")}, - // CloudServicesNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // ControlPlaneCount: to.Ptr[int64](4), - // ControlPlaneNodes: []*armnetworkcloud.NodeConfiguration{ - // { - // CPUCores: to.Ptr[int64](2), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](8), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control2"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control3"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](4), - // VMSize: to.Ptr("NC_G2_v1"), - // }}, - // DefaultCniNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/defaultCniNetworks/defaultCniNetworkName"), - // DetailedStatus: to.Ptr(armnetworkcloud.HybridAksClusterDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Hybrid AKS cluster is operational"), - // HybridAksProvisionedClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/hybridAksClusterName"), - // ProvisioningState: to.Ptr(armnetworkcloud.HybridAksClusterProvisioningStateSucceeded), - // Volumes: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, - // WorkerCount: to.Ptr[int64](8), - // WorkerNodes: []*armnetworkcloud.NodeConfiguration{ - // { - // AgentPoolID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/provisionedClustersName/agentPools/regularWorkers"), - // AgentPoolName: to.Ptr("regularWorkers"), - // CPUCores: to.Ptr[int64](2), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](8), - // NodePoolName: to.Ptr("regularWorkers"), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker2"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker3"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker4"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker5"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](6), - // VMSize: to.Ptr("NC_Gr_v1"), - // }, - // { - // AgentPoolID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/provisionedClustersName/agentPools/highMemory"), - // AgentPoolName: to.Ptr("highMemory"), - // CPUCores: to.Ptr[int64](32), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](128), - // NodePoolName: to.Ptr("highMemory"), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("highmemworker0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("highmemworker1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](2), - // VMSize: to.Ptr("NC_Gh_v1"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Get.json -func ExampleHybridAksClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHybridAksClustersClient().Get(ctx, "resourceGroupName", "hybridAksClusterName", 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.HybridAksCluster = armnetworkcloud.HybridAksCluster{ - // Name: to.Ptr("HybridAksClusterName"), - // Type: to.Ptr("Microsoft.NetworkCloud/hybridAksClusters"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName"), - // SystemData: &armnetworkcloud.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), - // CreatedBy: to.Ptr("identityA"), - // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), - // LastModifiedBy: to.Ptr("identityB"), - // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), - // }, - // Location: to.Ptr("location"), - // Tags: map[string]*string{ - // "key1": to.Ptr("myvalue1"), - // "key2": to.Ptr("myvalue2"), - // }, - // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, - // Properties: &armnetworkcloud.HybridAksClusterProperties{ - // AssociatedNetworkIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName")}, - // CloudServicesNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // ControlPlaneCount: to.Ptr[int64](4), - // ControlPlaneNodes: []*armnetworkcloud.NodeConfiguration{ - // { - // CPUCores: to.Ptr[int64](2), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](8), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control2"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control3"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](4), - // VMSize: to.Ptr("NC_G2_v1"), - // }}, - // DefaultCniNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/defaultCniNetworks/defaultCniNetworkName"), - // DetailedStatus: to.Ptr(armnetworkcloud.HybridAksClusterDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Hybrid AKS cluster is operational"), - // HybridAksProvisionedClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/hybridAksClusterName"), - // ProvisioningState: to.Ptr(armnetworkcloud.HybridAksClusterProvisioningStateSucceeded), - // Volumes: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, - // WorkerCount: to.Ptr[int64](8), - // WorkerNodes: []*armnetworkcloud.NodeConfiguration{ - // { - // AgentPoolID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/provisionedClustersName/agentPools/regularWorkers"), - // AgentPoolName: to.Ptr("regularWorkers"), - // CPUCores: to.Ptr[int64](2), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](8), - // NodePoolName: to.Ptr("regularWorkers"), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker2"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker3"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker4"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker5"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](6), - // VMSize: to.Ptr("NC_Gr_v1"), - // }, - // { - // AgentPoolID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/provisionedClustersName/agentPools/highMemory"), - // AgentPoolName: to.Ptr("highMemory"), - // CPUCores: to.Ptr[int64](32), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](128), - // NodePoolName: to.Ptr("highMemory"), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("highmemworker0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("highmemworker1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](2), - // VMSize: to.Ptr("NC_Gh_v1"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Create.json -func ExampleHybridAksClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHybridAksClustersClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "hybridAksClusterName", armnetworkcloud.HybridAksCluster{ - Location: to.Ptr("location"), - Tags: map[string]*string{ - "key1": to.Ptr("myvalue1"), - "key2": to.Ptr("myvalue2"), - }, - ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), - Type: to.Ptr("CustomLocation"), - }, - Properties: &armnetworkcloud.HybridAksClusterProperties{ - AssociatedNetworkIDs: []*string{ - to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName")}, - ControlPlaneCount: to.Ptr[int64](4), - HybridAksProvisionedClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/hybridAksClusterName"), - WorkerCount: to.Ptr[int64](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.HybridAksCluster = armnetworkcloud.HybridAksCluster{ - // Name: to.Ptr("HybridAksClusterName"), - // Type: to.Ptr("Microsoft.NetworkCloud/hybridAksClusters"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName"), - // SystemData: &armnetworkcloud.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), - // CreatedBy: to.Ptr("identityA"), - // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), - // LastModifiedBy: to.Ptr("identityB"), - // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), - // }, - // Location: to.Ptr("location"), - // Tags: map[string]*string{ - // "key1": to.Ptr("myvalue1"), - // "key2": to.Ptr("myvalue2"), - // }, - // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, - // Properties: &armnetworkcloud.HybridAksClusterProperties{ - // AssociatedNetworkIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName")}, - // CloudServicesNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // ControlPlaneCount: to.Ptr[int64](4), - // ControlPlaneNodes: []*armnetworkcloud.NodeConfiguration{ - // { - // CPUCores: to.Ptr[int64](2), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](8), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control2"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control3"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](4), - // VMSize: to.Ptr("NC_G2_v1"), - // }}, - // DefaultCniNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/defaultCniNetworks/defaultCniNetworkName"), - // DetailedStatus: to.Ptr(armnetworkcloud.HybridAksClusterDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Hybrid AKS cluster is operational"), - // HybridAksProvisionedClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/hybridAksClusterName"), - // ProvisioningState: to.Ptr(armnetworkcloud.HybridAksClusterProvisioningStateSucceeded), - // Volumes: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, - // WorkerCount: to.Ptr[int64](8), - // WorkerNodes: []*armnetworkcloud.NodeConfiguration{ - // { - // AgentPoolID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/provisionedClustersName/agentPools/regularWorkers"), - // AgentPoolName: to.Ptr("regularWorkers"), - // CPUCores: to.Ptr[int64](2), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](8), - // NodePoolName: to.Ptr("regularWorkers"), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker2"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker3"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker4"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker5"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](6), - // VMSize: to.Ptr("NC_Gr_v1"), - // }, - // { - // AgentPoolID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/provisionedClustersName/agentPools/highMemory"), - // AgentPoolName: to.Ptr("highMemory"), - // CPUCores: to.Ptr[int64](32), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](128), - // NodePoolName: to.Ptr("highMemory"), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("highmemworker0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("highmemworker1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](2), - // VMSize: to.Ptr("NC_Gh_v1"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Delete.json -func ExampleHybridAksClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHybridAksClustersClient().BeginDelete(ctx, "resourceGroupName", "hybridAksClusterName", 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/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Patch.json -func ExampleHybridAksClustersClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHybridAksClustersClient().Update(ctx, "resourceGroupName", "hybridAksClusterName", armnetworkcloud.HybridAksClusterPatchParameters{ - Tags: map[string]*string{ - "key1": to.Ptr("myvalue1"), - "key2": to.Ptr("myvalue2"), - }, - }, 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.HybridAksCluster = armnetworkcloud.HybridAksCluster{ - // Name: to.Ptr("HybridAksClusterName"), - // Type: to.Ptr("Microsoft.NetworkCloud/hybridAksClusters"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName"), - // SystemData: &armnetworkcloud.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), - // CreatedBy: to.Ptr("identityA"), - // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), - // LastModifiedBy: to.Ptr("identityB"), - // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), - // }, - // Location: to.Ptr("location"), - // Tags: map[string]*string{ - // "key1": to.Ptr("myvalue1"), - // "key2": to.Ptr("myvalue2"), - // }, - // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), - // Type: to.Ptr("CustomLocation"), - // }, - // Properties: &armnetworkcloud.HybridAksClusterProperties{ - // AssociatedNetworkIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName")}, - // CloudServicesNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // ControlPlaneCount: to.Ptr[int64](4), - // ControlPlaneNodes: []*armnetworkcloud.NodeConfiguration{ - // { - // CPUCores: to.Ptr[int64](2), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](8), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control2"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("control3"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](4), - // VMSize: to.Ptr("NC_G2_v1"), - // }}, - // DefaultCniNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/defaultCniNetworks/defaultCniNetworkName"), - // DetailedStatus: to.Ptr(armnetworkcloud.HybridAksClusterDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Hybrid AKS cluster is operational"), - // HybridAksProvisionedClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/hybridAksClusterName"), - // ProvisioningState: to.Ptr(armnetworkcloud.HybridAksClusterProvisioningStateSucceeded), - // Volumes: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, - // WorkerCount: to.Ptr[int64](8), - // WorkerNodes: []*armnetworkcloud.NodeConfiguration{ - // { - // AgentPoolID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/provisionedClustersName/agentPools/regularWorkers"), - // AgentPoolName: to.Ptr("regularWorkers"), - // CPUCores: to.Ptr[int64](2), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](8), - // NodePoolName: to.Ptr("regularWorkers"), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker2"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker3"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker4"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("worker5"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](6), - // VMSize: to.Ptr("NC_Gr_v1"), - // }, - // { - // AgentPoolID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/provisionedClustersName/agentPools/highMemory"), - // AgentPoolName: to.Ptr("highMemory"), - // CPUCores: to.Ptr[int64](32), - // DiskSizeGB: to.Ptr[int64](128), - // MemorySizeGB: to.Ptr[int64](128), - // NodePoolName: to.Ptr("highMemory"), - // Nodes: []*armnetworkcloud.Node{ - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("highmemworker0"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }, - // { - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), - // ImageID: to.Ptr("myacr.azurecr.io/worker:latest"), - // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ - // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), - // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), - // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), - // IPv4Address: to.Ptr("198.51.100.1"), - // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0001"), - // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), - // NetworkAttachmentName: to.Ptr("netAttachName01"), - // }}, - // NodeName: to.Ptr("highmemworker1"), - // PowerState: to.Ptr(armnetworkcloud.HybridAksClusterMachinePowerStateOn), - // }}, - // VMCount: to.Ptr[int64](2), - // VMSize: to.Ptr("NC_Gh_v1"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_RestartNode.json -func ExampleHybridAksClustersClient_BeginRestartNode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHybridAksClustersClient().BeginRestartNode(ctx, "resourceGroupName", "hybridAksClusterName", armnetworkcloud.HybridAksClusterRestartNodeParameters{ - NodeName: to.Ptr("nodeName"), - }, 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/networkcloud/armnetworkcloud/kubernetesclusters_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/kubernetesclusters_client.go new file mode 100644 index 000000000000..01e906c80279 --- /dev/null +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/kubernetesclusters_client.go @@ -0,0 +1,479 @@ +//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 armnetworkcloud + +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" +) + +// KubernetesClustersClient contains the methods for the KubernetesClusters group. +// Don't use this type directly, use NewKubernetesClustersClient() instead. +type KubernetesClustersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewKubernetesClustersClient creates a new instance of KubernetesClustersClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewKubernetesClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*KubernetesClustersClient, error) { + cl, err := arm.NewClient(moduleName+".KubernetesClustersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &KubernetesClustersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a new Kubernetes cluster or update the properties of the existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - kubernetesClusterName - The name of the Kubernetes cluster. +// - kubernetesClusterParameters - The request body. +// - options - KubernetesClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the KubernetesClustersClient.BeginCreateOrUpdate +// method. +func (client *KubernetesClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, kubernetesClusterName string, kubernetesClusterParameters KubernetesCluster, options *KubernetesClustersClientBeginCreateOrUpdateOptions) (*runtime.Poller[KubernetesClustersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, kubernetesClusterName, kubernetesClusterParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[KubernetesClustersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[KubernetesClustersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a new Kubernetes cluster or update the properties of the existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *KubernetesClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, kubernetesClusterName string, kubernetesClusterParameters KubernetesCluster, options *KubernetesClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, kubernetesClusterName, kubernetesClusterParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *KubernetesClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, kubernetesClusterName string, kubernetesClusterParameters KubernetesCluster, options *KubernetesClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" + 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 kubernetesClusterName == "" { + return nil, errors.New("parameter kubernetesClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{kubernetesClusterName}", url.PathEscape(kubernetesClusterName)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, kubernetesClusterParameters) +} + +// BeginDelete - Delete the provided Kubernetes cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - kubernetesClusterName - The name of the Kubernetes cluster. +// - options - KubernetesClustersClientBeginDeleteOptions contains the optional parameters for the KubernetesClustersClient.BeginDelete +// method. +func (client *KubernetesClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, kubernetesClusterName string, options *KubernetesClustersClientBeginDeleteOptions) (*runtime.Poller[KubernetesClustersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, kubernetesClusterName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[KubernetesClustersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[KubernetesClustersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete the provided Kubernetes cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *KubernetesClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, kubernetesClusterName string, options *KubernetesClustersClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, kubernetesClusterName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *KubernetesClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, kubernetesClusterName string, options *KubernetesClustersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" + 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 kubernetesClusterName == "" { + return nil, errors.New("parameter kubernetesClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{kubernetesClusterName}", url.PathEscape(kubernetesClusterName)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get properties of the provided the Kubernetes cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - kubernetesClusterName - The name of the Kubernetes cluster. +// - options - KubernetesClustersClientGetOptions contains the optional parameters for the KubernetesClustersClient.Get method. +func (client *KubernetesClustersClient) Get(ctx context.Context, resourceGroupName string, kubernetesClusterName string, options *KubernetesClustersClientGetOptions) (KubernetesClustersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, kubernetesClusterName, options) + if err != nil { + return KubernetesClustersClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return KubernetesClustersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return KubernetesClustersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *KubernetesClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, kubernetesClusterName string, options *KubernetesClustersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" + 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 kubernetesClusterName == "" { + return nil, errors.New("parameter kubernetesClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{kubernetesClusterName}", url.PathEscape(kubernetesClusterName)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *KubernetesClustersClient) getHandleResponse(resp *http.Response) (KubernetesClustersClientGetResponse, error) { + result := KubernetesClustersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.KubernetesCluster); err != nil { + return KubernetesClustersClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Get a list of Kubernetes clusters in the provided resource group. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - KubernetesClustersClientListByResourceGroupOptions contains the optional parameters for the KubernetesClustersClient.NewListByResourceGroupPager +// method. +func (client *KubernetesClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *KubernetesClustersClientListByResourceGroupOptions) *runtime.Pager[KubernetesClustersClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[KubernetesClustersClientListByResourceGroupResponse]{ + More: func(page KubernetesClustersClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *KubernetesClustersClientListByResourceGroupResponse) (KubernetesClustersClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return KubernetesClustersClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return KubernetesClustersClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return KubernetesClustersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *KubernetesClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *KubernetesClustersClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters" + 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)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *KubernetesClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (KubernetesClustersClientListByResourceGroupResponse, error) { + result := KubernetesClustersClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.KubernetesClusterList); err != nil { + return KubernetesClustersClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Get a list of Kubernetes clusters in the provided subscription. +// +// Generated from API version 2023-05-01-preview +// - options - KubernetesClustersClientListBySubscriptionOptions contains the optional parameters for the KubernetesClustersClient.NewListBySubscriptionPager +// method. +func (client *KubernetesClustersClient) NewListBySubscriptionPager(options *KubernetesClustersClientListBySubscriptionOptions) *runtime.Pager[KubernetesClustersClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[KubernetesClustersClientListBySubscriptionResponse]{ + More: func(page KubernetesClustersClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *KubernetesClustersClientListBySubscriptionResponse) (KubernetesClustersClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return KubernetesClustersClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return KubernetesClustersClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return KubernetesClustersClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *KubernetesClustersClient) listBySubscriptionCreateRequest(ctx context.Context, options *KubernetesClustersClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/kubernetesClusters" + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *KubernetesClustersClient) listBySubscriptionHandleResponse(resp *http.Response) (KubernetesClustersClientListBySubscriptionResponse, error) { + result := KubernetesClustersClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.KubernetesClusterList); err != nil { + return KubernetesClustersClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginRestartNode - Restart a targeted node of a Kubernetes cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - kubernetesClusterName - The name of the Kubernetes cluster. +// - kubernetesClusterRestartNodeParameters - The request body. +// - options - KubernetesClustersClientBeginRestartNodeOptions contains the optional parameters for the KubernetesClustersClient.BeginRestartNode +// method. +func (client *KubernetesClustersClient) BeginRestartNode(ctx context.Context, resourceGroupName string, kubernetesClusterName string, kubernetesClusterRestartNodeParameters KubernetesClusterRestartNodeParameters, options *KubernetesClustersClientBeginRestartNodeOptions) (*runtime.Poller[KubernetesClustersClientRestartNodeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.restartNode(ctx, resourceGroupName, kubernetesClusterName, kubernetesClusterRestartNodeParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[KubernetesClustersClientRestartNodeResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[KubernetesClustersClientRestartNodeResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// RestartNode - Restart a targeted node of a Kubernetes cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *KubernetesClustersClient) restartNode(ctx context.Context, resourceGroupName string, kubernetesClusterName string, kubernetesClusterRestartNodeParameters KubernetesClusterRestartNodeParameters, options *KubernetesClustersClientBeginRestartNodeOptions) (*http.Response, error) { + req, err := client.restartNodeCreateRequest(ctx, resourceGroupName, kubernetesClusterName, kubernetesClusterRestartNodeParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// restartNodeCreateRequest creates the RestartNode request. +func (client *KubernetesClustersClient) restartNodeCreateRequest(ctx context.Context, resourceGroupName string, kubernetesClusterName string, kubernetesClusterRestartNodeParameters KubernetesClusterRestartNodeParameters, options *KubernetesClustersClientBeginRestartNodeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode" + 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 kubernetesClusterName == "" { + return nil, errors.New("parameter kubernetesClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{kubernetesClusterName}", url.PathEscape(kubernetesClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, kubernetesClusterRestartNodeParameters) +} + +// BeginUpdate - Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes +// cluster. Properties and tag updates can be done independently. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - kubernetesClusterName - The name of the Kubernetes cluster. +// - kubernetesClusterUpdateParameters - The request body. +// - options - KubernetesClustersClientBeginUpdateOptions contains the optional parameters for the KubernetesClustersClient.BeginUpdate +// method. +func (client *KubernetesClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, kubernetesClusterName string, kubernetesClusterUpdateParameters KubernetesClusterPatchParameters, options *KubernetesClustersClientBeginUpdateOptions) (*runtime.Poller[KubernetesClustersClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, kubernetesClusterName, kubernetesClusterUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[KubernetesClustersClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[KubernetesClustersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. +// Properties and tag updates can be done independently. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *KubernetesClustersClient) update(ctx context.Context, resourceGroupName string, kubernetesClusterName string, kubernetesClusterUpdateParameters KubernetesClusterPatchParameters, options *KubernetesClustersClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, kubernetesClusterName, kubernetesClusterUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *KubernetesClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, kubernetesClusterName string, kubernetesClusterUpdateParameters KubernetesClusterPatchParameters, options *KubernetesClustersClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" + 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 kubernetesClusterName == "" { + return nil, errors.New("parameter kubernetesClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{kubernetesClusterName}", url.PathEscape(kubernetesClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, kubernetesClusterUpdateParameters) +} diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/kubernetesclusters_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/kubernetesclusters_client_example_test.go new file mode 100644 index 000000000000..e78f61eed6a8 --- /dev/null +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/kubernetesclusters_client_example_test.go @@ -0,0 +1,1494 @@ +//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 armnetworkcloud_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/networkcloud/armnetworkcloud" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/KubernetesClusters_ListBySubscription.json +func ExampleKubernetesClustersClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewKubernetesClustersClient().NewListBySubscriptionPager(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.KubernetesClusterList = armnetworkcloud.KubernetesClusterList{ + // Value: []*armnetworkcloud.KubernetesCluster{ + // { + // Name: to.Ptr("KubernetesClusterName"), + // Type: to.Ptr("Microsoft.NetworkCloud/kubernetesClusters"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/kubernetesClusters/kubernetesClusterName"), + // SystemData: &armnetworkcloud.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), + // CreatedBy: to.Ptr("identityA"), + // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), + // LastModifiedBy: to.Ptr("identityB"), + // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), + // }, + // Location: to.Ptr("location"), + // Tags: map[string]*string{ + // "key1": to.Ptr("myvalue1"), + // "key2": to.Ptr("myvalue2"), + // }, + // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Type: to.Ptr("CustomLocation"), + // }, + // Properties: &armnetworkcloud.KubernetesClusterProperties{ + // AADConfiguration: &armnetworkcloud.AADConfiguration{ + // AdminGroupObjectIDs: []*string{ + // to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff")}, + // }, + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AttachedNetworkIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName")}, + // AvailableUpgrades: []*armnetworkcloud.AvailableUpgrade{ + // { + // AvailabilityLifecycle: to.Ptr(armnetworkcloud.AvailabilityLifecycleGenerallyAvailable), + // Version: to.Ptr("1.24.13-1"), + // }}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ConnectedClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName"), + // ControlPlaneKubernetesVersion: to.Ptr("1.24.12-1"), + // ControlPlaneNodeConfiguration: &armnetworkcloud.ControlPlaneNodeConfiguration{ + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // VMSKUName: to.Ptr("NC_G4_v1"), + // }, + // DetailedStatus: to.Ptr(armnetworkcloud.KubernetesClusterDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Kubernetes cluster is operational"), + // FeatureStatuses: []*armnetworkcloud.FeatureStatus{ + // { + // Name: to.Ptr("Feature1"), + // DetailedStatus: to.Ptr(armnetworkcloud.FeatureDetailedStatusRunning), + // DetailedStatusMessage: to.Ptr("No issues detected"), + // Version: to.Ptr("1"), + // }}, + // InitialAgentPoolConfigurations: []*armnetworkcloud.InitialAgentPoolConfiguration{ + // { + // Name: to.Ptr("SystemPool-1"), + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AgentOptions: &armnetworkcloud.AgentOptions{ + // HugepagesCount: to.Ptr[int64](96), + // HugepagesSize: to.Ptr(armnetworkcloud.HugepagesSizeOneG), + // }, + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // UpgradeSettings: &armnetworkcloud.AgentPoolUpgradeSettings{ + // MaxSurge: to.Ptr("1"), + // }, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }}, + // KubernetesVersion: to.Ptr("1.24.12-1"), + // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ + // Name: to.Ptr("my-managed-rg"), + // Location: to.Ptr("East US"), + // }, + // NetworkConfiguration: &armnetworkcloud.NetworkConfiguration{ + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // BgpServiceLoadBalancerConfiguration: &armnetworkcloud.BgpServiceLoadBalancerConfiguration{ + // BgpAdvertisements: []*armnetworkcloud.BgpAdvertisement{ + // { + // AdvertiseToFabric: to.Ptr(armnetworkcloud.AdvertiseToFabricTrue), + // Communities: []*string{ + // to.Ptr("64512:100")}, + // IPAddressPools: []*string{ + // to.Ptr("pool1")}, + // Peers: []*string{ + // to.Ptr("peer1")}, + // }}, + // BgpPeers: []*armnetworkcloud.ServiceLoadBalancerBgpPeer{ + // { + // Name: to.Ptr("peer1"), + // BfdEnabled: to.Ptr(armnetworkcloud.BfdEnabledFalse), + // BgpMultiHop: to.Ptr(armnetworkcloud.BgpMultiHopFalse), + // HoldTime: to.Ptr("P300s"), + // KeepAliveTime: to.Ptr("P300s"), + // MyAsn: to.Ptr[int64](64512), + // PeerAddress: to.Ptr("203.0.113.254"), + // PeerAsn: to.Ptr[int64](64497), + // PeerPort: to.Ptr[int64](179), + // }}, + // FabricPeeringEnabled: to.Ptr(armnetworkcloud.FabricPeeringEnabledTrue), + // IPAddressPools: []*armnetworkcloud.IPAddressPool{ + // { + // Name: to.Ptr("pool1"), + // Addresses: []*string{ + // to.Ptr("198.51.102.0/24")}, + // AutoAssign: to.Ptr(armnetworkcloud.BfdEnabledTrue), + // OnlyUseHostIPs: to.Ptr(armnetworkcloud.BfdEnabledTrue), + // }}, + // }, + // CloudServicesNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // CniNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // DNSServiceIP: to.Ptr("198.51.101.2"), + // PodCidrs: []*string{ + // to.Ptr("198.51.100.0/24")}, + // ServiceCidrs: []*string{ + // to.Ptr("198.51.101.0/24")}, + // }, + // Nodes: []*armnetworkcloud.KubernetesClusterNode{ + // { + // Name: to.Ptr("machine1"), + // AgentPoolID: to.Ptr("pool1"), + // AvailabilityZone: to.Ptr("1"), + // BareMetalMachineID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // CPUCores: to.Ptr[int64](20), + // DetailedStatus: to.Ptr(armnetworkcloud.KubernetesClusterNodeDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("No issues detected"), + // DiskSizeGB: to.Ptr[int64](120), + // Image: to.Ptr("myacr.azurecr.io/foobar:latest"), + // KubernetesVersion: to.Ptr("1.24.12-1"), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // MemorySizeGB: to.Ptr[int64](256), + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ + // { + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), + // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), + // IPv4Address: to.Ptr("198.51.100.1"), + // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0000"), + // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), + // NetworkAttachmentName: to.Ptr("netAttachName01"), + // }}, + // PowerState: to.Ptr(armnetworkcloud.KubernetesNodePowerStateOn), + // Role: to.Ptr(armnetworkcloud.KubernetesNodeRoleControlPlane), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }}, + // ProvisioningState: to.Ptr(armnetworkcloud.KubernetesClusterProvisioningStateSucceeded), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/KubernetesClusters_ListByResourceGroup.json +func ExampleKubernetesClustersClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewKubernetesClustersClient().NewListByResourceGroupPager("resourceGroupName", 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.KubernetesClusterList = armnetworkcloud.KubernetesClusterList{ + // Value: []*armnetworkcloud.KubernetesCluster{ + // { + // Name: to.Ptr("KubernetesClusterName"), + // Type: to.Ptr("Microsoft.NetworkCloud/kubernetesClusters"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/kubernetesClusters/kubernetesClusterName"), + // SystemData: &armnetworkcloud.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), + // CreatedBy: to.Ptr("identityA"), + // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), + // LastModifiedBy: to.Ptr("identityB"), + // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), + // }, + // Location: to.Ptr("location"), + // Tags: map[string]*string{ + // "key1": to.Ptr("myvalue1"), + // "key2": to.Ptr("myvalue2"), + // }, + // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Type: to.Ptr("CustomLocation"), + // }, + // Properties: &armnetworkcloud.KubernetesClusterProperties{ + // AADConfiguration: &armnetworkcloud.AADConfiguration{ + // AdminGroupObjectIDs: []*string{ + // to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff")}, + // }, + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AttachedNetworkIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName")}, + // AvailableUpgrades: []*armnetworkcloud.AvailableUpgrade{ + // { + // AvailabilityLifecycle: to.Ptr(armnetworkcloud.AvailabilityLifecycleGenerallyAvailable), + // Version: to.Ptr("1.24.13-1"), + // }}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ConnectedClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName"), + // ControlPlaneKubernetesVersion: to.Ptr("1.24.12-1"), + // ControlPlaneNodeConfiguration: &armnetworkcloud.ControlPlaneNodeConfiguration{ + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // VMSKUName: to.Ptr("NC_G4_v1"), + // }, + // DetailedStatus: to.Ptr(armnetworkcloud.KubernetesClusterDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Kubernetes cluster is operational"), + // FeatureStatuses: []*armnetworkcloud.FeatureStatus{ + // { + // Name: to.Ptr("Feature1"), + // DetailedStatus: to.Ptr(armnetworkcloud.FeatureDetailedStatusRunning), + // DetailedStatusMessage: to.Ptr("No issues detected"), + // Version: to.Ptr("1"), + // }}, + // InitialAgentPoolConfigurations: []*armnetworkcloud.InitialAgentPoolConfiguration{ + // { + // Name: to.Ptr("SystemPool-1"), + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AgentOptions: &armnetworkcloud.AgentOptions{ + // HugepagesCount: to.Ptr[int64](96), + // HugepagesSize: to.Ptr(armnetworkcloud.HugepagesSizeOneG), + // }, + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // UpgradeSettings: &armnetworkcloud.AgentPoolUpgradeSettings{ + // MaxSurge: to.Ptr("1"), + // }, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }}, + // KubernetesVersion: to.Ptr("1.24.12-1"), + // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ + // Name: to.Ptr("my-managed-rg"), + // Location: to.Ptr("East US"), + // }, + // NetworkConfiguration: &armnetworkcloud.NetworkConfiguration{ + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // BgpServiceLoadBalancerConfiguration: &armnetworkcloud.BgpServiceLoadBalancerConfiguration{ + // BgpAdvertisements: []*armnetworkcloud.BgpAdvertisement{ + // { + // AdvertiseToFabric: to.Ptr(armnetworkcloud.AdvertiseToFabricTrue), + // Communities: []*string{ + // to.Ptr("64512:100")}, + // IPAddressPools: []*string{ + // to.Ptr("pool1")}, + // Peers: []*string{ + // to.Ptr("peer1")}, + // }}, + // BgpPeers: []*armnetworkcloud.ServiceLoadBalancerBgpPeer{ + // { + // Name: to.Ptr("peer1"), + // BfdEnabled: to.Ptr(armnetworkcloud.BfdEnabledFalse), + // BgpMultiHop: to.Ptr(armnetworkcloud.BgpMultiHopFalse), + // HoldTime: to.Ptr("P300s"), + // KeepAliveTime: to.Ptr("P300s"), + // MyAsn: to.Ptr[int64](64512), + // PeerAddress: to.Ptr("203.0.113.254"), + // PeerAsn: to.Ptr[int64](64497), + // PeerPort: to.Ptr[int64](179), + // }}, + // FabricPeeringEnabled: to.Ptr(armnetworkcloud.FabricPeeringEnabledTrue), + // IPAddressPools: []*armnetworkcloud.IPAddressPool{ + // { + // Name: to.Ptr("pool1"), + // Addresses: []*string{ + // to.Ptr("198.51.102.0/24")}, + // AutoAssign: to.Ptr(armnetworkcloud.BfdEnabledTrue), + // OnlyUseHostIPs: to.Ptr(armnetworkcloud.BfdEnabledTrue), + // }}, + // }, + // CloudServicesNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // CniNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // DNSServiceIP: to.Ptr("198.51.101.2"), + // PodCidrs: []*string{ + // to.Ptr("198.51.100.0/24")}, + // ServiceCidrs: []*string{ + // to.Ptr("198.51.101.0/24")}, + // }, + // Nodes: []*armnetworkcloud.KubernetesClusterNode{ + // { + // Name: to.Ptr("machine1"), + // AgentPoolID: to.Ptr("pool1"), + // AvailabilityZone: to.Ptr("1"), + // BareMetalMachineID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // CPUCores: to.Ptr[int64](20), + // DetailedStatus: to.Ptr(armnetworkcloud.KubernetesClusterNodeDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("No issues detected"), + // DiskSizeGB: to.Ptr[int64](120), + // Image: to.Ptr("myacr.azurecr.io/foobar:latest"), + // KubernetesVersion: to.Ptr("1.24.12-1"), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // MemorySizeGB: to.Ptr[int64](256), + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ + // { + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), + // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), + // IPv4Address: to.Ptr("198.51.100.1"), + // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0000"), + // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), + // NetworkAttachmentName: to.Ptr("netAttachName01"), + // }}, + // PowerState: to.Ptr(armnetworkcloud.KubernetesNodePowerStateOn), + // Role: to.Ptr(armnetworkcloud.KubernetesNodeRoleControlPlane), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }}, + // ProvisioningState: to.Ptr(armnetworkcloud.KubernetesClusterProvisioningStateSucceeded), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/KubernetesClusters_Get.json +func ExampleKubernetesClustersClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewKubernetesClustersClient().Get(ctx, "resourceGroupName", "kubernetesClusterName", 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.KubernetesCluster = armnetworkcloud.KubernetesCluster{ + // Name: to.Ptr("KubernetesClusterName"), + // Type: to.Ptr("Microsoft.NetworkCloud/kubernetesClusters"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/kubernetesClusters/kubernetesClusterName"), + // SystemData: &armnetworkcloud.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), + // CreatedBy: to.Ptr("identityA"), + // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), + // LastModifiedBy: to.Ptr("identityB"), + // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), + // }, + // Location: to.Ptr("location"), + // Tags: map[string]*string{ + // "key1": to.Ptr("myvalue1"), + // "key2": to.Ptr("myvalue2"), + // }, + // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Type: to.Ptr("CustomLocation"), + // }, + // Properties: &armnetworkcloud.KubernetesClusterProperties{ + // AADConfiguration: &armnetworkcloud.AADConfiguration{ + // AdminGroupObjectIDs: []*string{ + // to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff")}, + // }, + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AttachedNetworkIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName")}, + // AvailableUpgrades: []*armnetworkcloud.AvailableUpgrade{ + // { + // AvailabilityLifecycle: to.Ptr(armnetworkcloud.AvailabilityLifecycleGenerallyAvailable), + // Version: to.Ptr("1.24.13-1"), + // }}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ConnectedClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName"), + // ControlPlaneKubernetesVersion: to.Ptr("1.24.12-1"), + // ControlPlaneNodeConfiguration: &armnetworkcloud.ControlPlaneNodeConfiguration{ + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // VMSKUName: to.Ptr("NC_G4_v1"), + // }, + // DetailedStatus: to.Ptr(armnetworkcloud.KubernetesClusterDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Kubernetes cluster is operational"), + // FeatureStatuses: []*armnetworkcloud.FeatureStatus{ + // { + // Name: to.Ptr("Feature1"), + // DetailedStatus: to.Ptr(armnetworkcloud.FeatureDetailedStatusRunning), + // DetailedStatusMessage: to.Ptr("No issues detected"), + // Version: to.Ptr("1"), + // }}, + // InitialAgentPoolConfigurations: []*armnetworkcloud.InitialAgentPoolConfiguration{ + // { + // Name: to.Ptr("SystemPool-1"), + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AgentOptions: &armnetworkcloud.AgentOptions{ + // HugepagesCount: to.Ptr[int64](96), + // HugepagesSize: to.Ptr(armnetworkcloud.HugepagesSizeOneG), + // }, + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // UpgradeSettings: &armnetworkcloud.AgentPoolUpgradeSettings{ + // MaxSurge: to.Ptr("1"), + // }, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }}, + // KubernetesVersion: to.Ptr("1.24.12-1"), + // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ + // Name: to.Ptr("my-managed-rg"), + // Location: to.Ptr("East US"), + // }, + // NetworkConfiguration: &armnetworkcloud.NetworkConfiguration{ + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // BgpServiceLoadBalancerConfiguration: &armnetworkcloud.BgpServiceLoadBalancerConfiguration{ + // BgpAdvertisements: []*armnetworkcloud.BgpAdvertisement{ + // { + // AdvertiseToFabric: to.Ptr(armnetworkcloud.AdvertiseToFabricTrue), + // Communities: []*string{ + // to.Ptr("64512:100")}, + // IPAddressPools: []*string{ + // to.Ptr("pool1")}, + // Peers: []*string{ + // to.Ptr("peer1")}, + // }}, + // BgpPeers: []*armnetworkcloud.ServiceLoadBalancerBgpPeer{ + // { + // Name: to.Ptr("peer1"), + // BfdEnabled: to.Ptr(armnetworkcloud.BfdEnabledFalse), + // BgpMultiHop: to.Ptr(armnetworkcloud.BgpMultiHopFalse), + // HoldTime: to.Ptr("P300s"), + // KeepAliveTime: to.Ptr("P300s"), + // MyAsn: to.Ptr[int64](64512), + // PeerAddress: to.Ptr("203.0.113.254"), + // PeerAsn: to.Ptr[int64](64497), + // PeerPort: to.Ptr[int64](179), + // }}, + // FabricPeeringEnabled: to.Ptr(armnetworkcloud.FabricPeeringEnabledTrue), + // IPAddressPools: []*armnetworkcloud.IPAddressPool{ + // { + // Name: to.Ptr("pool1"), + // Addresses: []*string{ + // to.Ptr("198.51.102.0/24")}, + // AutoAssign: to.Ptr(armnetworkcloud.BfdEnabledTrue), + // OnlyUseHostIPs: to.Ptr(armnetworkcloud.BfdEnabledTrue), + // }}, + // }, + // CloudServicesNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // CniNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // DNSServiceIP: to.Ptr("198.51.101.2"), + // PodCidrs: []*string{ + // to.Ptr("198.51.100.0/24")}, + // ServiceCidrs: []*string{ + // to.Ptr("198.51.101.0/24")}, + // }, + // Nodes: []*armnetworkcloud.KubernetesClusterNode{ + // { + // Name: to.Ptr("machine1"), + // AgentPoolID: to.Ptr("pool1"), + // AvailabilityZone: to.Ptr("1"), + // BareMetalMachineID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // CPUCores: to.Ptr[int64](20), + // DetailedStatus: to.Ptr(armnetworkcloud.KubernetesClusterNodeDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("No issues detected"), + // DiskSizeGB: to.Ptr[int64](120), + // Image: to.Ptr("myacr.azurecr.io/foobar:latest"), + // KubernetesVersion: to.Ptr("1.24.12-1"), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // MemorySizeGB: to.Ptr[int64](256), + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ + // { + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), + // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), + // IPv4Address: to.Ptr("198.51.100.1"), + // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0000"), + // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), + // NetworkAttachmentName: to.Ptr("netAttachName01"), + // }}, + // PowerState: to.Ptr(armnetworkcloud.KubernetesNodePowerStateOn), + // Role: to.Ptr(armnetworkcloud.KubernetesNodeRoleControlPlane), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }}, + // ProvisioningState: to.Ptr(armnetworkcloud.KubernetesClusterProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/KubernetesClusters_Create.json +func ExampleKubernetesClustersClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewKubernetesClustersClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "kubernetesClusterName", armnetworkcloud.KubernetesCluster{ + Location: to.Ptr("location"), + Tags: map[string]*string{ + "key1": to.Ptr("myvalue1"), + "key2": to.Ptr("myvalue2"), + }, + ExtendedLocation: &armnetworkcloud.ExtendedLocation{ + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Type: to.Ptr("CustomLocation"), + }, + Properties: &armnetworkcloud.KubernetesClusterProperties{ + AADConfiguration: &armnetworkcloud.AADConfiguration{ + AdminGroupObjectIDs: []*string{ + to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff")}, + }, + AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + AdminUsername: to.Ptr("azure"), + SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + { + KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + }}, + }, + ControlPlaneNodeConfiguration: &armnetworkcloud.ControlPlaneNodeConfiguration{ + AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + AdminUsername: to.Ptr("azure"), + SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + { + KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + }}, + }, + AvailabilityZones: []*string{ + to.Ptr("1"), + to.Ptr("2"), + to.Ptr("3")}, + Count: to.Ptr[int64](3), + VMSKUName: to.Ptr("NC_G4_v1"), + }, + InitialAgentPoolConfigurations: []*armnetworkcloud.InitialAgentPoolConfiguration{ + { + Name: to.Ptr("SystemPool-1"), + AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + AdminUsername: to.Ptr("azure"), + SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + { + KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + }}, + }, + AgentOptions: &armnetworkcloud.AgentOptions{ + HugepagesCount: to.Ptr[int64](96), + HugepagesSize: to.Ptr(armnetworkcloud.HugepagesSizeOneG), + }, + AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + { + NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + }}, + L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + { + IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + }}, + TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + { + NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + }}, + }, + AvailabilityZones: []*string{ + to.Ptr("1"), + to.Ptr("2"), + to.Ptr("3")}, + Count: to.Ptr[int64](3), + Labels: []*armnetworkcloud.KubernetesLabel{ + { + Key: to.Ptr("kubernetes.label"), + Value: to.Ptr("true"), + }}, + Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + Taints: []*armnetworkcloud.KubernetesLabel{ + { + Key: to.Ptr("kubernetes.taint"), + Value: to.Ptr("true"), + }}, + UpgradeSettings: &armnetworkcloud.AgentPoolUpgradeSettings{ + MaxSurge: to.Ptr("1"), + }, + VMSKUName: to.Ptr("NC_M16_v1"), + }}, + KubernetesVersion: to.Ptr("1.24.12-1"), + ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ + Name: to.Ptr("my-managed-rg"), + Location: to.Ptr("East US"), + }, + NetworkConfiguration: &armnetworkcloud.NetworkConfiguration{ + AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + { + NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + }}, + L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + { + IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + }}, + TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + { + NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + }}, + }, + BgpServiceLoadBalancerConfiguration: &armnetworkcloud.BgpServiceLoadBalancerConfiguration{ + BgpAdvertisements: []*armnetworkcloud.BgpAdvertisement{ + { + AdvertiseToFabric: to.Ptr(armnetworkcloud.AdvertiseToFabricTrue), + Communities: []*string{ + to.Ptr("64512:100")}, + IPAddressPools: []*string{ + to.Ptr("pool1")}, + Peers: []*string{ + to.Ptr("peer1")}, + }}, + BgpPeers: []*armnetworkcloud.ServiceLoadBalancerBgpPeer{ + { + Name: to.Ptr("peer1"), + BfdEnabled: to.Ptr(armnetworkcloud.BfdEnabledFalse), + BgpMultiHop: to.Ptr(armnetworkcloud.BgpMultiHopFalse), + HoldTime: to.Ptr("P300s"), + KeepAliveTime: to.Ptr("P300s"), + MyAsn: to.Ptr[int64](64512), + PeerAddress: to.Ptr("203.0.113.254"), + PeerAsn: to.Ptr[int64](64497), + PeerPort: to.Ptr[int64](179), + }}, + FabricPeeringEnabled: to.Ptr(armnetworkcloud.FabricPeeringEnabledTrue), + IPAddressPools: []*armnetworkcloud.IPAddressPool{ + { + Name: to.Ptr("pool1"), + Addresses: []*string{ + to.Ptr("198.51.102.0/24")}, + AutoAssign: to.Ptr(armnetworkcloud.BfdEnabledTrue), + OnlyUseHostIPs: to.Ptr(armnetworkcloud.BfdEnabledTrue), + }}, + }, + CloudServicesNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + CniNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + DNSServiceIP: to.Ptr("198.51.101.2"), + PodCidrs: []*string{ + to.Ptr("198.51.100.0/24")}, + ServiceCidrs: []*string{ + to.Ptr("198.51.101.0/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.KubernetesCluster = armnetworkcloud.KubernetesCluster{ + // Name: to.Ptr("KubernetesClusterName"), + // Type: to.Ptr("Microsoft.NetworkCloud/kubernetesClusters"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/kubernetesClusters/kubernetesClusterName"), + // SystemData: &armnetworkcloud.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), + // CreatedBy: to.Ptr("identityA"), + // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), + // LastModifiedBy: to.Ptr("identityB"), + // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), + // }, + // Location: to.Ptr("location"), + // Tags: map[string]*string{ + // "key1": to.Ptr("myvalue1"), + // "key2": to.Ptr("myvalue2"), + // }, + // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Type: to.Ptr("CustomLocation"), + // }, + // Properties: &armnetworkcloud.KubernetesClusterProperties{ + // AADConfiguration: &armnetworkcloud.AADConfiguration{ + // AdminGroupObjectIDs: []*string{ + // to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff")}, + // }, + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AttachedNetworkIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName")}, + // AvailableUpgrades: []*armnetworkcloud.AvailableUpgrade{ + // { + // AvailabilityLifecycle: to.Ptr(armnetworkcloud.AvailabilityLifecycleGenerallyAvailable), + // Version: to.Ptr("1.24.13-1"), + // }}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ConnectedClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName"), + // ControlPlaneKubernetesVersion: to.Ptr("1.24.12-1"), + // ControlPlaneNodeConfiguration: &armnetworkcloud.ControlPlaneNodeConfiguration{ + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // VMSKUName: to.Ptr("NC_G4_v1"), + // }, + // DetailedStatus: to.Ptr(armnetworkcloud.KubernetesClusterDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Kubernetes cluster is operational"), + // FeatureStatuses: []*armnetworkcloud.FeatureStatus{ + // { + // Name: to.Ptr("Feature1"), + // DetailedStatus: to.Ptr(armnetworkcloud.FeatureDetailedStatusRunning), + // DetailedStatusMessage: to.Ptr("No issues detected"), + // Version: to.Ptr("1"), + // }}, + // InitialAgentPoolConfigurations: []*armnetworkcloud.InitialAgentPoolConfiguration{ + // { + // Name: to.Ptr("SystemPool-1"), + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AgentOptions: &armnetworkcloud.AgentOptions{ + // HugepagesCount: to.Ptr[int64](96), + // HugepagesSize: to.Ptr(armnetworkcloud.HugepagesSizeOneG), + // }, + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // UpgradeSettings: &armnetworkcloud.AgentPoolUpgradeSettings{ + // MaxSurge: to.Ptr("1"), + // }, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }}, + // KubernetesVersion: to.Ptr("1.24.12-1"), + // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ + // Name: to.Ptr("my-managed-rg"), + // Location: to.Ptr("East US"), + // }, + // NetworkConfiguration: &armnetworkcloud.NetworkConfiguration{ + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // BgpServiceLoadBalancerConfiguration: &armnetworkcloud.BgpServiceLoadBalancerConfiguration{ + // BgpAdvertisements: []*armnetworkcloud.BgpAdvertisement{ + // { + // AdvertiseToFabric: to.Ptr(armnetworkcloud.AdvertiseToFabricTrue), + // Communities: []*string{ + // to.Ptr("64512:100")}, + // IPAddressPools: []*string{ + // to.Ptr("pool1")}, + // Peers: []*string{ + // to.Ptr("peer1")}, + // }}, + // BgpPeers: []*armnetworkcloud.ServiceLoadBalancerBgpPeer{ + // { + // Name: to.Ptr("peer1"), + // BfdEnabled: to.Ptr(armnetworkcloud.BfdEnabledFalse), + // BgpMultiHop: to.Ptr(armnetworkcloud.BgpMultiHopFalse), + // HoldTime: to.Ptr("P300s"), + // KeepAliveTime: to.Ptr("P300s"), + // MyAsn: to.Ptr[int64](64512), + // PeerAddress: to.Ptr("203.0.113.254"), + // PeerAsn: to.Ptr[int64](64497), + // PeerPort: to.Ptr[int64](179), + // }}, + // FabricPeeringEnabled: to.Ptr(armnetworkcloud.FabricPeeringEnabledTrue), + // IPAddressPools: []*armnetworkcloud.IPAddressPool{ + // { + // Name: to.Ptr("pool1"), + // Addresses: []*string{ + // to.Ptr("198.51.102.0/24")}, + // AutoAssign: to.Ptr(armnetworkcloud.BfdEnabledTrue), + // OnlyUseHostIPs: to.Ptr(armnetworkcloud.BfdEnabledTrue), + // }}, + // }, + // CloudServicesNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // CniNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // DNSServiceIP: to.Ptr("198.51.101.2"), + // PodCidrs: []*string{ + // to.Ptr("198.51.100.0/24")}, + // ServiceCidrs: []*string{ + // to.Ptr("198.51.101.0/24")}, + // }, + // Nodes: []*armnetworkcloud.KubernetesClusterNode{ + // { + // Name: to.Ptr("machine1"), + // AgentPoolID: to.Ptr("pool1"), + // AvailabilityZone: to.Ptr("1"), + // BareMetalMachineID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // CPUCores: to.Ptr[int64](20), + // DetailedStatus: to.Ptr(armnetworkcloud.KubernetesClusterNodeDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("No issues detected"), + // DiskSizeGB: to.Ptr[int64](120), + // Image: to.Ptr("myacr.azurecr.io/foobar:latest"), + // KubernetesVersion: to.Ptr("1.24.12-1"), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // MemorySizeGB: to.Ptr[int64](256), + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ + // { + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), + // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), + // IPv4Address: to.Ptr("198.51.100.1"), + // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0000"), + // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), + // NetworkAttachmentName: to.Ptr("netAttachName01"), + // }}, + // PowerState: to.Ptr(armnetworkcloud.KubernetesNodePowerStateOn), + // Role: to.Ptr(armnetworkcloud.KubernetesNodeRoleControlPlane), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }}, + // ProvisioningState: to.Ptr(armnetworkcloud.KubernetesClusterProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/KubernetesClusters_Delete.json +func ExampleKubernetesClustersClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewKubernetesClustersClient().BeginDelete(ctx, "resourceGroupName", "kubernetesClusterName", 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/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/KubernetesClusters_Patch.json +func ExampleKubernetesClustersClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewKubernetesClustersClient().BeginUpdate(ctx, "resourceGroupName", "kubernetesClusterName", armnetworkcloud.KubernetesClusterPatchParameters{ + Properties: &armnetworkcloud.KubernetesClusterPatchProperties{ + ControlPlaneNodeConfiguration: &armnetworkcloud.ControlPlaneNodePatchConfiguration{ + Count: to.Ptr[int64](3), + }, + KubernetesVersion: to.Ptr("1.24.12"), + }, + Tags: map[string]*string{ + "key1": to.Ptr("myvalue1"), + "key2": to.Ptr("myvalue2"), + }, + }, 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.KubernetesCluster = armnetworkcloud.KubernetesCluster{ + // Name: to.Ptr("KubernetesClusterName"), + // Type: to.Ptr("Microsoft.NetworkCloud/kubernetesClusters"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/kubernetesClusters/kubernetesClusterName"), + // SystemData: &armnetworkcloud.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), + // CreatedBy: to.Ptr("identityA"), + // CreatedByType: to.Ptr(armnetworkcloud.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:29:03.001Z"); return t}()), + // LastModifiedBy: to.Ptr("identityB"), + // LastModifiedByType: to.Ptr(armnetworkcloud.CreatedByTypeUser), + // }, + // Location: to.Ptr("location"), + // Tags: map[string]*string{ + // "key1": to.Ptr("myvalue1"), + // "key2": to.Ptr("myvalue2"), + // }, + // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Type: to.Ptr("CustomLocation"), + // }, + // Properties: &armnetworkcloud.KubernetesClusterProperties{ + // AADConfiguration: &armnetworkcloud.AADConfiguration{ + // AdminGroupObjectIDs: []*string{ + // to.Ptr("ffffffff-ffff-ffff-ffff-ffffffffffff")}, + // }, + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AttachedNetworkIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName")}, + // AvailableUpgrades: []*armnetworkcloud.AvailableUpgrade{ + // { + // AvailabilityLifecycle: to.Ptr(armnetworkcloud.AvailabilityLifecycleGenerallyAvailable), + // Version: to.Ptr("1.24.13-1"), + // }}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ConnectedClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName"), + // ControlPlaneKubernetesVersion: to.Ptr("1.24.12-1"), + // ControlPlaneNodeConfiguration: &armnetworkcloud.ControlPlaneNodeConfiguration{ + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // VMSKUName: to.Ptr("NC_G4_v1"), + // }, + // DetailedStatus: to.Ptr(armnetworkcloud.KubernetesClusterDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Kubernetes cluster is operational"), + // FeatureStatuses: []*armnetworkcloud.FeatureStatus{ + // { + // Name: to.Ptr("Feature1"), + // DetailedStatus: to.Ptr(armnetworkcloud.FeatureDetailedStatusRunning), + // DetailedStatusMessage: to.Ptr("No issues detected"), + // Version: to.Ptr("1"), + // }}, + // InitialAgentPoolConfigurations: []*armnetworkcloud.InitialAgentPoolConfiguration{ + // { + // Name: to.Ptr("SystemPool-1"), + // AdministratorConfiguration: &armnetworkcloud.AdministratorConfiguration{ + // AdminUsername: to.Ptr("azure"), + // SSHPublicKeys: []*armnetworkcloud.SSHPublicKey{ + // { + // KeyData: to.Ptr("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"), + // }}, + // }, + // AgentOptions: &armnetworkcloud.AgentOptions{ + // HugepagesCount: to.Ptr[int64](96), + // HugepagesSize: to.Ptr(armnetworkcloud.HugepagesSizeOneG), + // }, + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int64](3), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // UpgradeSettings: &armnetworkcloud.AgentPoolUpgradeSettings{ + // MaxSurge: to.Ptr("1"), + // }, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }}, + // KubernetesVersion: to.Ptr("1.24.12-1"), + // ManagedResourceGroupConfiguration: &armnetworkcloud.ManagedResourceGroupConfiguration{ + // Name: to.Ptr("my-managed-rg"), + // Location: to.Ptr("East US"), + // }, + // NetworkConfiguration: &armnetworkcloud.NetworkConfiguration{ + // AttachedNetworkConfiguration: &armnetworkcloud.AttachedNetworkConfiguration{ + // L2Networks: []*armnetworkcloud.L2NetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeDPDK), + // }}, + // L3Networks: []*armnetworkcloud.L3NetworkAttachmentConfiguration{ + // { + // IpamEnabled: to.Ptr(armnetworkcloud.L3NetworkConfigurationIpamEnabledFalse), + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeSRIOV), + // }}, + // TrunkedNetworks: []*armnetworkcloud.TrunkedNetworkAttachmentConfiguration{ + // { + // NetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // PluginType: to.Ptr(armnetworkcloud.KubernetesPluginTypeMACVLAN), + // }}, + // }, + // BgpServiceLoadBalancerConfiguration: &armnetworkcloud.BgpServiceLoadBalancerConfiguration{ + // BgpAdvertisements: []*armnetworkcloud.BgpAdvertisement{ + // { + // AdvertiseToFabric: to.Ptr(armnetworkcloud.AdvertiseToFabricTrue), + // Communities: []*string{ + // to.Ptr("64512:100")}, + // IPAddressPools: []*string{ + // to.Ptr("pool1")}, + // Peers: []*string{ + // to.Ptr("peer1")}, + // }}, + // BgpPeers: []*armnetworkcloud.ServiceLoadBalancerBgpPeer{ + // { + // Name: to.Ptr("peer1"), + // BfdEnabled: to.Ptr(armnetworkcloud.BfdEnabledFalse), + // BgpMultiHop: to.Ptr(armnetworkcloud.BgpMultiHopFalse), + // HoldTime: to.Ptr("P300s"), + // KeepAliveTime: to.Ptr("P300s"), + // MyAsn: to.Ptr[int64](64512), + // PeerAddress: to.Ptr("203.0.113.254"), + // PeerAsn: to.Ptr[int64](64497), + // PeerPort: to.Ptr[int64](179), + // }}, + // FabricPeeringEnabled: to.Ptr(armnetworkcloud.FabricPeeringEnabledTrue), + // IPAddressPools: []*armnetworkcloud.IPAddressPool{ + // { + // Name: to.Ptr("pool1"), + // Addresses: []*string{ + // to.Ptr("198.51.102.0/24")}, + // AutoAssign: to.Ptr(armnetworkcloud.BfdEnabledTrue), + // OnlyUseHostIPs: to.Ptr(armnetworkcloud.BfdEnabledTrue), + // }}, + // }, + // CloudServicesNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // CniNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // DNSServiceIP: to.Ptr("198.51.101.2"), + // PodCidrs: []*string{ + // to.Ptr("198.51.100.0/24")}, + // ServiceCidrs: []*string{ + // to.Ptr("198.51.101.0/24")}, + // }, + // Nodes: []*armnetworkcloud.KubernetesClusterNode{ + // { + // Name: to.Ptr("machine1"), + // AgentPoolID: to.Ptr("pool1"), + // AvailabilityZone: to.Ptr("1"), + // BareMetalMachineID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // CPUCores: to.Ptr[int64](20), + // DetailedStatus: to.Ptr(armnetworkcloud.KubernetesClusterNodeDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("No issues detected"), + // DiskSizeGB: to.Ptr[int64](120), + // Image: to.Ptr("myacr.azurecr.io/foobar:latest"), + // KubernetesVersion: to.Ptr("1.24.12-1"), + // Labels: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.label"), + // Value: to.Ptr("true"), + // }}, + // MemorySizeGB: to.Ptr[int64](256), + // Mode: to.Ptr(armnetworkcloud.AgentPoolModeSystem), + // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ + // { + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), + // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), + // IPv4Address: to.Ptr("198.51.100.1"), + // IPv6Address: to.Ptr("2001:0db8:0000:0000:0000:0000:0000:0000"), + // MacAddress: to.Ptr("bf:1c:29:31:31:1f"), + // NetworkAttachmentName: to.Ptr("netAttachName01"), + // }}, + // PowerState: to.Ptr(armnetworkcloud.KubernetesNodePowerStateOn), + // Role: to.Ptr(armnetworkcloud.KubernetesNodeRoleControlPlane), + // Taints: []*armnetworkcloud.KubernetesLabel{ + // { + // Key: to.Ptr("kubernetes.taint"), + // Value: to.Ptr("true"), + // }}, + // VMSKUName: to.Ptr("NC_M16_v1"), + // }}, + // ProvisioningState: to.Ptr(armnetworkcloud.KubernetesClusterProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/KubernetesClusters_RestartNode.json +func ExampleKubernetesClustersClient_BeginRestartNode() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewKubernetesClustersClient().BeginRestartNode(ctx, "resourceGroupName", "kubernetesClusterName", armnetworkcloud.KubernetesClusterRestartNodeParameters{ + NodeName: to.Ptr("nodeName"), + }, 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/networkcloud/armnetworkcloud/l2networks_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/l2networks_client.go index deef0ecb58b6..91fab462fbf0 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/l2networks_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/l2networks_client.go @@ -29,7 +29,7 @@ type L2NetworksClient struct { } // NewL2NetworksClient creates a new instance of L2NetworksClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewL2NetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*L2NetworksClient, error) { @@ -47,7 +47,7 @@ func NewL2NetworksClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Create a new layer 2 (L2) network or update the properties of the existing network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - l2NetworkName - The name of the L2 network. // - l2NetworkParameters - The request body. @@ -70,7 +70,7 @@ func (client *L2NetworksClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Create a new layer 2 (L2) network or update the properties of the existing network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *L2NetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, l2NetworkName string, l2NetworkParameters L2Network, options *L2NetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, l2NetworkName, l2NetworkParameters, options) if err != nil { @@ -89,9 +89,6 @@ func (client *L2NetworksClient) createOrUpdate(ctx context.Context, resourceGrou // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *L2NetworksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, l2NetworkName string, l2NetworkParameters L2Network, options *L2NetworksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" - 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") @@ -106,7 +103,7 @@ func (client *L2NetworksClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, l2NetworkParameters) @@ -115,7 +112,7 @@ func (client *L2NetworksClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Delete the provided layer 2 (L2) network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - l2NetworkName - The name of the L2 network. // - options - L2NetworksClientBeginDeleteOptions contains the optional parameters for the L2NetworksClient.BeginDelete method. @@ -136,7 +133,7 @@ func (client *L2NetworksClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete the provided layer 2 (L2) network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *L2NetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, l2NetworkName string, options *L2NetworksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, l2NetworkName, options) if err != nil { @@ -155,9 +152,6 @@ func (client *L2NetworksClient) deleteOperation(ctx context.Context, resourceGro // deleteCreateRequest creates the Delete request. func (client *L2NetworksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, l2NetworkName string, options *L2NetworksClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" - 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") @@ -172,7 +166,7 @@ func (client *L2NetworksClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +175,7 @@ func (client *L2NetworksClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get properties of the provided layer 2 (L2) network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - l2NetworkName - The name of the L2 network. // - options - L2NetworksClientGetOptions contains the optional parameters for the L2NetworksClient.Get method. @@ -203,9 +197,6 @@ func (client *L2NetworksClient) Get(ctx context.Context, resourceGroupName strin // getCreateRequest creates the Get request. func (client *L2NetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, l2NetworkName string, options *L2NetworksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" - 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") @@ -220,7 +211,7 @@ func (client *L2NetworksClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,7 +228,7 @@ func (client *L2NetworksClient) getHandleResponse(resp *http.Response) (L2Networ // NewListByResourceGroupPager - Get a list of layer 2 (L2) networks in the provided resource group. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - L2NetworksClientListByResourceGroupOptions contains the optional parameters for the L2NetworksClient.NewListByResourceGroupPager // method. @@ -272,9 +263,6 @@ func (client *L2NetworksClient) NewListByResourceGroupPager(resourceGroupName st // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *L2NetworksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *L2NetworksClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks" - 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") @@ -285,7 +273,7 @@ func (client *L2NetworksClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,7 +290,7 @@ func (client *L2NetworksClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - Get a list of layer 2 (L2) networks in the provided subscription. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - options - L2NetworksClientListBySubscriptionOptions contains the optional parameters for the L2NetworksClient.NewListBySubscriptionPager // method. func (client *L2NetworksClient) NewListBySubscriptionPager(options *L2NetworksClientListBySubscriptionOptions) *runtime.Pager[L2NetworksClientListBySubscriptionResponse] { @@ -336,16 +324,13 @@ func (client *L2NetworksClient) NewListBySubscriptionPager(options *L2NetworksCl // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *L2NetworksClient) listBySubscriptionCreateRequest(ctx context.Context, options *L2NetworksClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l2Networks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) 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", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -363,7 +348,7 @@ func (client *L2NetworksClient) listBySubscriptionHandleResponse(resp *http.Resp // Update - Update tags associated with the provided layer 2 (L2) network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - l2NetworkName - The name of the L2 network. // - l2NetworkUpdateParameters - The request body. @@ -386,9 +371,6 @@ func (client *L2NetworksClient) Update(ctx context.Context, resourceGroupName st // updateCreateRequest creates the Update request. func (client *L2NetworksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, l2NetworkName string, l2NetworkUpdateParameters L2NetworkPatchParameters, options *L2NetworksClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" - 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") @@ -403,7 +385,7 @@ func (client *L2NetworksClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, l2NetworkUpdateParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/l2networks_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/l2networks_client_example_test.go index 803a7efbabf3..70fcaa92c314 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/l2networks_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/l2networks_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/L2Networks_ListBySubscription.json func ExampleL2NetworksClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleL2NetworksClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("l2NetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/l2Networks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -60,28 +60,25 @@ func ExampleL2NetworksClient_NewListBySubscriptionPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.L2NetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.L2NetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("L2 network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.L2NetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("L2 network is up"), // InterfaceName: to.Ptr("eth0"), - // L2IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), + // L2IsolationDomainID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), // ProvisioningState: to.Ptr(armnetworkcloud.L2NetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // }}, - // } + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/L2Networks_ListByResourceGroup.json func ExampleL2NetworksClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -108,7 +105,7 @@ func ExampleL2NetworksClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("l2NetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/l2Networks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -123,28 +120,25 @@ func ExampleL2NetworksClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.L2NetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.L2NetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("L2 network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.L2NetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("L2 network is up"), // InterfaceName: to.Ptr("eth0"), - // L2IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), + // L2IsolationDomainID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), // ProvisioningState: to.Ptr(armnetworkcloud.L2NetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // }}, - // } + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/L2Networks_Get.json func ExampleL2NetworksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -165,7 +159,7 @@ func ExampleL2NetworksClient_Get() { // res.L2Network = armnetworkcloud.L2Network{ // Name: to.Ptr("l2NetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/l2Networks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -180,26 +174,23 @@ func ExampleL2NetworksClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.L2NetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.L2NetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("L2 network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.L2NetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("L2 network is up"), // InterfaceName: to.Ptr("eth0"), - // L2IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), + // L2IsolationDomainID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), // ProvisioningState: to.Ptr(armnetworkcloud.L2NetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/L2Networks_Create.json func ExampleL2NetworksClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -217,13 +208,13 @@ func ExampleL2NetworksClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.L2NetworkProperties{ HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), InterfaceName: to.Ptr("eth0"), - L2IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), + L2IsolationDomainID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), }, }, nil) if err != nil { @@ -239,7 +230,7 @@ func ExampleL2NetworksClient_BeginCreateOrUpdate() { // res.L2Network = armnetworkcloud.L2Network{ // Name: to.Ptr("l2NetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/l2Networks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -254,26 +245,23 @@ func ExampleL2NetworksClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.L2NetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.L2NetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("L2 network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.L2NetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("L2 network is up"), // InterfaceName: to.Ptr("eth0"), - // L2IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), + // L2IsolationDomainID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), // ProvisioningState: to.Ptr(armnetworkcloud.L2NetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/L2Networks_Delete.json func ExampleL2NetworksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -294,7 +282,7 @@ func ExampleL2NetworksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/L2Networks_Patch.json func ExampleL2NetworksClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -320,7 +308,7 @@ func ExampleL2NetworksClient_Update() { // res.L2Network = armnetworkcloud.L2Network{ // Name: to.Ptr("l2NetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/l2Networks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l2Networks/l2NetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -335,21 +323,18 @@ func ExampleL2NetworksClient_Update() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.L2NetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.L2NetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("L2 network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.L2NetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("L2 network is up"), // InterfaceName: to.Ptr("eth0"), - // L2IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), + // L2IsolationDomainID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), // ProvisioningState: to.Ptr(armnetworkcloud.L2NetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // }, - // } + // }, + // } } diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/l3networks_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/l3networks_client.go index c0befe458bcc..aa0584f15104 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/l3networks_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/l3networks_client.go @@ -29,7 +29,7 @@ type L3NetworksClient struct { } // NewL3NetworksClient creates a new instance of L3NetworksClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewL3NetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*L3NetworksClient, error) { @@ -47,7 +47,7 @@ func NewL3NetworksClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Create a new layer 3 (L3) network or update the properties of the existing network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - l3NetworkName - The name of the L3 network. // - l3NetworkParameters - The request body. @@ -70,7 +70,7 @@ func (client *L3NetworksClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Create a new layer 3 (L3) network or update the properties of the existing network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *L3NetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, l3NetworkName string, l3NetworkParameters L3Network, options *L3NetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, l3NetworkName, l3NetworkParameters, options) if err != nil { @@ -89,9 +89,6 @@ func (client *L3NetworksClient) createOrUpdate(ctx context.Context, resourceGrou // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *L3NetworksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, l3NetworkName string, l3NetworkParameters L3Network, options *L3NetworksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" - 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") @@ -106,7 +103,7 @@ func (client *L3NetworksClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, l3NetworkParameters) @@ -115,7 +112,7 @@ func (client *L3NetworksClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Delete the provided layer 3 (L3) network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - l3NetworkName - The name of the L3 network. // - options - L3NetworksClientBeginDeleteOptions contains the optional parameters for the L3NetworksClient.BeginDelete method. @@ -136,7 +133,7 @@ func (client *L3NetworksClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete the provided layer 3 (L3) network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *L3NetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, l3NetworkName string, options *L3NetworksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, l3NetworkName, options) if err != nil { @@ -155,9 +152,6 @@ func (client *L3NetworksClient) deleteOperation(ctx context.Context, resourceGro // deleteCreateRequest creates the Delete request. func (client *L3NetworksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, l3NetworkName string, options *L3NetworksClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" - 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") @@ -172,7 +166,7 @@ func (client *L3NetworksClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +175,7 @@ func (client *L3NetworksClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get properties of the provided layer 3 (L3) network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - l3NetworkName - The name of the L3 network. // - options - L3NetworksClientGetOptions contains the optional parameters for the L3NetworksClient.Get method. @@ -203,9 +197,6 @@ func (client *L3NetworksClient) Get(ctx context.Context, resourceGroupName strin // getCreateRequest creates the Get request. func (client *L3NetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, l3NetworkName string, options *L3NetworksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" - 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") @@ -220,7 +211,7 @@ func (client *L3NetworksClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,7 +228,7 @@ func (client *L3NetworksClient) getHandleResponse(resp *http.Response) (L3Networ // NewListByResourceGroupPager - Get a list of layer 3 (L3) networks in the provided resource group. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - L3NetworksClientListByResourceGroupOptions contains the optional parameters for the L3NetworksClient.NewListByResourceGroupPager // method. @@ -272,9 +263,6 @@ func (client *L3NetworksClient) NewListByResourceGroupPager(resourceGroupName st // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *L3NetworksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *L3NetworksClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks" - 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") @@ -285,7 +273,7 @@ func (client *L3NetworksClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,7 +290,7 @@ func (client *L3NetworksClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - Get a list of layer 3 (L3) networks in the provided subscription. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - options - L3NetworksClientListBySubscriptionOptions contains the optional parameters for the L3NetworksClient.NewListBySubscriptionPager // method. func (client *L3NetworksClient) NewListBySubscriptionPager(options *L3NetworksClientListBySubscriptionOptions) *runtime.Pager[L3NetworksClientListBySubscriptionResponse] { @@ -336,16 +324,13 @@ func (client *L3NetworksClient) NewListBySubscriptionPager(options *L3NetworksCl // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *L3NetworksClient) listBySubscriptionCreateRequest(ctx context.Context, options *L3NetworksClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l3Networks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) 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", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -363,7 +348,7 @@ func (client *L3NetworksClient) listBySubscriptionHandleResponse(resp *http.Resp // Update - Update tags associated with the provided layer 3 (L3) network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - l3NetworkName - The name of the L3 network. // - l3NetworkUpdateParameters - The request body. @@ -386,9 +371,6 @@ func (client *L3NetworksClient) Update(ctx context.Context, resourceGroupName st // updateCreateRequest creates the Update request. func (client *L3NetworksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, l3NetworkName string, l3NetworkUpdateParameters L3NetworkPatchParameters, options *L3NetworksClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" - 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") @@ -403,7 +385,7 @@ func (client *L3NetworksClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, l3NetworkUpdateParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/l3networks_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/l3networks_client_example_test.go index 2aff4e3f2783..c3436e0ad80e 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/l3networks_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/l3networks_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/L3Networks_ListBySubscription.json func ExampleL3NetworksClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleL3NetworksClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("l3NetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/l3Networks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -60,33 +60,29 @@ func ExampleL3NetworksClient_NewListBySubscriptionPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.L3NetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.L3NetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("L3 network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksIpamEnabled: to.Ptr(armnetworkcloud.HybridAksIpamEnabledTrue), - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.L3NetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("L3 network is up"), // InterfaceName: to.Ptr("eth0"), // IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), // IPv4ConnectedPrefix: to.Ptr("198.51.100.0/24"), // IPv6ConnectedPrefix: to.Ptr("2001:db8::/64"), - // L3IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), + // L3IsolationDomainID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), // ProvisioningState: to.Ptr(armnetworkcloud.L3NetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // Vlan: to.Ptr[int64](12), - // }, - // }}, - // } + // Vlan: to.Ptr[int64](12), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/L3Networks_ListByResourceGroup.json func ExampleL3NetworksClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -113,7 +109,7 @@ func ExampleL3NetworksClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("l3NetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/l3Networks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -128,33 +124,29 @@ func ExampleL3NetworksClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.L3NetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.L3NetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("L3 network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksIpamEnabled: to.Ptr(armnetworkcloud.HybridAksIpamEnabledTrue), - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.L3NetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("L3 network is up"), // InterfaceName: to.Ptr("eth0"), // IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), // IPv4ConnectedPrefix: to.Ptr("198.51.100.0/24"), // IPv6ConnectedPrefix: to.Ptr("2001:db8::/64"), - // L3IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), + // L3IsolationDomainID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), // ProvisioningState: to.Ptr(armnetworkcloud.L3NetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // Vlan: to.Ptr[int64](12), - // }, - // }}, - // } + // Vlan: to.Ptr[int64](12), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/L3Networks_Get.json func ExampleL3NetworksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +167,7 @@ func ExampleL3NetworksClient_Get() { // res.L3Network = armnetworkcloud.L3Network{ // Name: to.Ptr("l3NetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/l3Networks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -190,31 +182,27 @@ func ExampleL3NetworksClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.L3NetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.L3NetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("L3 network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksIpamEnabled: to.Ptr(armnetworkcloud.HybridAksIpamEnabledTrue), - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.L3NetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("L3 network is up"), // InterfaceName: to.Ptr("eth0"), // IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), // IPv4ConnectedPrefix: to.Ptr("198.51.100.0/24"), // IPv6ConnectedPrefix: to.Ptr("2001:db8::/64"), - // L3IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), + // L3IsolationDomainID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), // ProvisioningState: to.Ptr(armnetworkcloud.L3NetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // Vlan: to.Ptr[int64](12), - // }, - // } + // Vlan: to.Ptr[int64](12), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/L3Networks_Create.json func ExampleL3NetworksClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -232,18 +220,16 @@ func ExampleL3NetworksClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.L3NetworkProperties{ - HybridAksIpamEnabled: to.Ptr(armnetworkcloud.HybridAksIpamEnabledTrue), - HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), - InterfaceName: to.Ptr("eth0"), - IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), - IPv4ConnectedPrefix: to.Ptr("198.51.100.0/24"), - IPv6ConnectedPrefix: to.Ptr("2001:db8::/64"), - L3IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), - Vlan: to.Ptr[int64](12), + InterfaceName: to.Ptr("eth0"), + IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), + IPv4ConnectedPrefix: to.Ptr("198.51.100.0/24"), + IPv6ConnectedPrefix: to.Ptr("2001:db8::/64"), + L3IsolationDomainID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), + Vlan: to.Ptr[int64](12), }, }, nil) if err != nil { @@ -259,7 +245,7 @@ func ExampleL3NetworksClient_BeginCreateOrUpdate() { // res.L3Network = armnetworkcloud.L3Network{ // Name: to.Ptr("l3NetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/l3Networks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -274,31 +260,27 @@ func ExampleL3NetworksClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.L3NetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.L3NetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("L3 network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksIpamEnabled: to.Ptr(armnetworkcloud.HybridAksIpamEnabledTrue), - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.L3NetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("L3 network is up"), // InterfaceName: to.Ptr("eth0"), // IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), // IPv4ConnectedPrefix: to.Ptr("198.51.100.0/24"), // IPv6ConnectedPrefix: to.Ptr("2001:db8::/64"), - // L3IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), + // L3IsolationDomainID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), // ProvisioningState: to.Ptr(armnetworkcloud.L3NetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // Vlan: to.Ptr[int64](12), - // }, - // } + // Vlan: to.Ptr[int64](12), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/L3Networks_Delete.json func ExampleL3NetworksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -319,7 +301,7 @@ func ExampleL3NetworksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/L3Networks_Patch.json func ExampleL3NetworksClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -345,7 +327,7 @@ func ExampleL3NetworksClient_Update() { // res.L3Network = armnetworkcloud.L3Network{ // Name: to.Ptr("l3NetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/l3Networks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -360,26 +342,22 @@ func ExampleL3NetworksClient_Update() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.L3NetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.L3NetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("L3 network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksIpamEnabled: to.Ptr(armnetworkcloud.HybridAksIpamEnabledTrue), - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.L3NetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("L3 network is up"), // InterfaceName: to.Ptr("eth0"), // IPAllocationType: to.Ptr(armnetworkcloud.IPAllocationTypeDualStack), // IPv4ConnectedPrefix: to.Ptr("198.51.100.0/24"), // IPv6ConnectedPrefix: to.Ptr("2001:db8::/64"), - // L3IsolationDomainID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), + // L3IsolationDomainID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName"), // ProvisioningState: to.Ptr(armnetworkcloud.L3NetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // Vlan: to.Ptr[int64](12), - // }, - // } + // Vlan: to.Ptr[int64](12), + // }, + // } } diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/metricsconfigurations_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/metricsconfigurations_client.go index 3eb5f42fecfb..51b403bc379a 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/metricsconfigurations_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/metricsconfigurations_client.go @@ -29,7 +29,7 @@ type MetricsConfigurationsClient struct { } // NewMetricsConfigurationsClient creates a new instance of MetricsConfigurationsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewMetricsConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MetricsConfigurationsClient, error) { @@ -44,10 +44,10 @@ func NewMetricsConfigurationsClient(subscriptionID string, credential azcore.Tok return client, nil } -// BeginCreateOrUpdate - Update the metrics configuration of the provided cluster. +// BeginCreateOrUpdate - Create new or update the existing metrics configuration of the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - metricsConfigurationName - The name of the metrics configuration for the cluster. @@ -68,10 +68,10 @@ func (client *MetricsConfigurationsClient) BeginCreateOrUpdate(ctx context.Conte } } -// CreateOrUpdate - Update the metrics configuration of the provided cluster. +// CreateOrUpdate - Create new or update the existing metrics configuration of the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *MetricsConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, metricsConfigurationName string, metricsConfigurationParameters ClusterMetricsConfiguration, options *MetricsConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationParameters, options) if err != nil { @@ -90,9 +90,6 @@ func (client *MetricsConfigurationsClient) createOrUpdate(ctx context.Context, r // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *MetricsConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, metricsConfigurationName string, metricsConfigurationParameters ClusterMetricsConfiguration, options *MetricsConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" - 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") @@ -111,7 +108,7 @@ func (client *MetricsConfigurationsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, metricsConfigurationParameters) @@ -120,7 +117,7 @@ func (client *MetricsConfigurationsClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Delete the metrics configuration of the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - metricsConfigurationName - The name of the metrics configuration for the cluster. @@ -143,7 +140,7 @@ func (client *MetricsConfigurationsClient) BeginDelete(ctx context.Context, reso // Delete - Delete the metrics configuration of the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *MetricsConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, metricsConfigurationName string, options *MetricsConfigurationsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, metricsConfigurationName, options) if err != nil { @@ -162,9 +159,6 @@ func (client *MetricsConfigurationsClient) deleteOperation(ctx context.Context, // deleteCreateRequest creates the Delete request. func (client *MetricsConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, metricsConfigurationName string, options *MetricsConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" - 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") @@ -183,7 +177,7 @@ func (client *MetricsConfigurationsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +186,7 @@ func (client *MetricsConfigurationsClient) deleteCreateRequest(ctx context.Conte // Get - Get metrics configuration of the provided cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - metricsConfigurationName - The name of the metrics configuration for the cluster. @@ -216,9 +210,6 @@ func (client *MetricsConfigurationsClient) Get(ctx context.Context, resourceGrou // getCreateRequest creates the Get request. func (client *MetricsConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, metricsConfigurationName string, options *MetricsConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" - 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") @@ -237,7 +228,7 @@ func (client *MetricsConfigurationsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,47 +243,44 @@ func (client *MetricsConfigurationsClient) getHandleResponse(resp *http.Response return result, nil } -// NewListByResourceGroupPager - Get a list of metrics configurations of the clusters in the provided resource group. +// NewListByClusterPager - Get a list of metrics configurations for the provided cluster. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. -// - options - MetricsConfigurationsClientListByResourceGroupOptions contains the optional parameters for the MetricsConfigurationsClient.NewListByResourceGroupPager +// - options - MetricsConfigurationsClientListByClusterOptions contains the optional parameters for the MetricsConfigurationsClient.NewListByClusterPager // method. -func (client *MetricsConfigurationsClient) NewListByResourceGroupPager(resourceGroupName string, clusterName string, options *MetricsConfigurationsClientListByResourceGroupOptions) *runtime.Pager[MetricsConfigurationsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[MetricsConfigurationsClientListByResourceGroupResponse]{ - More: func(page MetricsConfigurationsClientListByResourceGroupResponse) bool { +func (client *MetricsConfigurationsClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *MetricsConfigurationsClientListByClusterOptions) *runtime.Pager[MetricsConfigurationsClientListByClusterResponse] { + return runtime.NewPager(runtime.PagingHandler[MetricsConfigurationsClientListByClusterResponse]{ + More: func(page MetricsConfigurationsClientListByClusterResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *MetricsConfigurationsClientListByResourceGroupResponse) (MetricsConfigurationsClientListByResourceGroupResponse, error) { + Fetcher: func(ctx context.Context, page *MetricsConfigurationsClientListByClusterResponse) (MetricsConfigurationsClientListByClusterResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, clusterName, options) + req, err = client.listByClusterCreateRequest(ctx, resourceGroupName, clusterName, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return MetricsConfigurationsClientListByResourceGroupResponse{}, err + return MetricsConfigurationsClientListByClusterResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return MetricsConfigurationsClientListByResourceGroupResponse{}, err + return MetricsConfigurationsClientListByClusterResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return MetricsConfigurationsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + return MetricsConfigurationsClientListByClusterResponse{}, runtime.NewResponseError(resp) } - return client.listByResourceGroupHandleResponse(resp) + return client.listByClusterHandleResponse(resp) }, }) } -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *MetricsConfigurationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *MetricsConfigurationsClientListByResourceGroupOptions) (*policy.Request, error) { +// listByClusterCreateRequest creates the ListByCluster request. +func (client *MetricsConfigurationsClient) listByClusterCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *MetricsConfigurationsClientListByClusterOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations" - 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") @@ -307,17 +295,17 @@ func (client *MetricsConfigurationsClient) listByResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *MetricsConfigurationsClient) listByResourceGroupHandleResponse(resp *http.Response) (MetricsConfigurationsClientListByResourceGroupResponse, error) { - result := MetricsConfigurationsClientListByResourceGroupResponse{} +// listByClusterHandleResponse handles the ListByCluster response. +func (client *MetricsConfigurationsClient) listByClusterHandleResponse(resp *http.Response) (MetricsConfigurationsClientListByClusterResponse, error) { + result := MetricsConfigurationsClientListByClusterResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ClusterMetricsConfigurationList); err != nil { - return MetricsConfigurationsClientListByResourceGroupResponse{}, err + return MetricsConfigurationsClientListByClusterResponse{}, err } return result, nil } @@ -326,7 +314,7 @@ func (client *MetricsConfigurationsClient) listByResourceGroupHandleResponse(res // Properties and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - metricsConfigurationName - The name of the metrics configuration for the cluster. @@ -340,7 +328,7 @@ func (client *MetricsConfigurationsClient) BeginUpdate(ctx context.Context, reso return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MetricsConfigurationsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { return runtime.NewPollerFromResumeToken[MetricsConfigurationsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -351,7 +339,7 @@ func (client *MetricsConfigurationsClient) BeginUpdate(ctx context.Context, reso // and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *MetricsConfigurationsClient) update(ctx context.Context, resourceGroupName string, clusterName string, metricsConfigurationName string, metricsConfigurationUpdateParameters ClusterMetricsConfigurationPatchParameters, options *MetricsConfigurationsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationUpdateParameters, options) if err != nil { @@ -370,9 +358,6 @@ func (client *MetricsConfigurationsClient) update(ctx context.Context, resourceG // updateCreateRequest creates the Update request. func (client *MetricsConfigurationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, metricsConfigurationName string, metricsConfigurationUpdateParameters ClusterMetricsConfigurationPatchParameters, options *MetricsConfigurationsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" - 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") @@ -391,7 +376,7 @@ func (client *MetricsConfigurationsClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, metricsConfigurationUpdateParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/metricsconfigurations_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/metricsconfigurations_client_example_test.go index c9b552e13eac..6cfeb1a41884 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/metricsconfigurations_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/metricsconfigurations_client_example_test.go @@ -18,8 +18,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_ListByResourceGroup.json -func ExampleMetricsConfigurationsClient_NewListByResourceGroupPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/ClusterMetricsConfigurations_ListByCluster.json +func ExampleMetricsConfigurationsClient_NewListByClusterPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -29,7 +29,7 @@ func ExampleMetricsConfigurationsClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewMetricsConfigurationsClient().NewListByResourceGroupPager("resourceGroupName", "clusterName", nil) + pager := clientFactory.NewMetricsConfigurationsClient().NewListByClusterPager("resourceGroupName", "clusterName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -45,7 +45,7 @@ func ExampleMetricsConfigurationsClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters/metricsConfigurations"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/metricsConfigurations/default"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/metricsConfigurations/default"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -60,7 +60,7 @@ func ExampleMetricsConfigurationsClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ClusterMetricsConfigurationProperties{ @@ -80,7 +80,7 @@ func ExampleMetricsConfigurationsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/ClusterMetricsConfigurations_Get.json func ExampleMetricsConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,7 +101,7 @@ func ExampleMetricsConfigurationsClient_Get() { // res.ClusterMetricsConfiguration = armnetworkcloud.ClusterMetricsConfiguration{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters/metricsConfigurations"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/metricsConfigurations/default"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/metricsConfigurations/default"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -116,7 +116,7 @@ func ExampleMetricsConfigurationsClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ClusterMetricsConfigurationProperties{ @@ -134,7 +134,7 @@ func ExampleMetricsConfigurationsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/ClusterMetricsConfigurations_Create.json func ExampleMetricsConfigurationsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -152,7 +152,7 @@ func ExampleMetricsConfigurationsClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.ClusterMetricsConfigurationProperties{ @@ -175,7 +175,7 @@ func ExampleMetricsConfigurationsClient_BeginCreateOrUpdate() { // res.ClusterMetricsConfiguration = armnetworkcloud.ClusterMetricsConfiguration{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters/metricsConfigurations"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/metricsConfigurations/default"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/metricsConfigurations/default"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -190,7 +190,7 @@ func ExampleMetricsConfigurationsClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ClusterMetricsConfigurationProperties{ @@ -208,7 +208,7 @@ func ExampleMetricsConfigurationsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/ClusterMetricsConfigurations_Delete.json func ExampleMetricsConfigurationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -229,7 +229,7 @@ func ExampleMetricsConfigurationsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/ClusterMetricsConfigurations_Patch.json func ExampleMetricsConfigurationsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -265,7 +265,7 @@ func ExampleMetricsConfigurationsClient_BeginUpdate() { // res.ClusterMetricsConfiguration = armnetworkcloud.ClusterMetricsConfiguration{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.NetworkCloud/clusters/metricsConfigurations"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/metricsConfigurations/default"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName/metricsConfigurations/default"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -280,7 +280,7 @@ func ExampleMetricsConfigurationsClient_BeginUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.ClusterMetricsConfigurationProperties{ diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/models.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/models.go index ffd1fac10464..9dee5306b406 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/models.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/models.go @@ -11,6 +11,12 @@ package armnetworkcloud import "time" +// AADConfiguration - AadConfiguration represents the Azure Active Directory Integration properties. +type AADConfiguration struct { + // REQUIRED; The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. + AdminGroupObjectIDs []*string +} + // AdministrativeCredentials represents the admin credentials for the device requiring password-based authentication. type AdministrativeCredentials struct { // REQUIRED; The password of the administrator of the device used during initialization. @@ -20,6 +26,189 @@ type AdministrativeCredentials struct { Username *string } +// AdministratorConfiguration represents the administrative credentials that will be applied to the control plane and agent +// pool nodes in Kubernetes clusters. +type AdministratorConfiguration struct { + // The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + // a user name will be chosen by the service. + AdminUsername *string + + // The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + // of public keys may be required to produce a working environment. + SSHPublicKeys []*SSHPublicKey +} + +// AgentOptions are configurations that will be applied to each agent in an agent pool. +type AgentOptions struct { + // REQUIRED; The number of hugepages to allocate. + HugepagesCount *int64 + + // The size of the hugepages to allocate. + HugepagesSize *HugepagesSize +} + +// AgentPool represents the agent pool of Kubernetes cluster. +type AgentPool struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; The list of the resource properties. + Properties *AgentPoolProperties + + // The extended location of the cluster associated with the resource. + ExtendedLocation *ExtendedLocation + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // 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 +} + +// AgentPoolList represents a list of Kubernetes cluster agent pools. +type AgentPoolList struct { + // The link used to get the next page of operations. + NextLink *string + + // The list of agent pools. + Value []*AgentPool +} + +// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. +type AgentPoolPatchParameters struct { + // The list of the resource properties. + Properties *AgentPoolPatchProperties + + // The Azure resource tags that will replace the existing ones. + Tags map[string]*string +} + +// AgentPoolPatchProperties represents the properties of an agent pool that can be modified. +type AgentPoolPatchProperties struct { + // The number of virtual machines that use this configuration. + Count *int64 + + // The configuration of the agent pool. + UpgradeSettings *AgentPoolUpgradeSettings +} + +// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. +type AgentPoolProperties struct { + // REQUIRED; The number of virtual machines that use this configuration. + Count *int64 + + // REQUIRED; The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the + // features and critical services for the Kubernetes Cluster, while user pools are dedicated + // to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. + Mode *AgentPoolMode + + // REQUIRED; The name of the VM SKU that determines the size of resources allocated for node VMs. + VMSKUName *string + + // The administrator credentials to be used for the nodes in this agent pool. + AdministratorConfiguration *AdministratorConfiguration + + // The configurations that will be applied to each agent in this agent pool. + AgentOptions *AgentOptions + + // The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. + AttachedNetworkConfiguration *AttachedNetworkConfiguration + + // The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not + // specified, all availability zones will be used. + AvailabilityZones []*string + + // The labels applied to the nodes in this agent pool. + Labels []*KubernetesLabel + + // The taints applied to the nodes in this agent pool. + Taints []*KubernetesLabel + + // The configuration of the agent pool. + UpgradeSettings *AgentPoolUpgradeSettings + + // READ-ONLY; The current status of the agent pool. + DetailedStatus *AgentPoolDetailedStatus + + // READ-ONLY; The descriptive message about the current detailed status. + DetailedStatusMessage *string + + // READ-ONLY; The Kubernetes version running in this agent pool. + KubernetesVersion *string + + // READ-ONLY; The provisioning state of the agent pool. + ProvisioningState *AgentPoolProvisioningState +} + +// AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. +type AgentPoolUpgradeSettings struct { + // The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + // or a percentage (e.g. '50%'). If a percentage is specified, it is the + // percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If + // not specified, the default is 1. + MaxSurge *string +} + +// AgentPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginCreateOrUpdate +// method. +type AgentPoolsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method. +type AgentPoolsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AgentPoolsClientBeginUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginUpdate method. +type AgentPoolsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AgentPoolsClientGetOptions contains the optional parameters for the AgentPoolsClient.Get method. +type AgentPoolsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AgentPoolsClientListByKubernetesClusterOptions contains the optional parameters for the AgentPoolsClient.NewListByKubernetesClusterPager +// method. +type AgentPoolsClientListByKubernetesClusterOptions struct { + // placeholder for future optional parameters +} + +// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. +type AttachedNetworkConfiguration struct { + // The list of Layer 2 Networks and related configuration for attachment. + L2Networks []*L2NetworkAttachmentConfiguration + + // The list of Layer 3 Networks and related configuration for attachment. + L3Networks []*L3NetworkAttachmentConfiguration + + // The list of Trunked Networks and related configuration for attachment. + TrunkedNetworks []*TrunkedNetworkAttachmentConfiguration +} + +// AvailableUpgrade represents an upgrade available for a Kubernetes cluster. +type AvailableUpgrade struct { + // READ-ONLY; The version lifecycle indicator. + AvailabilityLifecycle *AvailabilityLifecycle + + // READ-ONLY; The version available for upgrading. + Version *string +} + // BareMetalMachine represents the physical machine in the rack. type BareMetalMachine struct { // REQUIRED; The extended location of the cluster associated with the resource. @@ -34,7 +223,7 @@ type BareMetalMachine struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -104,7 +293,7 @@ type BareMetalMachineKeySet struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -211,9 +400,9 @@ type BareMetalMachineKeySetsClientGetOptions struct { // placeholder for future optional parameters } -// BareMetalMachineKeySetsClientListByResourceGroupOptions contains the optional parameters for the BareMetalMachineKeySetsClient.NewListByResourceGroupPager +// BareMetalMachineKeySetsClientListByClusterOptions contains the optional parameters for the BareMetalMachineKeySetsClient.NewListByClusterPager // method. -type BareMetalMachineKeySetsClientListByResourceGroupOptions struct { +type BareMetalMachineKeySetsClientListByClusterOptions struct { // placeholder for future optional parameters } @@ -281,6 +470,9 @@ type BareMetalMachineProperties struct { // REQUIRED; The serial number of the bare metal machine. SerialNumber *string + // READ-ONLY; The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + AssociatedResourceIDs []*string + // READ-ONLY; The resource ID of the cluster this bare metal machine is associated with. ClusterID *string @@ -299,7 +491,8 @@ type BareMetalMachineProperties struct { // READ-ONLY; The details of the latest hardware validation performed for this bare metal machine. HardwareValidationStatus *HardwareValidationStatus - // READ-ONLY; The list of the resource IDs for the HybridAksClusters that have nodes hosted on this bare metal machine. + // READ-ONLY; Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters + // that have nodes hosted on this bare metal machine. HybridAksClustersAssociatedIDs []*string // READ-ONLY; The name of this machine represented by the host object in the Cluster's Kubernetes control plane. @@ -329,7 +522,8 @@ type BareMetalMachineProperties struct { // READ-ONLY; The discovered value of the machine's service tag. ServiceTag *string - // READ-ONLY; The list of the resource IDs for the VirtualMachines that are hosted on this bare metal machine. + // READ-ONLY; Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that + // are hosted on this bare metal machine. VirtualMachinesAssociatedIDs []*string } @@ -516,18 +710,37 @@ type BareMetalMachinesClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// BgpPeer represents the IP address and ASN(Autonomous System Number) to peer with Hybrid AKS cluster. -type BgpPeer struct { - // REQUIRED; The ASN (Autonomous System Number) of the BGP peer. - AsNumber *int64 +// BgpAdvertisement represents the association of IP address pools to the communities and peers. +type BgpAdvertisement struct { + // REQUIRED; The names of the IP address pools associated with this announcement. + IPAddressPools []*string - // REQUIRED; The IPv4 or IPv6 address to peer with the associated CNI Network. The IP version type will drive a peering with - // the same version type from the Default CNI Network. For example, IPv4 to IPv4 or IPv6 to - // IPv6. - PeerIP *string + // The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This + // field is ignored if fabricPeeringEnabled is set to False. + AdvertiseToFabric *AdvertiseToFabric - // The password for this peering neighbor. It defaults to no password if not specified. - Password *string + // The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 + // format. + Communities []*string + + // The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this + // advertisement. + Peers []*string +} + +// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. +type BgpServiceLoadBalancerConfiguration struct { + // The association of IP address pools to the communities and peers, allowing for announcement of IPs. + BgpAdvertisements []*BgpAdvertisement + + // The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + BgpPeers []*ServiceLoadBalancerBgpPeer + + // The indicator to specify if the load balancer peers with the network fabric. + FabricPeeringEnabled *FabricPeeringEnabled + + // The list of pools of IP addresses that can be allocated to Load Balancer services. + IPAddressPools []*IPAddressPool } // BmcKeySet represents the baseboard management controller key set. @@ -544,7 +757,7 @@ type BmcKeySet struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -639,9 +852,8 @@ type BmcKeySetsClientGetOptions struct { // placeholder for future optional parameters } -// BmcKeySetsClientListByResourceGroupOptions contains the optional parameters for the BmcKeySetsClient.NewListByResourceGroupPager -// method. -type BmcKeySetsClientListByResourceGroupOptions struct { +// BmcKeySetsClientListByClusterOptions contains the optional parameters for the BmcKeySetsClient.NewListByClusterPager method. +type BmcKeySetsClientListByClusterOptions struct { // placeholder for future optional parameters } @@ -662,7 +874,7 @@ type CloudServicesNetwork struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -711,6 +923,9 @@ type CloudServicesNetworkProperties struct { // The indicator of whether the platform default endpoints are allowed for the egress traffic. EnableDefaultEgressEndpoints *CloudServicesNetworkEnableDefaultEgressEndpoints + // READ-ONLY; The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + AssociatedResourceIDs []*string + // READ-ONLY; The resource ID of the Network Cloud cluster this cloud services network is associated with. ClusterID *string @@ -723,7 +938,8 @@ type CloudServicesNetworkProperties struct { // READ-ONLY; The full list of additional and default egress endpoints that are currently enabled. EnabledEgressEndpoints []*EgressEndpoint - // READ-ONLY; The list of Hybrid AKS cluster resource IDs that are associated with this cloud services network. + // READ-ONLY; Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + // with this cloud services network. HybridAksClustersAssociatedIDs []*string // READ-ONLY; The name of the interface that will be present in the virtual machine to represent this network. @@ -732,8 +948,8 @@ type CloudServicesNetworkProperties struct { // READ-ONLY; The provisioning state of the cloud services network. ProvisioningState *CloudServicesNetworkProvisioningState - // READ-ONLY; The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using - // this cloud services network. + // READ-ONLY; Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any + // Hybrid AKS virtual machines, that are currently using this cloud services network. VirtualMachinesAssociatedIDs []*string } @@ -789,7 +1005,7 @@ type Cluster struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -885,7 +1101,7 @@ type ClusterManager struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -1001,7 +1217,7 @@ type ClusterMetricsConfiguration struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -1096,9 +1312,6 @@ type ClusterProperties struct { // rack in a multi-rack cluster. AggregatorOrSingleRackDefinition *RackDefinition - // REQUIRED; The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. - AnalyticsWorkspaceID *string - // REQUIRED; The type of rack configuration for the cluster. ClusterType *ClusterType @@ -1108,6 +1321,9 @@ type ClusterProperties struct { // REQUIRED; The resource ID of the Network Fabric associated with the cluster. NetworkFabricID *string + // The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. + AnalyticsWorkspaceID *string + // The customer-provided location information to identify where the cluster resides. ClusterLocation *string @@ -1150,8 +1366,9 @@ type ClusterProperties struct { // READ-ONLY; The descriptive message about the detailed status. DetailedStatusMessage *string - // READ-ONLY; The extended location (custom location) that represents the Hybrid AKS control plane location. This extended - // location is used when creating provisioned clusters (Hybrid AKS clusters). + // READ-ONLY; Field Deprecated. This field will not be populated in an upcoming version. The extended location (custom location) + // that represents the Hybrid AKS control plane location. This extended location is used + // when creating provisioned clusters (Hybrid AKS clusters). HybridAksExtendedLocation *ExtendedLocation // READ-ONLY; The count of Manual Action Taken (MAT) events that have not been validated. @@ -1222,36 +1439,6 @@ type ClustersClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// CniBgpConfiguration represents the Calico BGP configuration. -type CniBgpConfiguration struct { - // The list of BgpPeer entities that the Hybrid AKS cluster will peer with in addition to peering that occurs automatically - // with the switch fabric. - BgpPeers []*BgpPeer - - // The list of prefix community advertisement properties. Each prefix community specifies a prefix, and the communities that - // should be associated with that prefix when it is announced. - CommunityAdvertisements []*CommunityAdvertisement - - // The password of the Calico node mesh. It defaults to a randomly-generated string when not provided. - NodeMeshPassword *string - - // The subnet blocks in CIDR format for Kubernetes service external IPs to be advertised over BGP. - ServiceExternalPrefixes []*string - - // The subnet blocks in CIDR format for Kubernetes load balancers. Load balancer IPs will only be advertised if they are within - // one of these blocks. - ServiceLoadBalancerPrefixes []*string -} - -// CommunityAdvertisement represents the prefix and the communities that should be associated with that prefix. -type CommunityAdvertisement struct { - // REQUIRED; The list of community strings to announce with this prefix. - Communities []*string - - // REQUIRED; The subnet in CIDR format for which properties should be advertised. - SubnetPrefix *string -} - // Console represents the console of an on-premises Network Cloud virtual machine. type Console struct { // REQUIRED; The extended location of the cluster manager associated with the cluster this virtual machine is created on. @@ -1266,7 +1453,7 @@ type Console struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -1361,136 +1548,34 @@ type ConsolesClientGetOptions struct { // placeholder for future optional parameters } -// ConsolesClientListByResourceGroupOptions contains the optional parameters for the ConsolesClient.NewListByResourceGroupPager +// ConsolesClientListByVirtualMachineOptions contains the optional parameters for the ConsolesClient.NewListByVirtualMachinePager // method. -type ConsolesClientListByResourceGroupOptions struct { +type ConsolesClientListByVirtualMachineOptions struct { // placeholder for future optional parameters } -// DefaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created in support of a -// Hybrid AKS Cluster. -type DefaultCniNetwork struct { - // REQUIRED; The extended location of the cluster associated with the resource. - ExtendedLocation *ExtendedLocation - - // REQUIRED; The geo-location where the resource lives - Location *string - - // REQUIRED; The list of the resource properties. - Properties *DefaultCniNetworkProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // 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 -} - -// DefaultCniNetworkList represents a list of default CNI networks. -type DefaultCniNetworkList struct { - // The link used to get the next page of operations. - NextLink *string - - // The list of default CNI networks. - Value []*DefaultCniNetwork -} - -// DefaultCniNetworkPatchParameters represents the body of the request to patch the Default CNI network. -type DefaultCniNetworkPatchParameters struct { - // The Azure resource tags that will replace the existing ones. - Tags map[string]*string -} +// ControlPlaneNodeConfiguration represents the selection of virtual machines and size of the control plane for a Kubernetes +// cluster. +type ControlPlaneNodeConfiguration struct { + // REQUIRED; The number of virtual machines that use this configuration. + Count *int64 -// DefaultCniNetworkProperties represents properties of the default CNI network. -type DefaultCniNetworkProperties struct { - // REQUIRED; The resource ID of the Network Fabric l3IsolationDomain. - L3IsolationDomainID *string - - // REQUIRED; The VLAN from the l3IsolationDomain that is used for this network. - Vlan *int64 + // REQUIRED; The name of the VM SKU supplied during creation. + VMSKUName *string - // The Calico BGP configuration. - CniBgpConfiguration *CniBgpConfiguration + // The administrator credentials to be used for the nodes in the control plane. + AdministratorConfiguration *AdministratorConfiguration - // The type of the IP address allocation. - IPAllocationType *IPAllocationType - - // The IPV4 prefix (CIDR) assigned to this default CNI network. It is required when the IP allocation type is IPV4 or DualStack. - IPv4ConnectedPrefix *string - - // The IPV6 prefix (CIDR) assigned to this default CNI network. It is required when the IP allocation type is IPV6 or DualStack. - IPv6ConnectedPrefix *string - - // READ-ONLY; The resource ID of the Network Cloud cluster this default CNI network is associated with. - ClusterID *string - - // READ-ONLY; The autonomous system number that the fabric expects to peer with, derived from the associated L3 isolation - // domain. - CniAsNumber *int64 - - // READ-ONLY; The more detailed status of the default CNI network. - DetailedStatus *DefaultCniNetworkDetailedStatus - - // READ-ONLY; The descriptive message about the current detailed status. - DetailedStatusMessage *string - - // READ-ONLY; The L3 isolation fabric BGP peering connectivity information necessary for BGP peering the Hybrid AKS Cluster - // with the switch fabric. - FabricBgpPeers []*BgpPeer - - // READ-ONLY; The list of Hybrid AKS cluster resource ID(s) that are associated with this default CNI network. - HybridAksClustersAssociatedIDs []*string - - // READ-ONLY; The name of the interface that will be present in the virtual machine to represent this network. - InterfaceName *string - - // READ-ONLY; The provisioning state of the default CNI network. - ProvisioningState *DefaultCniNetworkProvisioningState -} - -// DefaultCniNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the DefaultCniNetworksClient.BeginCreateOrUpdate -// method. -type DefaultCniNetworksClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DefaultCniNetworksClientBeginDeleteOptions contains the optional parameters for the DefaultCniNetworksClient.BeginDelete -// method. -type DefaultCniNetworksClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DefaultCniNetworksClientGetOptions contains the optional parameters for the DefaultCniNetworksClient.Get method. -type DefaultCniNetworksClientGetOptions struct { - // placeholder for future optional parameters -} - -// DefaultCniNetworksClientListByResourceGroupOptions contains the optional parameters for the DefaultCniNetworksClient.NewListByResourceGroupPager -// method. -type DefaultCniNetworksClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DefaultCniNetworksClientListBySubscriptionOptions contains the optional parameters for the DefaultCniNetworksClient.NewListBySubscriptionPager -// method. -type DefaultCniNetworksClientListBySubscriptionOptions struct { - // placeholder for future optional parameters + // The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. + // If not specified, all availability zones will be used. + AvailabilityZones []*string } -// DefaultCniNetworksClientUpdateOptions contains the optional parameters for the DefaultCniNetworksClient.Update method. -type DefaultCniNetworksClientUpdateOptions struct { - // placeholder for future optional parameters +// ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this Kubernetes +// cluster. +type ControlPlaneNodePatchConfiguration struct { + // The number of virtual machines that use this configuration. + Count *int64 } // EgressEndpoint represents the connection from a cloud services network to the specified endpoint for a common purpose. @@ -1522,6 +1607,21 @@ type ExtendedLocation struct { Type *string } +// FeatureStatus contains information regarding a Kubernetes cluster feature. +type FeatureStatus struct { + // READ-ONLY; The status representing the state of this feature. + DetailedStatus *FeatureDetailedStatus + + // READ-ONLY; The descriptive message about the current detailed status. + DetailedStatusMessage *string + + // READ-ONLY; The name of the feature. + Name *string + + // READ-ONLY; The version of the feature. + Version *string +} + // HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including information // acquired from the model/sku information and from the ironic inspector. type HardwareInventory struct { @@ -1562,8 +1662,102 @@ type HardwareValidationStatus struct { Result *BareMetalMachineHardwareValidationResult } -// HybridAksCluster - The details are specific to the Network Cloud use of the Hybrid AKS cluster. -type HybridAksCluster struct { +// IPAddressPool - IpAddressPool represents a pool of IP addresses that can be allocated to a service. +type IPAddressPool struct { + // REQUIRED; The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range + // of IP addresses. + Addresses []*string + + // REQUIRED; The name used to identify this IP address pool for association with a BGP advertisement. + Name *string + + // The indicator to determine if automatic allocation from the pool should occur. + AutoAssign *BfdEnabled + + // The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only + // use IP addresses between .1 and .254 inclusive. + OnlyUseHostIPs *BfdEnabled +} + +// ImageRepositoryCredentials represents the credentials used to login to the image repository. +type ImageRepositoryCredentials struct { + // REQUIRED; The password or token used to access an image in the target repository. + Password *string + + // REQUIRED; The URL of the authentication server used to validate the repository credentials. + RegistryURL *string + + // REQUIRED; The username used to access an image in the target repository. + Username *string +} + +// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with +// a Kubernetes cluster. +type InitialAgentPoolConfiguration struct { + // REQUIRED; The number of virtual machines that use this configuration. + Count *int64 + + // REQUIRED; The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the + // features and critical services for the Kubernetes Cluster, while user pools are dedicated + // to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. + Mode *AgentPoolMode + + // REQUIRED; The name that will be used for the agent pool resource representing this agent pool. + Name *string + + // REQUIRED; The name of the VM SKU that determines the size of resources allocated for node VMs. + VMSKUName *string + + // The administrator credentials to be used for the nodes in this agent pool. + AdministratorConfiguration *AdministratorConfiguration + + // The configurations that will be applied to each agent in this agent pool. + AgentOptions *AgentOptions + + // The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. + AttachedNetworkConfiguration *AttachedNetworkConfiguration + + // The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not + // specified, all availability zones will be used. + AvailabilityZones []*string + + // The labels applied to the nodes in this agent pool. + Labels []*KubernetesLabel + + // The taints applied to the nodes in this agent pool. + Taints []*KubernetesLabel + + // The configuration of the agent pool. + UpgradeSettings *AgentPoolUpgradeSettings +} + +// KeySetUser represents the properties of the user in the key set. +type KeySetUser struct { + // REQUIRED; The user name that will be used for access. + AzureUserName *string + + // REQUIRED; The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH + // private key for logging in. + SSHPublicKey *SSHPublicKey + + // The free-form description for this user. + Description *string +} + +// KeySetUserStatus represents the status of the key set user. +type KeySetUserStatus struct { + // READ-ONLY; The user name that will be used for access. + AzureUserName *string + + // READ-ONLY; The indicator of whether the user is currently deployed for access. + Status *BareMetalMachineKeySetUserSetupStatus + + // READ-ONLY; The additional information describing the current status of this user, if any available. + StatusMessage *string +} + +// KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. +type KubernetesCluster struct { // REQUIRED; The extended location of the cluster associated with the resource. ExtendedLocation *ExtendedLocation @@ -1571,12 +1765,12 @@ type HybridAksCluster struct { Location *string // REQUIRED; The list of the resource properties. - Properties *HybridAksClusterProperties + Properties *KubernetesClusterProperties // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -1589,150 +1783,210 @@ type HybridAksCluster struct { Type *string } -// HybridAksClusterList represents a list of Hybrid AKS clusters. -type HybridAksClusterList struct { +// KubernetesClusterList represents a list of Kubernetes clusters. +type KubernetesClusterList struct { // The link used to get the next page of operations. NextLink *string - // The list of additional details related to Hybrid AKS clusters. - Value []*HybridAksCluster + // The list of additional details related to Kubernetes clusters. + Value []*KubernetesCluster } -// HybridAksClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. -type HybridAksClusterPatchParameters struct { +// KubernetesClusterNode represents the details of a node in a Kubernetes cluster. +type KubernetesClusterNode struct { + // READ-ONLY; The resource ID of the agent pool that this node belongs to. This value is not represented on control plane + // nodes. + AgentPoolID *string + + // READ-ONLY; The availability zone this node is running within. + AvailabilityZone *string + + // READ-ONLY; The resource ID of the bare metal machine that hosts this node. + BareMetalMachineID *string + + // READ-ONLY; The number of CPU cores configured for this node, derived from the VM SKU specified. + CPUCores *int64 + + // READ-ONLY; The detailed state of this node. + DetailedStatus *KubernetesClusterNodeDetailedStatus + + // READ-ONLY; The descriptive message about the current detailed status. + DetailedStatusMessage *string + + // READ-ONLY; The size of the disk configured for this node. + DiskSizeGB *int64 + + // READ-ONLY; The machine image used to deploy this node. + Image *string + + // READ-ONLY; The currently running version of Kubernetes and bundled features running on this node. + KubernetesVersion *string + + // READ-ONLY; The list of labels on this node that have been assigned to the agent pool containing this node. + Labels []*KubernetesLabel + + // READ-ONLY; The amount of memory configured for this node, derived from the vm SKU specified. + MemorySizeGB *int64 + + // READ-ONLY; The mode of the agent pool containing this node. Not applicable for control plane nodes. + Mode *AgentPoolMode + + // READ-ONLY; The name of this node, as realized in the Kubernetes cluster. + Name *string + + // READ-ONLY; The NetworkAttachments made to this node. + NetworkAttachments []*NetworkAttachment + + // READ-ONLY; The power state of this node. + PowerState *KubernetesNodePowerState + + // READ-ONLY; The role of this node in the cluster. + Role *KubernetesNodeRole + + // READ-ONLY; The list of taints that have been assigned to the agent pool containing this node. + Taints []*KubernetesLabel + + // READ-ONLY; The VM SKU name that was used to create this cluster node. + VMSKUName *string +} + +// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. +type KubernetesClusterPatchParameters struct { + // The list of the resource properties. + Properties *KubernetesClusterPatchProperties + // The Azure resource tags that will replace the existing ones. Tags map[string]*string } -// HybridAksClusterProperties represents the properties of Hybrid AKS cluster resource. -type HybridAksClusterProperties struct { - // REQUIRED; The list of resource IDs for the workload networks associated with the Hybrid AKS cluster. It can be any of l2Networks, - // l3Networks, or trunkedNetworks resources. This field will also contain one - // cloudServicesNetwork and one defaultCniNetwork. - AssociatedNetworkIDs []*string +// KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. +type KubernetesClusterPatchProperties struct { + // The defining characteristics of the control plane that can be patched for this Kubernetes cluster. + ControlPlaneNodeConfiguration *ControlPlaneNodePatchConfiguration + + // The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n format. The interpreted version used will be resolved + // into this field after creation or update. + KubernetesVersion *string +} - // REQUIRED; The number of control plane node VMs. - ControlPlaneCount *int64 +// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. +type KubernetesClusterProperties struct { + // REQUIRED; The defining characteristics of the control plane for this Kubernetes Cluster. + ControlPlaneNodeConfiguration *ControlPlaneNodeConfiguration - // REQUIRED; The resource ID of the Hybrid AKS cluster that this additional information is for. - HybridAksProvisionedClusterID *string + // REQUIRED; The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. + // This data in this field is only used during creation, and the field will be empty + // following the creation of the Kubernetes Cluster. After creation, the management of agent pools is done using the agentPools + // sub-resource. + InitialAgentPoolConfigurations []*InitialAgentPoolConfiguration - // REQUIRED; The number of worker node VMs. - WorkerCount *int64 + // REQUIRED; The Kubernetes version for this cluster. Accepts n.n, n.n.n, and n.n.n-n format. The interpreted version used + // will be resolved into this field after creation or update. + KubernetesVersion *string - // READ-ONLY; The resource ID of the associated cloud services network. - CloudServicesNetworkID *string + // REQUIRED; The configuration of the Kubernetes cluster networking, including the attachment of networks that span the cluster. + NetworkConfiguration *NetworkConfiguration - // READ-ONLY; The resource ID of the Network Cloud cluster hosting the Hybrid AKS cluster. + // The Azure Active Directory Integration properties. + AADConfiguration *AADConfiguration + + // The administrative credentials that will be applied to the control plane and agent pool nodes that do not specify their + // own values. + AdministratorConfiguration *AdministratorConfiguration + + // The configuration of the managed resource group associated with the resource. + ManagedResourceGroupConfiguration *ManagedResourceGroupConfiguration + + // READ-ONLY; The full list of network resource IDs that are attached to this cluster, including those attached only to specific + // agent pools. + AttachedNetworkIDs []*string + + // READ-ONLY; The list of versions that this Kubernetes cluster can be upgraded to. + AvailableUpgrades []*AvailableUpgrade + + // READ-ONLY; The resource ID of the Network Cloud cluster. ClusterID *string - // READ-ONLY; The list of node configurations detailing associated VMs that are part of the control plane nodes of this Hybrid - // AKS cluster. - ControlPlaneNodes []*NodeConfiguration + // READ-ONLY; The resource ID of the connected cluster set up when this Kubernetes cluster is created. + ConnectedClusterID *string - // READ-ONLY; The resource ID of the associated default CNI network. - DefaultCniNetworkID *string + // READ-ONLY; The current running version of Kubernetes on the control plane. + ControlPlaneKubernetesVersion *string - // READ-ONLY; The more detailed status of this Hybrid AKS cluster. - DetailedStatus *HybridAksClusterDetailedStatus + // READ-ONLY; The current status of the Kubernetes cluster. + DetailedStatus *KubernetesClusterDetailedStatus // READ-ONLY; The descriptive message about the current detailed status. DetailedStatusMessage *string - // READ-ONLY; The provisioning state of the Hybrid AKS cluster resource. - ProvisioningState *HybridAksClusterProvisioningState + // READ-ONLY; The current feature settings. + FeatureStatuses []*FeatureStatus - // READ-ONLY; The resource IDs of volumes that are attached to the Hybrid AKS cluster. - Volumes []*string + // READ-ONLY; The details of the nodes in this cluster. + Nodes []*KubernetesClusterNode - // READ-ONLY; The list of node configurations detailing associated VMs that are part of the worker nodes of this Hybrid AKS - // cluster. - WorkerNodes []*NodeConfiguration + // READ-ONLY; The provisioning state of the Kubernetes cluster resource. + ProvisioningState *KubernetesClusterProvisioningState } -// HybridAksClusterRestartNodeParameters represents the body of the request to restart the node of a Hybrid AKS cluster. -type HybridAksClusterRestartNodeParameters struct { +// KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster. +type KubernetesClusterRestartNodeParameters struct { // REQUIRED; The name of the node to restart. NodeName *string } -// HybridAksClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the HybridAksClustersClient.BeginCreateOrUpdate +// KubernetesClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the KubernetesClustersClient.BeginCreateOrUpdate // method. -type HybridAksClustersClientBeginCreateOrUpdateOptions struct { +type KubernetesClustersClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// HybridAksClustersClientBeginDeleteOptions contains the optional parameters for the HybridAksClustersClient.BeginDelete +// KubernetesClustersClientBeginDeleteOptions contains the optional parameters for the KubernetesClustersClient.BeginDelete // method. -type HybridAksClustersClientBeginDeleteOptions struct { +type KubernetesClustersClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// HybridAksClustersClientBeginRestartNodeOptions contains the optional parameters for the HybridAksClustersClient.BeginRestartNode +// KubernetesClustersClientBeginRestartNodeOptions contains the optional parameters for the KubernetesClustersClient.BeginRestartNode // method. -type HybridAksClustersClientBeginRestartNodeOptions struct { +type KubernetesClustersClientBeginRestartNodeOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// HybridAksClustersClientGetOptions contains the optional parameters for the HybridAksClustersClient.Get method. -type HybridAksClustersClientGetOptions struct { - // placeholder for future optional parameters +// KubernetesClustersClientBeginUpdateOptions contains the optional parameters for the KubernetesClustersClient.BeginUpdate +// method. +type KubernetesClustersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// HybridAksClustersClientListByResourceGroupOptions contains the optional parameters for the HybridAksClustersClient.NewListByResourceGroupPager -// method. -type HybridAksClustersClientListByResourceGroupOptions struct { +// KubernetesClustersClientGetOptions contains the optional parameters for the KubernetesClustersClient.Get method. +type KubernetesClustersClientGetOptions struct { // placeholder for future optional parameters } -// HybridAksClustersClientListBySubscriptionOptions contains the optional parameters for the HybridAksClustersClient.NewListBySubscriptionPager +// KubernetesClustersClientListByResourceGroupOptions contains the optional parameters for the KubernetesClustersClient.NewListByResourceGroupPager // method. -type HybridAksClustersClientListBySubscriptionOptions struct { +type KubernetesClustersClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// HybridAksClustersClientUpdateOptions contains the optional parameters for the HybridAksClustersClient.Update method. -type HybridAksClustersClientUpdateOptions struct { +// KubernetesClustersClientListBySubscriptionOptions contains the optional parameters for the KubernetesClustersClient.NewListBySubscriptionPager +// method. +type KubernetesClustersClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// ImageRepositoryCredentials represents the credentials used to login to the image repository. -type ImageRepositoryCredentials struct { - // REQUIRED; The password or token used to access an image in the target repository. - Password *string - - // REQUIRED; The URL of the authentication server used to validate the repository credentials. - RegistryURL *string - - // REQUIRED; The username used to access an image in the target repository. - Username *string -} - -// KeySetUser represents the properties of the user in the key set. -type KeySetUser struct { - // REQUIRED; The Azure Active Directory user name (email name). - AzureUserName *string - - // REQUIRED; The SSH public key for this user. - SSHPublicKey *SSHPublicKey - - // The free-form description for this user. - Description *string -} - -// KeySetUserStatus represents the status of the key set user. -type KeySetUserStatus struct { - // READ-ONLY; The Azure Active Directory user name (email name). - AzureUserName *string - - // READ-ONLY; The indicator of whether the user is currently deployed for access. - Status *BareMetalMachineKeySetUserSetupStatus +// KubernetesLabel represents a single entry for a Kubernetes label or taint such as those used on a node or pod. +type KubernetesLabel struct { + // REQUIRED; The name of the label or taint. + Key *string - // READ-ONLY; The additional information describing the current status of this user, if any available. - StatusMessage *string + // REQUIRED; The value of the label or taint. + Value *string } // L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. @@ -1749,7 +2003,7 @@ type L2Network struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -1762,6 +2016,15 @@ type L2Network struct { Type *string } +// L2NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 2 network. +type L2NetworkAttachmentConfiguration struct { + // REQUIRED; The resource ID of the network that is being configured for attachment. + NetworkID *string + + // The indicator of how this network will be utilized by the Kubernetes cluster. + PluginType *KubernetesPluginType +} + // L2NetworkList represents a list of L2 networks. type L2NetworkList struct { // The link used to get the next page of operations. @@ -1782,13 +2045,17 @@ type L2NetworkProperties struct { // REQUIRED; The resource ID of the Network Fabric l2IsolationDomain. L2IsolationDomainID *string - // The network plugin type for Hybrid AKS. + // Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + // plugin type for Hybrid AKS. HybridAksPluginType *HybridAksPluginType // The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied // in the network attachment configuration of that virtual machine. InterfaceName *string + // READ-ONLY; The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + AssociatedResourceIDs []*string + // READ-ONLY; The resource ID of the Network Cloud cluster this L2 network is associated with. ClusterID *string @@ -1798,14 +2065,15 @@ type L2NetworkProperties struct { // READ-ONLY; The descriptive message about the current detailed status. DetailedStatusMessage *string - // READ-ONLY; The list of Hybrid AKS cluster resource ID(s) that are associated with this L2 network. + // READ-ONLY; Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are + // associated with this L2 network. HybridAksClustersAssociatedIDs []*string // READ-ONLY; The provisioning state of the L2 network. ProvisioningState *L2NetworkProvisioningState - // READ-ONLY; The list of virtual machine resource ID(s), excluding any Hybrid AKS virtual machines, that are currently using - // this L2 network. + // READ-ONLY; Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding + // any Hybrid AKS virtual machines, that are currently using this L2 network. VirtualMachinesAssociatedIDs []*string } @@ -1858,7 +2126,7 @@ type L3Network struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -1871,6 +2139,18 @@ type L3Network struct { Type *string } +// L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. +type L3NetworkAttachmentConfiguration struct { + // REQUIRED; The resource ID of the network that is being configured for attachment. + NetworkID *string + + // The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. + IpamEnabled *L3NetworkConfigurationIpamEnabled + + // The indicator of how this network will be utilized by the Kubernetes cluster. + PluginType *KubernetesPluginType +} + // L3NetworkList represents a list of L3 networks. type L3NetworkList struct { // The link used to get the next page of operations. @@ -1894,11 +2174,13 @@ type L3NetworkProperties struct { // REQUIRED; The VLAN from the l3IsolationDomain that is used for this network. Vlan *int64 - // The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid - // AKS Cluster. + // Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator + // of whether or not to disable IPAM allocation on the network attachment + // definition injected into the Hybrid AKS Cluster. HybridAksIpamEnabled *HybridAksIpamEnabled - // The network plugin type for Hybrid AKS. + // Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + // plugin type for Hybrid AKS. HybridAksPluginType *HybridAksPluginType // The type of the IP address allocation, defaulted to "DualStack". @@ -1914,6 +2196,9 @@ type L3NetworkProperties struct { // in the network attachment configuration of that virtual machine. InterfaceName *string + // READ-ONLY; The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + AssociatedResourceIDs []*string + // READ-ONLY; The resource ID of the Network Cloud cluster this L3 network is associated with. ClusterID *string @@ -1923,14 +2208,15 @@ type L3NetworkProperties struct { // READ-ONLY; The descriptive message about the current detailed status. DetailedStatusMessage *string - // READ-ONLY; The list of Hybrid AKS cluster resource IDs that are associated with this L3 network. + // READ-ONLY; Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + // with this L3 network. HybridAksClustersAssociatedIDs []*string // READ-ONLY; The provisioning state of the L3 network. ProvisioningState *L3NetworkProvisioningState - // READ-ONLY; The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using - // this L3 network. + // READ-ONLY; Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any + // Hybrid AKS virtual machines, that are currently using this L3 network. VirtualMachinesAssociatedIDs []*string } @@ -2077,9 +2363,9 @@ type MetricsConfigurationsClientGetOptions struct { // placeholder for future optional parameters } -// MetricsConfigurationsClientListByResourceGroupOptions contains the optional parameters for the MetricsConfigurationsClient.NewListByResourceGroupPager +// MetricsConfigurationsClientListByClusterOptions contains the optional parameters for the MetricsConfigurationsClient.NewListByClusterPager // method. -type MetricsConfigurationsClientListByResourceGroupOptions struct { +type MetricsConfigurationsClientListByClusterOptions struct { // placeholder for future optional parameters } @@ -2121,6 +2407,34 @@ type NetworkAttachment struct { MacAddress *string } +// NetworkConfiguration specifies the Kubernetes cluster network related configuration. +type NetworkConfiguration struct { + // REQUIRED; The resource ID of the associated Cloud Services network. + CloudServicesNetworkID *string + + // REQUIRED; The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. + CniNetworkID *string + + // The configuration of networks being attached to the cluster for use by the workloads that run on this Kubernetes cluster. + AttachedNetworkConfiguration *AttachedNetworkConfiguration + + // The configuration of the BGP service load balancer for this Kubernetes cluster. + BgpServiceLoadBalancerConfiguration *BgpServiceLoadBalancerConfiguration + + // The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + // in service CIDR. + DNSServiceIP *string + + // The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, + // one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + PodCidrs []*string + + // The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two + // CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack + // networking. + ServiceCidrs []*string +} + // NetworkInterface represents properties of the network interface. type NetworkInterface struct { // READ-ONLY; The partial address of Peripheral Component Interconnect (PCI). @@ -2157,55 +2471,6 @@ type Nic struct { Name *string } -// Node denotes the list of node that utilizes configuration. -type Node struct { - // READ-ONLY; The resource ID of the bare metal machine that hosts this node. - BareMetalMachineID *string - - // READ-ONLY; The machine image last used to deploy this node. - ImageID *string - - // READ-ONLY; The list of network attachments to the virtual machine. - NetworkAttachments []*NetworkAttachment - - // READ-ONLY; The name of this node, as realized in the Hybrid AKS cluster. - NodeName *string - - // READ-ONLY; The power state (On | Off) of the node. - PowerState *HybridAksClusterMachinePowerState -} - -// NodeConfiguration contains configuration for a VM associated with a node. -type NodeConfiguration struct { - // READ-ONLY; The resource ID of the agent pool that contains the nodes in this configuration. - AgentPoolID *string - - // READ-ONLY; The name of the agent pool that contains the nodes in this configuration. - AgentPoolName *string - - // READ-ONLY; The number of CPU cores in the virtual machine. - CPUCores *int64 - - // READ-ONLY; The root disk size of the virtual machine in GB. - DiskSizeGB *int64 - - // READ-ONLY; The memory size of the virtual machine in GB. - MemorySizeGB *int64 - - // READ-ONLY; Field deprecated, use agentPoolName instead. This field will be removed in a future version but will reflect - // the name of the agent pool that contains the nodes in this configuration. - NodePoolName *string - - // READ-ONLY; The list of nodes that utilize this configuration. - Nodes []*Node - - // READ-ONLY; The number of virtual machines that use this configuration. - VMCount *int64 - - // READ-ONLY; The name of the VM size supplied during the creation of the cluster. - VMSize *string -} - // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. @@ -2286,7 +2551,7 @@ type Rack struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -2311,7 +2576,7 @@ type RackDefinition struct { // than a serial number may be provided if desired. RackSerialNumber *string - // The zone name used for this rack when created. + // The zone name used for this rack when created. Availability zones are used for workload placement. AvailabilityZone *string // The unordered list of bare metal machine configuration. @@ -2376,7 +2641,7 @@ type RackSKU struct { // REQUIRED; The list of the resource properties. Properties *RackSKUProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -2481,12 +2746,45 @@ type RacksPatchProperties struct { RackSerialNumber *string } -// SSHPublicKey - SshPublicKey represents the public key used to authenticate with the virtual machine through SSH. +// SSHPublicKey - SshPublicKey represents the public key used to authenticate with a resource through SSH. type SSHPublicKey struct { - // REQUIRED; The public ssh key of the user. + // REQUIRED; The SSH public key data. KeyData *string } +// ServiceLoadBalancerBgpPeer represents the configuration of the BGP service load balancer for the Kubernetes cluster. +type ServiceLoadBalancerBgpPeer struct { + // REQUIRED; The name used to identify this BGP peer for association with a BGP advertisement. + Name *string + + // REQUIRED; The IPv4 or IPv6 address used to connect this BGP session. + PeerAddress *string + + // REQUIRED; The autonomous system number expected from the remote end of the BGP session. + PeerAsn *int64 + + // The indicator of BFD enablement for this BgpPeer. + BfdEnabled *BfdEnabled + + // The indicator to enable multi-hop peering support. + BgpMultiHop *BgpMultiHop + + // The requested BGP hold time value. This field uses ISO 8601 duration format, for example P1H. + HoldTime *string + + // The requested BGP keepalive time value. This field uses ISO 8601 duration format, for example P1H. + KeepAliveTime *string + + // The autonomous system number used for the local end of the BGP session. + MyAsn *int64 + + // The authentication password for routers enforcing TCP MD5 authenticated sessions. + Password *string + + // The port used to connect this BGP session. + PeerPort *int64 +} + // ServicePrincipalInformation represents the details of the service principal to be used by the cluster during Arc Appliance // installation. type ServicePrincipalInformation struct { @@ -2517,7 +2815,7 @@ type StorageAppliance struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -2664,13 +2962,6 @@ type StorageApplianceSKUSlot struct { RackSlot *int64 } -// StorageApplianceValidateHardwareParameters represents the body of the request to validate the physical hardware of a storage -// appliance. -type StorageApplianceValidateHardwareParameters struct { - // REQUIRED; The category of hardware validation to perform. - ValidationCategory *StorageApplianceHardwareValidationCategory -} - // StorageAppliancesClientBeginCreateOrUpdateOptions contains the optional parameters for the StorageAppliancesClient.BeginCreateOrUpdate // method. type StorageAppliancesClientBeginCreateOrUpdateOptions struct { @@ -2715,13 +3006,6 @@ type StorageAppliancesClientBeginUpdateOptions struct { ResumeToken string } -// StorageAppliancesClientBeginValidateHardwareOptions contains the optional parameters for the StorageAppliancesClient.BeginValidateHardware -// method. -type StorageAppliancesClientBeginValidateHardwareOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // StorageAppliancesClientGetOptions contains the optional parameters for the StorageAppliancesClient.Get method. type StorageAppliancesClientGetOptions struct { // placeholder for future optional parameters @@ -2783,7 +3067,7 @@ type TrunkedNetwork struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -2796,6 +3080,15 @@ type TrunkedNetwork struct { Type *string } +// TrunkedNetworkAttachmentConfiguration represents the configuration of the attachment of a trunked network. +type TrunkedNetworkAttachmentConfiguration struct { + // REQUIRED; The resource ID of the network that is being configured for attachment. + NetworkID *string + + // The indicator of how this network will be utilized by the Kubernetes cluster. + PluginType *KubernetesPluginType +} + // TrunkedNetworkList represents a list of trunked networks. type TrunkedNetworkList struct { // The link used to get the next page of operations. @@ -2820,13 +3113,17 @@ type TrunkedNetworkProperties struct { // REQUIRED; The list of vlans that are selected from the isolation domains for trunking. Vlans []*int64 - // The network plugin type for Hybrid AKS. + // Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + // plugin type for Hybrid AKS. HybridAksPluginType *HybridAksPluginType // The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied // in the network attachment configuration of that virtual machine. InterfaceName *string + // READ-ONLY; The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + AssociatedResourceIDs []*string + // READ-ONLY; The resource ID of the Network Cloud cluster this trunked network is associated with. ClusterID *string @@ -2836,14 +3133,15 @@ type TrunkedNetworkProperties struct { // READ-ONLY; The descriptive message about the current detailed status. DetailedStatusMessage *string - // READ-ONLY; The list of Hybrid AKS cluster resource IDs that are associated with this trunked network. + // READ-ONLY; Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + // with this trunked network. HybridAksClustersAssociatedIDs []*string // READ-ONLY; The provisioning state of the trunked network. ProvisioningState *TrunkedNetworkProvisioningState - // READ-ONLY; The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using - // this trunked network. + // READ-ONLY; Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any + // Hybrid AKS virtual machines, that are currently using this trunked network. VirtualMachinesAssociatedIDs []*string } @@ -2908,7 +3206,7 @@ type VirtualMachine struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -3021,6 +3319,9 @@ type VirtualMachineProperties struct { // Field Deprecated, use virtualizationModel instead. The type of the virtio interface. VirtioInterface *VirtualMachineVirtioInterfaceType + // READ-ONLY; The cluster availability zone containing this virtual machine. + AvailabilityZone *string + // READ-ONLY; The resource ID of the bare metal machine the virtual machine has landed to. BareMetalMachineID *string @@ -3141,7 +3442,7 @@ type Volume struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/models_serde.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/models_serde.go index 01a6ac2cf65c..5e90dda0b6f6 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/models_serde.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/models_serde.go @@ -16,6 +16,33 @@ import ( "reflect" ) +// MarshalJSON implements the json.Marshaller interface for type AADConfiguration. +func (a AADConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "adminGroupObjectIds", a.AdminGroupObjectIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AADConfiguration. +func (a *AADConfiguration) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "adminGroupObjectIds": + err = unpopulate(val, "AdminGroupObjectIDs", &a.AdminGroupObjectIDs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AdministrativeCredentials. func (a AdministrativeCredentials) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -47,6 +74,388 @@ func (a *AdministrativeCredentials) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AdministratorConfiguration. +func (a AdministratorConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "adminUsername", a.AdminUsername) + populate(objectMap, "sshPublicKeys", a.SSHPublicKeys) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorConfiguration. +func (a *AdministratorConfiguration) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "adminUsername": + err = unpopulate(val, "AdminUsername", &a.AdminUsername) + delete(rawMsg, key) + case "sshPublicKeys": + err = unpopulate(val, "SSHPublicKeys", &a.SSHPublicKeys) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentOptions. +func (a AgentOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hugepagesCount", a.HugepagesCount) + populate(objectMap, "hugepagesSize", a.HugepagesSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentOptions. +func (a *AgentOptions) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "hugepagesCount": + err = unpopulate(val, "HugepagesCount", &a.HugepagesCount) + delete(rawMsg, key) + case "hugepagesSize": + err = unpopulate(val, "HugepagesSize", &a.HugepagesSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPool. +func (a AgentPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "extendedLocation", a.ExtendedLocation) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPool. +func (a *AgentPool) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &a.ExtendedLocation) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolList. +func (a AgentPoolList) 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 AgentPoolList. +func (a *AgentPoolList) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolPatchParameters. +func (a AgentPoolPatchParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolPatchParameters. +func (a *AgentPoolPatchParameters) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolPatchProperties. +func (a AgentPoolPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", a.Count) + populate(objectMap, "upgradeSettings", a.UpgradeSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolPatchProperties. +func (a *AgentPoolPatchProperties) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &a.Count) + delete(rawMsg, key) + case "upgradeSettings": + err = unpopulate(val, "UpgradeSettings", &a.UpgradeSettings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolProperties. +func (a AgentPoolProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorConfiguration", a.AdministratorConfiguration) + populate(objectMap, "agentOptions", a.AgentOptions) + populate(objectMap, "attachedNetworkConfiguration", a.AttachedNetworkConfiguration) + populate(objectMap, "availabilityZones", a.AvailabilityZones) + populate(objectMap, "count", a.Count) + populate(objectMap, "detailedStatus", a.DetailedStatus) + populate(objectMap, "detailedStatusMessage", a.DetailedStatusMessage) + populate(objectMap, "kubernetesVersion", a.KubernetesVersion) + populate(objectMap, "labels", a.Labels) + populate(objectMap, "mode", a.Mode) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "taints", a.Taints) + populate(objectMap, "upgradeSettings", a.UpgradeSettings) + populate(objectMap, "vmSkuName", a.VMSKUName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolProperties. +func (a *AgentPoolProperties) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "administratorConfiguration": + err = unpopulate(val, "AdministratorConfiguration", &a.AdministratorConfiguration) + delete(rawMsg, key) + case "agentOptions": + err = unpopulate(val, "AgentOptions", &a.AgentOptions) + delete(rawMsg, key) + case "attachedNetworkConfiguration": + err = unpopulate(val, "AttachedNetworkConfiguration", &a.AttachedNetworkConfiguration) + delete(rawMsg, key) + case "availabilityZones": + err = unpopulate(val, "AvailabilityZones", &a.AvailabilityZones) + delete(rawMsg, key) + case "count": + err = unpopulate(val, "Count", &a.Count) + delete(rawMsg, key) + case "detailedStatus": + err = unpopulate(val, "DetailedStatus", &a.DetailedStatus) + delete(rawMsg, key) + case "detailedStatusMessage": + err = unpopulate(val, "DetailedStatusMessage", &a.DetailedStatusMessage) + delete(rawMsg, key) + case "kubernetesVersion": + err = unpopulate(val, "KubernetesVersion", &a.KubernetesVersion) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &a.Labels) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &a.Mode) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "taints": + err = unpopulate(val, "Taints", &a.Taints) + delete(rawMsg, key) + case "upgradeSettings": + err = unpopulate(val, "UpgradeSettings", &a.UpgradeSettings) + delete(rawMsg, key) + case "vmSkuName": + err = unpopulate(val, "VMSKUName", &a.VMSKUName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolUpgradeSettings. +func (a AgentPoolUpgradeSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxSurge", a.MaxSurge) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolUpgradeSettings. +func (a *AgentPoolUpgradeSettings) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxSurge": + err = unpopulate(val, "MaxSurge", &a.MaxSurge) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AttachedNetworkConfiguration. +func (a AttachedNetworkConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "l2Networks", a.L2Networks) + populate(objectMap, "l3Networks", a.L3Networks) + populate(objectMap, "trunkedNetworks", a.TrunkedNetworks) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AttachedNetworkConfiguration. +func (a *AttachedNetworkConfiguration) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "l2Networks": + err = unpopulate(val, "L2Networks", &a.L2Networks) + delete(rawMsg, key) + case "l3Networks": + err = unpopulate(val, "L3Networks", &a.L3Networks) + delete(rawMsg, key) + case "trunkedNetworks": + err = unpopulate(val, "TrunkedNetworks", &a.TrunkedNetworks) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AvailableUpgrade. +func (a AvailableUpgrade) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availabilityLifecycle", a.AvailabilityLifecycle) + populate(objectMap, "version", a.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableUpgrade. +func (a *AvailableUpgrade) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "availabilityLifecycle": + err = unpopulate(val, "AvailabilityLifecycle", &a.AvailabilityLifecycle) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &a.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type BareMetalMachine. func (b BareMetalMachine) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -553,6 +962,7 @@ func (b *BareMetalMachinePowerOffParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BareMetalMachineProperties. func (b BareMetalMachineProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "associatedResourceIds", b.AssociatedResourceIDs) populate(objectMap, "bmcConnectionString", b.BmcConnectionString) populate(objectMap, "bmcCredentials", b.BmcCredentials) populate(objectMap, "bmcMacAddress", b.BmcMacAddress) @@ -592,6 +1002,9 @@ func (b *BareMetalMachineProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "associatedResourceIds": + err = unpopulate(val, "AssociatedResourceIDs", &b.AssociatedResourceIDs) + delete(rawMsg, key) case "bmcConnectionString": err = unpopulate(val, "BmcConnectionString", &b.BmcConnectionString) delete(rawMsg, key) @@ -848,17 +1261,18 @@ func (b *BareMetalMachineValidateHardwareParameters) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type BgpPeer. -func (b BgpPeer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BgpAdvertisement. +func (b BgpAdvertisement) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "asNumber", b.AsNumber) - populate(objectMap, "password", b.Password) - populate(objectMap, "peerIp", b.PeerIP) + populate(objectMap, "advertiseToFabric", b.AdvertiseToFabric) + populate(objectMap, "communities", b.Communities) + populate(objectMap, "ipAddressPools", b.IPAddressPools) + populate(objectMap, "peers", b.Peers) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BgpPeer. -func (b *BgpPeer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BgpAdvertisement. +func (b *BgpAdvertisement) 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", b, err) @@ -866,14 +1280,56 @@ func (b *BgpPeer) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "asNumber": - err = unpopulate(val, "AsNumber", &b.AsNumber) + case "advertiseToFabric": + err = unpopulate(val, "AdvertiseToFabric", &b.AdvertiseToFabric) delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &b.Password) + case "communities": + err = unpopulate(val, "Communities", &b.Communities) + delete(rawMsg, key) + case "ipAddressPools": + err = unpopulate(val, "IPAddressPools", &b.IPAddressPools) + delete(rawMsg, key) + case "peers": + err = unpopulate(val, "Peers", &b.Peers) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BgpServiceLoadBalancerConfiguration. +func (b BgpServiceLoadBalancerConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bgpAdvertisements", b.BgpAdvertisements) + populate(objectMap, "bgpPeers", b.BgpPeers) + populate(objectMap, "fabricPeeringEnabled", b.FabricPeeringEnabled) + populate(objectMap, "ipAddressPools", b.IPAddressPools) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BgpServiceLoadBalancerConfiguration. +func (b *BgpServiceLoadBalancerConfiguration) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bgpAdvertisements": + err = unpopulate(val, "BgpAdvertisements", &b.BgpAdvertisements) delete(rawMsg, key) - case "peerIp": - err = unpopulate(val, "PeerIP", &b.PeerIP) + case "bgpPeers": + err = unpopulate(val, "BgpPeers", &b.BgpPeers) + delete(rawMsg, key) + case "fabricPeeringEnabled": + err = unpopulate(val, "FabricPeeringEnabled", &b.FabricPeeringEnabled) + delete(rawMsg, key) + case "ipAddressPools": + err = unpopulate(val, "IPAddressPools", &b.IPAddressPools) delete(rawMsg, key) } if err != nil { @@ -1242,6 +1698,7 @@ func (c *CloudServicesNetworkPatchProperties) UnmarshalJSON(data []byte) error { func (c CloudServicesNetworkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "additionalEgressEndpoints", c.AdditionalEgressEndpoints) + populate(objectMap, "associatedResourceIds", c.AssociatedResourceIDs) populate(objectMap, "clusterId", c.ClusterID) populate(objectMap, "detailedStatus", c.DetailedStatus) populate(objectMap, "detailedStatusMessage", c.DetailedStatusMessage) @@ -1266,6 +1723,9 @@ func (c *CloudServicesNetworkProperties) UnmarshalJSON(data []byte) error { case "additionalEgressEndpoints": err = unpopulate(val, "AdditionalEgressEndpoints", &c.AdditionalEgressEndpoints) delete(rawMsg, key) + case "associatedResourceIds": + err = unpopulate(val, "AssociatedResourceIDs", &c.AssociatedResourceIDs) + delete(rawMsg, key) case "clusterId": err = unpopulate(val, "ClusterID", &c.ClusterID) delete(rawMsg, key) @@ -2130,80 +2590,6 @@ func (c *ClusterUpdateVersionParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CniBgpConfiguration. -func (c CniBgpConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "bgpPeers", c.BgpPeers) - populate(objectMap, "communityAdvertisements", c.CommunityAdvertisements) - populate(objectMap, "nodeMeshPassword", c.NodeMeshPassword) - populate(objectMap, "serviceExternalPrefixes", c.ServiceExternalPrefixes) - populate(objectMap, "serviceLoadBalancerPrefixes", c.ServiceLoadBalancerPrefixes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CniBgpConfiguration. -func (c *CniBgpConfiguration) 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "bgpPeers": - err = unpopulate(val, "BgpPeers", &c.BgpPeers) - delete(rawMsg, key) - case "communityAdvertisements": - err = unpopulate(val, "CommunityAdvertisements", &c.CommunityAdvertisements) - delete(rawMsg, key) - case "nodeMeshPassword": - err = unpopulate(val, "NodeMeshPassword", &c.NodeMeshPassword) - delete(rawMsg, key) - case "serviceExternalPrefixes": - err = unpopulate(val, "ServiceExternalPrefixes", &c.ServiceExternalPrefixes) - delete(rawMsg, key) - case "serviceLoadBalancerPrefixes": - err = unpopulate(val, "ServiceLoadBalancerPrefixes", &c.ServiceLoadBalancerPrefixes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityAdvertisement. -func (c CommunityAdvertisement) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "communities", c.Communities) - populate(objectMap, "subnetPrefix", c.SubnetPrefix) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityAdvertisement. -func (c *CommunityAdvertisement) 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "communities": - err = unpopulate(val, "Communities", &c.Communities) - delete(rawMsg, key) - case "subnetPrefix": - err = unpopulate(val, "SubnetPrefix", &c.SubnetPrefix) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Console. func (c Console) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2411,193 +2797,67 @@ func (c *ConsoleProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DefaultCniNetwork. -func (d DefaultCniNetwork) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ControlPlaneNodeConfiguration. +func (c ControlPlaneNodeConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", d.ExtendedLocation) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) + populate(objectMap, "administratorConfiguration", c.AdministratorConfiguration) + populate(objectMap, "availabilityZones", c.AvailabilityZones) + populate(objectMap, "count", c.Count) + populate(objectMap, "vmSkuName", c.VMSKUName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultCniNetwork. -func (d *DefaultCniNetwork) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ControlPlaneNodeConfiguration. +func (c *ControlPlaneNodeConfiguration) 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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &d.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) + case "administratorConfiguration": + err = unpopulate(val, "AdministratorConfiguration", &c.AdministratorConfiguration) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + case "availabilityZones": + err = unpopulate(val, "AvailabilityZones", &c.AvailabilityZones) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) + case "count": + err = unpopulate(val, "Count", &c.Count) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "vmSkuName": + err = unpopulate(val, "VMSKUName", &c.VMSKUName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DefaultCniNetworkList. -func (d DefaultCniNetworkList) 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 DefaultCniNetworkList. -func (d *DefaultCniNetworkList) 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DefaultCniNetworkPatchParameters. -func (d DefaultCniNetworkPatchParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultCniNetworkPatchParameters. -func (d *DefaultCniNetworkPatchParameters) 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefaultCniNetworkProperties. -func (d DefaultCniNetworkProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ControlPlaneNodePatchConfiguration. +func (c ControlPlaneNodePatchConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clusterId", d.ClusterID) - populate(objectMap, "cniAsNumber", d.CniAsNumber) - populate(objectMap, "cniBgpConfiguration", d.CniBgpConfiguration) - populate(objectMap, "detailedStatus", d.DetailedStatus) - populate(objectMap, "detailedStatusMessage", d.DetailedStatusMessage) - populate(objectMap, "fabricBgpPeers", d.FabricBgpPeers) - populate(objectMap, "hybridAksClustersAssociatedIds", d.HybridAksClustersAssociatedIDs) - populate(objectMap, "ipAllocationType", d.IPAllocationType) - populate(objectMap, "ipv4ConnectedPrefix", d.IPv4ConnectedPrefix) - populate(objectMap, "ipv6ConnectedPrefix", d.IPv6ConnectedPrefix) - populate(objectMap, "interfaceName", d.InterfaceName) - populate(objectMap, "l3IsolationDomainId", d.L3IsolationDomainID) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "vlan", d.Vlan) + populate(objectMap, "count", c.Count) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultCniNetworkProperties. -func (d *DefaultCniNetworkProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ControlPlaneNodePatchConfiguration. +func (c *ControlPlaneNodePatchConfiguration) 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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "clusterId": - err = unpopulate(val, "ClusterID", &d.ClusterID) - delete(rawMsg, key) - case "cniAsNumber": - err = unpopulate(val, "CniAsNumber", &d.CniAsNumber) - delete(rawMsg, key) - case "cniBgpConfiguration": - err = unpopulate(val, "CniBgpConfiguration", &d.CniBgpConfiguration) - delete(rawMsg, key) - case "detailedStatus": - err = unpopulate(val, "DetailedStatus", &d.DetailedStatus) - delete(rawMsg, key) - case "detailedStatusMessage": - err = unpopulate(val, "DetailedStatusMessage", &d.DetailedStatusMessage) - delete(rawMsg, key) - case "fabricBgpPeers": - err = unpopulate(val, "FabricBgpPeers", &d.FabricBgpPeers) - delete(rawMsg, key) - case "hybridAksClustersAssociatedIds": - err = unpopulate(val, "HybridAksClustersAssociatedIDs", &d.HybridAksClustersAssociatedIDs) - delete(rawMsg, key) - case "ipAllocationType": - err = unpopulate(val, "IPAllocationType", &d.IPAllocationType) - delete(rawMsg, key) - case "ipv4ConnectedPrefix": - err = unpopulate(val, "IPv4ConnectedPrefix", &d.IPv4ConnectedPrefix) - delete(rawMsg, key) - case "ipv6ConnectedPrefix": - err = unpopulate(val, "IPv6ConnectedPrefix", &d.IPv6ConnectedPrefix) - delete(rawMsg, key) - case "interfaceName": - err = unpopulate(val, "InterfaceName", &d.InterfaceName) - delete(rawMsg, key) - case "l3IsolationDomainId": - err = unpopulate(val, "L3IsolationDomainID", &d.L3IsolationDomainID) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "vlan": - err = unpopulate(val, "Vlan", &d.Vlan) + case "count": + err = unpopulate(val, "Count", &c.Count) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil @@ -2683,14 +2943,53 @@ func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { var err error switch key { case "name": - err = unpopulate(val, "Name", &e.Name) + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 FeatureStatus. +func (f FeatureStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "detailedStatus", f.DetailedStatus) + populate(objectMap, "detailedStatusMessage", f.DetailedStatusMessage) + populate(objectMap, "name", f.Name) + populate(objectMap, "version", f.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureStatus. +func (f *FeatureStatus) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "detailedStatus": + err = unpopulate(val, "DetailedStatus", &f.DetailedStatus) + delete(rawMsg, key) + case "detailedStatusMessage": + err = unpopulate(val, "DetailedStatusMessage", &f.DetailedStatusMessage) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "version": + err = unpopulate(val, "Version", &f.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil @@ -2801,267 +3100,560 @@ func (h *HardwareValidationStatus) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type HybridAksCluster. -func (h HybridAksCluster) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IPAddressPool. +func (i IPAddressPool) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", h.ExtendedLocation) - populate(objectMap, "id", h.ID) - populate(objectMap, "location", h.Location) - populate(objectMap, "name", h.Name) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "systemData", h.SystemData) - populate(objectMap, "tags", h.Tags) - populate(objectMap, "type", h.Type) + populate(objectMap, "addresses", i.Addresses) + populate(objectMap, "autoAssign", i.AutoAssign) + populate(objectMap, "name", i.Name) + populate(objectMap, "onlyUseHostIps", i.OnlyUseHostIPs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HybridAksCluster. -func (h *HybridAksCluster) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IPAddressPool. +func (i *IPAddressPool) 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) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &h.ExtendedLocation) + case "addresses": + err = unpopulate(val, "Addresses", &i.Addresses) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &h.ID) + case "autoAssign": + err = unpopulate(val, "AutoAssign", &i.AutoAssign) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &h.Location) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "onlyUseHostIps": + err = unpopulate(val, "OnlyUseHostIPs", &i.OnlyUseHostIPs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageRepositoryCredentials. +func (i ImageRepositoryCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "password", i.Password) + populate(objectMap, "registryUrl", i.RegistryURL) + populate(objectMap, "username", i.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageRepositoryCredentials. +func (i *ImageRepositoryCredentials) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "password": + err = unpopulate(val, "Password", &i.Password) + delete(rawMsg, key) + case "registryUrl": + err = unpopulate(val, "RegistryURL", &i.RegistryURL) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &i.Username) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InitialAgentPoolConfiguration. +func (i InitialAgentPoolConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorConfiguration", i.AdministratorConfiguration) + populate(objectMap, "agentOptions", i.AgentOptions) + populate(objectMap, "attachedNetworkConfiguration", i.AttachedNetworkConfiguration) + populate(objectMap, "availabilityZones", i.AvailabilityZones) + populate(objectMap, "count", i.Count) + populate(objectMap, "labels", i.Labels) + populate(objectMap, "mode", i.Mode) + populate(objectMap, "name", i.Name) + populate(objectMap, "taints", i.Taints) + populate(objectMap, "upgradeSettings", i.UpgradeSettings) + populate(objectMap, "vmSkuName", i.VMSKUName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InitialAgentPoolConfiguration. +func (i *InitialAgentPoolConfiguration) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "administratorConfiguration": + err = unpopulate(val, "AdministratorConfiguration", &i.AdministratorConfiguration) + delete(rawMsg, key) + case "agentOptions": + err = unpopulate(val, "AgentOptions", &i.AgentOptions) + delete(rawMsg, key) + case "attachedNetworkConfiguration": + err = unpopulate(val, "AttachedNetworkConfiguration", &i.AttachedNetworkConfiguration) + delete(rawMsg, key) + case "availabilityZones": + err = unpopulate(val, "AvailabilityZones", &i.AvailabilityZones) + delete(rawMsg, key) + case "count": + err = unpopulate(val, "Count", &i.Count) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &i.Labels) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &i.Mode) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &h.Name) + err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &h.Properties) + case "taints": + err = unpopulate(val, "Taints", &i.Taints) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &h.SystemData) + case "upgradeSettings": + err = unpopulate(val, "UpgradeSettings", &i.UpgradeSettings) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &h.Tags) + case "vmSkuName": + err = unpopulate(val, "VMSKUName", &i.VMSKUName) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &h.Type) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeySetUser. +func (k KeySetUser) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureUserName", k.AzureUserName) + populate(objectMap, "description", k.Description) + populate(objectMap, "sshPublicKey", k.SSHPublicKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeySetUser. +func (k *KeySetUser) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureUserName": + err = unpopulate(val, "AzureUserName", &k.AzureUserName) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &k.Description) + delete(rawMsg, key) + case "sshPublicKey": + err = unpopulate(val, "SSHPublicKey", &k.SSHPublicKey) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HybridAksClusterList. -func (h HybridAksClusterList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KeySetUserStatus. +func (k KeySetUserStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", h.NextLink) - populate(objectMap, "value", h.Value) + populate(objectMap, "azureUserName", k.AzureUserName) + populate(objectMap, "status", k.Status) + populate(objectMap, "statusMessage", k.StatusMessage) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HybridAksClusterList. -func (h *HybridAksClusterList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type KeySetUserStatus. +func (k *KeySetUserStatus) 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) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &h.NextLink) + case "azureUserName": + err = unpopulate(val, "AzureUserName", &k.AzureUserName) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &h.Value) + case "status": + err = unpopulate(val, "Status", &k.Status) + delete(rawMsg, key) + case "statusMessage": + err = unpopulate(val, "StatusMessage", &k.StatusMessage) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HybridAksClusterPatchParameters. -func (h HybridAksClusterPatchParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KubernetesCluster. +func (k KubernetesCluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "tags", h.Tags) + populate(objectMap, "extendedLocation", k.ExtendedLocation) + populate(objectMap, "id", k.ID) + populate(objectMap, "location", k.Location) + populate(objectMap, "name", k.Name) + populate(objectMap, "properties", k.Properties) + populate(objectMap, "systemData", k.SystemData) + populate(objectMap, "tags", k.Tags) + populate(objectMap, "type", k.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HybridAksClusterPatchParameters. -func (h *HybridAksClusterPatchParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesCluster. +func (k *KubernetesCluster) 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) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } for key, val := range rawMsg { var err error switch key { + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &k.ExtendedLocation) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &k.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &k.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &k.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &k.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &k.SystemData) + delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &h.Tags) + err = unpopulate(val, "Tags", &k.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &k.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HybridAksClusterProperties. -func (h HybridAksClusterProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KubernetesClusterList. +func (k KubernetesClusterList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "associatedNetworkIds", h.AssociatedNetworkIDs) - populate(objectMap, "cloudServicesNetworkId", h.CloudServicesNetworkID) - populate(objectMap, "clusterId", h.ClusterID) - populate(objectMap, "controlPlaneCount", h.ControlPlaneCount) - populate(objectMap, "controlPlaneNodes", h.ControlPlaneNodes) - populate(objectMap, "defaultCniNetworkId", h.DefaultCniNetworkID) - populate(objectMap, "detailedStatus", h.DetailedStatus) - populate(objectMap, "detailedStatusMessage", h.DetailedStatusMessage) - populate(objectMap, "hybridAksProvisionedClusterId", h.HybridAksProvisionedClusterID) - populate(objectMap, "provisioningState", h.ProvisioningState) - populate(objectMap, "volumes", h.Volumes) - populate(objectMap, "workerCount", h.WorkerCount) - populate(objectMap, "workerNodes", h.WorkerNodes) + populate(objectMap, "nextLink", k.NextLink) + populate(objectMap, "value", k.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HybridAksClusterProperties. -func (h *HybridAksClusterProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesClusterList. +func (k *KubernetesClusterList) 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) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } for key, val := range rawMsg { var err error switch key { - case "associatedNetworkIds": - err = unpopulate(val, "AssociatedNetworkIDs", &h.AssociatedNetworkIDs) + case "nextLink": + err = unpopulate(val, "NextLink", &k.NextLink) delete(rawMsg, key) - case "cloudServicesNetworkId": - err = unpopulate(val, "CloudServicesNetworkID", &h.CloudServicesNetworkID) + case "value": + err = unpopulate(val, "Value", &k.Value) delete(rawMsg, key) - case "clusterId": - err = unpopulate(val, "ClusterID", &h.ClusterID) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesClusterNode. +func (k KubernetesClusterNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "agentPoolId", k.AgentPoolID) + populate(objectMap, "availabilityZone", k.AvailabilityZone) + populate(objectMap, "bareMetalMachineId", k.BareMetalMachineID) + populate(objectMap, "cpuCores", k.CPUCores) + populate(objectMap, "detailedStatus", k.DetailedStatus) + populate(objectMap, "detailedStatusMessage", k.DetailedStatusMessage) + populate(objectMap, "diskSizeGB", k.DiskSizeGB) + populate(objectMap, "image", k.Image) + populate(objectMap, "kubernetesVersion", k.KubernetesVersion) + populate(objectMap, "labels", k.Labels) + populate(objectMap, "memorySizeGB", k.MemorySizeGB) + populate(objectMap, "mode", k.Mode) + populate(objectMap, "name", k.Name) + populate(objectMap, "networkAttachments", k.NetworkAttachments) + populate(objectMap, "powerState", k.PowerState) + populate(objectMap, "role", k.Role) + populate(objectMap, "taints", k.Taints) + populate(objectMap, "vmSkuName", k.VMSKUName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesClusterNode. +func (k *KubernetesClusterNode) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "agentPoolId": + err = unpopulate(val, "AgentPoolID", &k.AgentPoolID) delete(rawMsg, key) - case "controlPlaneCount": - err = unpopulate(val, "ControlPlaneCount", &h.ControlPlaneCount) + case "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &k.AvailabilityZone) delete(rawMsg, key) - case "controlPlaneNodes": - err = unpopulate(val, "ControlPlaneNodes", &h.ControlPlaneNodes) + case "bareMetalMachineId": + err = unpopulate(val, "BareMetalMachineID", &k.BareMetalMachineID) delete(rawMsg, key) - case "defaultCniNetworkId": - err = unpopulate(val, "DefaultCniNetworkID", &h.DefaultCniNetworkID) + case "cpuCores": + err = unpopulate(val, "CPUCores", &k.CPUCores) delete(rawMsg, key) case "detailedStatus": - err = unpopulate(val, "DetailedStatus", &h.DetailedStatus) + err = unpopulate(val, "DetailedStatus", &k.DetailedStatus) delete(rawMsg, key) case "detailedStatusMessage": - err = unpopulate(val, "DetailedStatusMessage", &h.DetailedStatusMessage) + err = unpopulate(val, "DetailedStatusMessage", &k.DetailedStatusMessage) delete(rawMsg, key) - case "hybridAksProvisionedClusterId": - err = unpopulate(val, "HybridAksProvisionedClusterID", &h.HybridAksProvisionedClusterID) + case "diskSizeGB": + err = unpopulate(val, "DiskSizeGB", &k.DiskSizeGB) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) + case "image": + err = unpopulate(val, "Image", &k.Image) delete(rawMsg, key) - case "volumes": - err = unpopulate(val, "Volumes", &h.Volumes) + case "kubernetesVersion": + err = unpopulate(val, "KubernetesVersion", &k.KubernetesVersion) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &k.Labels) + delete(rawMsg, key) + case "memorySizeGB": + err = unpopulate(val, "MemorySizeGB", &k.MemorySizeGB) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &k.Mode) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &k.Name) delete(rawMsg, key) - case "workerCount": - err = unpopulate(val, "WorkerCount", &h.WorkerCount) + case "networkAttachments": + err = unpopulate(val, "NetworkAttachments", &k.NetworkAttachments) + delete(rawMsg, key) + case "powerState": + err = unpopulate(val, "PowerState", &k.PowerState) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &k.Role) delete(rawMsg, key) - case "workerNodes": - err = unpopulate(val, "WorkerNodes", &h.WorkerNodes) + case "taints": + err = unpopulate(val, "Taints", &k.Taints) + delete(rawMsg, key) + case "vmSkuName": + err = unpopulate(val, "VMSKUName", &k.VMSKUName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HybridAksClusterRestartNodeParameters. -func (h HybridAksClusterRestartNodeParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KubernetesClusterPatchParameters. +func (k KubernetesClusterPatchParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nodeName", h.NodeName) + populate(objectMap, "properties", k.Properties) + populate(objectMap, "tags", k.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HybridAksClusterRestartNodeParameters. -func (h *HybridAksClusterRestartNodeParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesClusterPatchParameters. +func (k *KubernetesClusterPatchParameters) 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) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } for key, val := range rawMsg { var err error switch key { - case "nodeName": - err = unpopulate(val, "NodeName", &h.NodeName) + case "properties": + err = unpopulate(val, "Properties", &k.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &k.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageRepositoryCredentials. -func (i ImageRepositoryCredentials) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KubernetesClusterPatchProperties. +func (k KubernetesClusterPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "password", i.Password) - populate(objectMap, "registryUrl", i.RegistryURL) - populate(objectMap, "username", i.Username) + populate(objectMap, "controlPlaneNodeConfiguration", k.ControlPlaneNodeConfiguration) + populate(objectMap, "kubernetesVersion", k.KubernetesVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageRepositoryCredentials. -func (i *ImageRepositoryCredentials) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesClusterPatchProperties. +func (k *KubernetesClusterPatchProperties) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } for key, val := range rawMsg { var err error switch key { - case "password": - err = unpopulate(val, "Password", &i.Password) + case "controlPlaneNodeConfiguration": + err = unpopulate(val, "ControlPlaneNodeConfiguration", &k.ControlPlaneNodeConfiguration) + delete(rawMsg, key) + case "kubernetesVersion": + err = unpopulate(val, "KubernetesVersion", &k.KubernetesVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesClusterProperties. +func (k KubernetesClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aadConfiguration", k.AADConfiguration) + populate(objectMap, "administratorConfiguration", k.AdministratorConfiguration) + populate(objectMap, "attachedNetworkIds", k.AttachedNetworkIDs) + populate(objectMap, "availableUpgrades", k.AvailableUpgrades) + populate(objectMap, "clusterId", k.ClusterID) + populate(objectMap, "connectedClusterId", k.ConnectedClusterID) + populate(objectMap, "controlPlaneKubernetesVersion", k.ControlPlaneKubernetesVersion) + populate(objectMap, "controlPlaneNodeConfiguration", k.ControlPlaneNodeConfiguration) + populate(objectMap, "detailedStatus", k.DetailedStatus) + populate(objectMap, "detailedStatusMessage", k.DetailedStatusMessage) + populate(objectMap, "featureStatuses", k.FeatureStatuses) + populate(objectMap, "initialAgentPoolConfigurations", k.InitialAgentPoolConfigurations) + populate(objectMap, "kubernetesVersion", k.KubernetesVersion) + populate(objectMap, "managedResourceGroupConfiguration", k.ManagedResourceGroupConfiguration) + populate(objectMap, "networkConfiguration", k.NetworkConfiguration) + populate(objectMap, "nodes", k.Nodes) + populate(objectMap, "provisioningState", k.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesClusterProperties. +func (k *KubernetesClusterProperties) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aadConfiguration": + err = unpopulate(val, "AADConfiguration", &k.AADConfiguration) + delete(rawMsg, key) + case "administratorConfiguration": + err = unpopulate(val, "AdministratorConfiguration", &k.AdministratorConfiguration) + delete(rawMsg, key) + case "attachedNetworkIds": + err = unpopulate(val, "AttachedNetworkIDs", &k.AttachedNetworkIDs) + delete(rawMsg, key) + case "availableUpgrades": + err = unpopulate(val, "AvailableUpgrades", &k.AvailableUpgrades) + delete(rawMsg, key) + case "clusterId": + err = unpopulate(val, "ClusterID", &k.ClusterID) + delete(rawMsg, key) + case "connectedClusterId": + err = unpopulate(val, "ConnectedClusterID", &k.ConnectedClusterID) + delete(rawMsg, key) + case "controlPlaneKubernetesVersion": + err = unpopulate(val, "ControlPlaneKubernetesVersion", &k.ControlPlaneKubernetesVersion) + delete(rawMsg, key) + case "controlPlaneNodeConfiguration": + err = unpopulate(val, "ControlPlaneNodeConfiguration", &k.ControlPlaneNodeConfiguration) + delete(rawMsg, key) + case "detailedStatus": + err = unpopulate(val, "DetailedStatus", &k.DetailedStatus) + delete(rawMsg, key) + case "detailedStatusMessage": + err = unpopulate(val, "DetailedStatusMessage", &k.DetailedStatusMessage) + delete(rawMsg, key) + case "featureStatuses": + err = unpopulate(val, "FeatureStatuses", &k.FeatureStatuses) + delete(rawMsg, key) + case "initialAgentPoolConfigurations": + err = unpopulate(val, "InitialAgentPoolConfigurations", &k.InitialAgentPoolConfigurations) + delete(rawMsg, key) + case "kubernetesVersion": + err = unpopulate(val, "KubernetesVersion", &k.KubernetesVersion) delete(rawMsg, key) - case "registryUrl": - err = unpopulate(val, "RegistryURL", &i.RegistryURL) + case "managedResourceGroupConfiguration": + err = unpopulate(val, "ManagedResourceGroupConfiguration", &k.ManagedResourceGroupConfiguration) delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &i.Username) + case "networkConfiguration": + err = unpopulate(val, "NetworkConfiguration", &k.NetworkConfiguration) + delete(rawMsg, key) + case "nodes": + err = unpopulate(val, "Nodes", &k.Nodes) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &k.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type KeySetUser. -func (k KeySetUser) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KubernetesClusterRestartNodeParameters. +func (k KubernetesClusterRestartNodeParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "azureUserName", k.AzureUserName) - populate(objectMap, "description", k.Description) - populate(objectMap, "sshPublicKey", k.SSHPublicKey) + populate(objectMap, "nodeName", k.NodeName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type KeySetUser. -func (k *KeySetUser) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesClusterRestartNodeParameters. +func (k *KubernetesClusterRestartNodeParameters) 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", k, err) @@ -3069,14 +3661,8 @@ func (k *KeySetUser) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "azureUserName": - err = unpopulate(val, "AzureUserName", &k.AzureUserName) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &k.Description) - delete(rawMsg, key) - case "sshPublicKey": - err = unpopulate(val, "SSHPublicKey", &k.SSHPublicKey) + case "nodeName": + err = unpopulate(val, "NodeName", &k.NodeName) delete(rawMsg, key) } if err != nil { @@ -3086,17 +3672,16 @@ func (k *KeySetUser) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type KeySetUserStatus. -func (k KeySetUserStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KubernetesLabel. +func (k KubernetesLabel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "azureUserName", k.AzureUserName) - populate(objectMap, "status", k.Status) - populate(objectMap, "statusMessage", k.StatusMessage) + populate(objectMap, "key", k.Key) + populate(objectMap, "value", k.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type KeySetUserStatus. -func (k *KeySetUserStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesLabel. +func (k *KubernetesLabel) 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", k, err) @@ -3104,14 +3689,11 @@ func (k *KeySetUserStatus) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "azureUserName": - err = unpopulate(val, "AzureUserName", &k.AzureUserName) + case "key": + err = unpopulate(val, "Key", &k.Key) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &k.Status) - delete(rawMsg, key) - case "statusMessage": - err = unpopulate(val, "StatusMessage", &k.StatusMessage) + case "value": + err = unpopulate(val, "Value", &k.Value) delete(rawMsg, key) } if err != nil { @@ -3176,6 +3758,37 @@ func (l *L2Network) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type L2NetworkAttachmentConfiguration. +func (l L2NetworkAttachmentConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkId", l.NetworkID) + populate(objectMap, "pluginType", l.PluginType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type L2NetworkAttachmentConfiguration. +func (l *L2NetworkAttachmentConfiguration) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkId": + err = unpopulate(val, "NetworkID", &l.NetworkID) + delete(rawMsg, key) + case "pluginType": + err = unpopulate(val, "PluginType", &l.PluginType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type L2NetworkList. func (l L2NetworkList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3237,6 +3850,7 @@ func (l *L2NetworkPatchParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type L2NetworkProperties. func (l L2NetworkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "associatedResourceIds", l.AssociatedResourceIDs) populate(objectMap, "clusterId", l.ClusterID) populate(objectMap, "detailedStatus", l.DetailedStatus) populate(objectMap, "detailedStatusMessage", l.DetailedStatusMessage) @@ -3258,6 +3872,9 @@ func (l *L2NetworkProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "associatedResourceIds": + err = unpopulate(val, "AssociatedResourceIDs", &l.AssociatedResourceIDs) + delete(rawMsg, key) case "clusterId": err = unpopulate(val, "ClusterID", &l.ClusterID) delete(rawMsg, key) @@ -3348,6 +3965,41 @@ func (l *L3Network) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type L3NetworkAttachmentConfiguration. +func (l L3NetworkAttachmentConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipamEnabled", l.IpamEnabled) + populate(objectMap, "networkId", l.NetworkID) + populate(objectMap, "pluginType", l.PluginType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type L3NetworkAttachmentConfiguration. +func (l *L3NetworkAttachmentConfiguration) 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipamEnabled": + err = unpopulate(val, "IpamEnabled", &l.IpamEnabled) + delete(rawMsg, key) + case "networkId": + err = unpopulate(val, "NetworkID", &l.NetworkID) + delete(rawMsg, key) + case "pluginType": + err = unpopulate(val, "PluginType", &l.PluginType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type L3NetworkList. func (l L3NetworkList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3409,6 +4061,7 @@ func (l *L3NetworkPatchParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type L3NetworkProperties. func (l L3NetworkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "associatedResourceIds", l.AssociatedResourceIDs) populate(objectMap, "clusterId", l.ClusterID) populate(objectMap, "detailedStatus", l.DetailedStatus) populate(objectMap, "detailedStatusMessage", l.DetailedStatusMessage) @@ -3435,6 +4088,9 @@ func (l *L3NetworkProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "associatedResourceIds": + err = unpopulate(val, "AssociatedResourceIDs", &l.AssociatedResourceIDs) + delete(rawMsg, key) case "clusterId": err = unpopulate(val, "ClusterID", &l.ClusterID) delete(rawMsg, key) @@ -3739,6 +4395,57 @@ func (n *NetworkAttachment) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type NetworkConfiguration. +func (n NetworkConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "attachedNetworkConfiguration", n.AttachedNetworkConfiguration) + populate(objectMap, "bgpServiceLoadBalancerConfiguration", n.BgpServiceLoadBalancerConfiguration) + populate(objectMap, "cloudServicesNetworkId", n.CloudServicesNetworkID) + populate(objectMap, "cniNetworkId", n.CniNetworkID) + populate(objectMap, "dnsServiceIp", n.DNSServiceIP) + populate(objectMap, "podCidrs", n.PodCidrs) + populate(objectMap, "serviceCidrs", n.ServiceCidrs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkConfiguration. +func (n *NetworkConfiguration) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "attachedNetworkConfiguration": + err = unpopulate(val, "AttachedNetworkConfiguration", &n.AttachedNetworkConfiguration) + delete(rawMsg, key) + case "bgpServiceLoadBalancerConfiguration": + err = unpopulate(val, "BgpServiceLoadBalancerConfiguration", &n.BgpServiceLoadBalancerConfiguration) + delete(rawMsg, key) + case "cloudServicesNetworkId": + err = unpopulate(val, "CloudServicesNetworkID", &n.CloudServicesNetworkID) + delete(rawMsg, key) + case "cniNetworkId": + err = unpopulate(val, "CniNetworkID", &n.CniNetworkID) + delete(rawMsg, key) + case "dnsServiceIp": + err = unpopulate(val, "DNSServiceIP", &n.DNSServiceIP) + delete(rawMsg, key) + case "podCidrs": + err = unpopulate(val, "PodCidrs", &n.PodCidrs) + delete(rawMsg, key) + case "serviceCidrs": + err = unpopulate(val, "ServiceCidrs", &n.ServiceCidrs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type NetworkInterface. func (n NetworkInterface) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3825,108 +4532,6 @@ func (n *Nic) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Node. -func (n Node) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "bareMetalMachineId", n.BareMetalMachineID) - populate(objectMap, "imageId", n.ImageID) - populate(objectMap, "networkAttachments", n.NetworkAttachments) - populate(objectMap, "nodeName", n.NodeName) - populate(objectMap, "powerState", n.PowerState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Node. -func (n *Node) 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", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bareMetalMachineId": - err = unpopulate(val, "BareMetalMachineID", &n.BareMetalMachineID) - delete(rawMsg, key) - case "imageId": - err = unpopulate(val, "ImageID", &n.ImageID) - delete(rawMsg, key) - case "networkAttachments": - err = unpopulate(val, "NetworkAttachments", &n.NetworkAttachments) - delete(rawMsg, key) - case "nodeName": - err = unpopulate(val, "NodeName", &n.NodeName) - delete(rawMsg, key) - case "powerState": - err = unpopulate(val, "PowerState", &n.PowerState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NodeConfiguration. -func (n NodeConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "agentPoolId", n.AgentPoolID) - populate(objectMap, "agentPoolName", n.AgentPoolName) - populate(objectMap, "cpuCores", n.CPUCores) - populate(objectMap, "diskSizeGB", n.DiskSizeGB) - populate(objectMap, "memorySizeGB", n.MemorySizeGB) - populate(objectMap, "nodePoolName", n.NodePoolName) - populate(objectMap, "nodes", n.Nodes) - populate(objectMap, "vmCount", n.VMCount) - populate(objectMap, "vmSize", n.VMSize) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NodeConfiguration. -func (n *NodeConfiguration) 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", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "agentPoolId": - err = unpopulate(val, "AgentPoolID", &n.AgentPoolID) - delete(rawMsg, key) - case "agentPoolName": - err = unpopulate(val, "AgentPoolName", &n.AgentPoolName) - delete(rawMsg, key) - case "cpuCores": - err = unpopulate(val, "CPUCores", &n.CPUCores) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &n.DiskSizeGB) - delete(rawMsg, key) - case "memorySizeGB": - err = unpopulate(val, "MemorySizeGB", &n.MemorySizeGB) - delete(rawMsg, key) - case "nodePoolName": - err = unpopulate(val, "NodePoolName", &n.NodePoolName) - delete(rawMsg, key) - case "nodes": - err = unpopulate(val, "Nodes", &n.Nodes) - delete(rawMsg, key) - case "vmCount": - err = unpopulate(val, "VMCount", &n.VMCount) - delete(rawMsg, key) - case "vmSize": - err = unpopulate(val, "VMSize", &n.VMSize) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4485,6 +5090,69 @@ func (s *SSHPublicKey) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ServiceLoadBalancerBgpPeer. +func (s ServiceLoadBalancerBgpPeer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bfdEnabled", s.BfdEnabled) + populate(objectMap, "bgpMultiHop", s.BgpMultiHop) + populate(objectMap, "holdTime", s.HoldTime) + populate(objectMap, "keepAliveTime", s.KeepAliveTime) + populate(objectMap, "myAsn", s.MyAsn) + populate(objectMap, "name", s.Name) + populate(objectMap, "password", s.Password) + populate(objectMap, "peerAddress", s.PeerAddress) + populate(objectMap, "peerAsn", s.PeerAsn) + populate(objectMap, "peerPort", s.PeerPort) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceLoadBalancerBgpPeer. +func (s *ServiceLoadBalancerBgpPeer) 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 "bfdEnabled": + err = unpopulate(val, "BfdEnabled", &s.BfdEnabled) + delete(rawMsg, key) + case "bgpMultiHop": + err = unpopulate(val, "BgpMultiHop", &s.BgpMultiHop) + delete(rawMsg, key) + case "holdTime": + err = unpopulate(val, "HoldTime", &s.HoldTime) + delete(rawMsg, key) + case "keepAliveTime": + err = unpopulate(val, "KeepAliveTime", &s.KeepAliveTime) + delete(rawMsg, key) + case "myAsn": + err = unpopulate(val, "MyAsn", &s.MyAsn) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &s.Password) + delete(rawMsg, key) + case "peerAddress": + err = unpopulate(val, "PeerAddress", &s.PeerAddress) + delete(rawMsg, key) + case "peerAsn": + err = unpopulate(val, "PeerAsn", &s.PeerAsn) + delete(rawMsg, key) + case "peerPort": + err = unpopulate(val, "PeerPort", &s.PeerPort) + 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 ServicePrincipalInformation. func (s ServicePrincipalInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4937,33 +5605,6 @@ func (s *StorageApplianceSKUSlot) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StorageApplianceValidateHardwareParameters. -func (s StorageApplianceValidateHardwareParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "validationCategory", s.ValidationCategory) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StorageApplianceValidateHardwareParameters. -func (s *StorageApplianceValidateHardwareParameters) 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 "validationCategory": - err = unpopulate(val, "ValidationCategory", &s.ValidationCategory) - 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 StorageProfile. func (s StorageProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5097,6 +5738,37 @@ func (t *TrunkedNetwork) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TrunkedNetworkAttachmentConfiguration. +func (t TrunkedNetworkAttachmentConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkId", t.NetworkID) + populate(objectMap, "pluginType", t.PluginType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrunkedNetworkAttachmentConfiguration. +func (t *TrunkedNetworkAttachmentConfiguration) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkId": + err = unpopulate(val, "NetworkID", &t.NetworkID) + delete(rawMsg, key) + case "pluginType": + err = unpopulate(val, "PluginType", &t.PluginType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TrunkedNetworkList. func (t TrunkedNetworkList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5158,6 +5830,7 @@ func (t *TrunkedNetworkPatchParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrunkedNetworkProperties. func (t TrunkedNetworkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "associatedResourceIds", t.AssociatedResourceIDs) populate(objectMap, "clusterId", t.ClusterID) populate(objectMap, "detailedStatus", t.DetailedStatus) populate(objectMap, "detailedStatusMessage", t.DetailedStatusMessage) @@ -5180,6 +5853,9 @@ func (t *TrunkedNetworkProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "associatedResourceIds": + err = unpopulate(val, "AssociatedResourceIDs", &t.AssociatedResourceIDs) + delete(rawMsg, key) case "clusterId": err = unpopulate(val, "ClusterID", &t.ClusterID) delete(rawMsg, key) @@ -5467,6 +6143,7 @@ func (v *VirtualMachinePowerOffParameters) UnmarshalJSON(data []byte) error { func (v VirtualMachineProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "adminUsername", v.AdminUsername) + populate(objectMap, "availabilityZone", v.AvailabilityZone) populate(objectMap, "bareMetalMachineId", v.BareMetalMachineID) populate(objectMap, "bootMethod", v.BootMethod) populate(objectMap, "cpuCores", v.CPUCores) @@ -5504,6 +6181,9 @@ func (v *VirtualMachineProperties) UnmarshalJSON(data []byte) error { case "adminUsername": err = unpopulate(val, "AdminUsername", &v.AdminUsername) delete(rawMsg, key) + case "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &v.AvailabilityZone) + delete(rawMsg, key) case "bareMetalMachineId": err = unpopulate(val, "BareMetalMachineID", &v.BareMetalMachineID) delete(rawMsg, key) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/operations_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/operations_client.go index 5c614699bb35..9886775ce503 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/operations_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/operations_client.go @@ -41,7 +41,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Get a list of all available resource provider operations. It contains a URL link to get the next set of // results. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - 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]{ @@ -79,7 +79,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/operations_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/operations_client_example_test.go index c3f74379c9cf..1a0ee420600c 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/operations_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/operations_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Operations_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Operations_List.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/racks_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/racks_client.go index a238b57e5866..fca16b97bfdb 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/racks_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/racks_client.go @@ -29,7 +29,7 @@ type RacksClient struct { } // NewRacksClient creates a new instance of RacksClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewRacksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RacksClient, error) { @@ -48,7 +48,7 @@ func NewRacksClient(subscriptionID string, credential azcore.TokenCredential, op // be rejected as the life cycle of this resource is managed by the system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - rackName - The name of the rack. // - rackParameters - The request body. @@ -72,7 +72,7 @@ func (client *RacksClient) BeginCreateOrUpdate(ctx context.Context, resourceGrou // as the life cycle of this resource is managed by the system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *RacksClient) createOrUpdate(ctx context.Context, resourceGroupName string, rackName string, rackParameters Rack, options *RacksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, rackName, rackParameters, options) if err != nil { @@ -91,9 +91,6 @@ func (client *RacksClient) createOrUpdate(ctx context.Context, resourceGroupName // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *RacksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, rackName string, rackParameters Rack, options *RacksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}" - 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") @@ -108,7 +105,7 @@ func (client *RacksClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, rackParameters) @@ -118,7 +115,7 @@ func (client *RacksClient) createOrUpdateCreateRequest(ctx context.Context, reso // is managed by the system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - rackName - The name of the rack. // - options - RacksClientBeginDeleteOptions contains the optional parameters for the RacksClient.BeginDelete method. @@ -140,7 +137,7 @@ func (client *RacksClient) BeginDelete(ctx context.Context, resourceGroupName st // is managed by the system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *RacksClient) deleteOperation(ctx context.Context, resourceGroupName string, rackName string, options *RacksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, rackName, options) if err != nil { @@ -159,9 +156,6 @@ func (client *RacksClient) deleteOperation(ctx context.Context, resourceGroupNam // deleteCreateRequest creates the Delete request. func (client *RacksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, rackName string, options *RacksClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}" - 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") @@ -176,7 +170,7 @@ func (client *RacksClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -185,7 +179,7 @@ func (client *RacksClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Get properties of the provided rack. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - rackName - The name of the rack. // - options - RacksClientGetOptions contains the optional parameters for the RacksClient.Get method. @@ -207,9 +201,6 @@ func (client *RacksClient) Get(ctx context.Context, resourceGroupName string, ra // getCreateRequest creates the Get request. func (client *RacksClient) getCreateRequest(ctx context.Context, resourceGroupName string, rackName string, options *RacksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}" - 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") @@ -224,7 +215,7 @@ func (client *RacksClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,7 +232,7 @@ func (client *RacksClient) getHandleResponse(resp *http.Response) (RacksClientGe // NewListByResourceGroupPager - Get a list of racks in the provided resource group. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - RacksClientListByResourceGroupOptions contains the optional parameters for the RacksClient.NewListByResourceGroupPager // method. @@ -276,9 +267,6 @@ func (client *RacksClient) NewListByResourceGroupPager(resourceGroupName string, // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *RacksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *RacksClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks" - 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") @@ -289,7 +277,7 @@ func (client *RacksClient) listByResourceGroupCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,7 +294,7 @@ func (client *RacksClient) listByResourceGroupHandleResponse(resp *http.Response // NewListBySubscriptionPager - Get a list of racks in the provided subscription. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - options - RacksClientListBySubscriptionOptions contains the optional parameters for the RacksClient.NewListBySubscriptionPager // method. func (client *RacksClient) NewListBySubscriptionPager(options *RacksClientListBySubscriptionOptions) *runtime.Pager[RacksClientListBySubscriptionResponse] { @@ -340,16 +328,13 @@ func (client *RacksClient) NewListBySubscriptionPager(options *RacksClientListBy // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *RacksClient) listBySubscriptionCreateRequest(ctx context.Context, options *RacksClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/racks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) 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", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -368,7 +353,7 @@ func (client *RacksClient) listBySubscriptionHandleResponse(resp *http.Response) // can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - rackName - The name of the rack. // - rackUpdateParameters - The request body. @@ -380,7 +365,7 @@ func (client *RacksClient) BeginUpdate(ctx context.Context, resourceGroupName st return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RacksClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { return runtime.NewPollerFromResumeToken[RacksClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -391,7 +376,7 @@ func (client *RacksClient) BeginUpdate(ctx context.Context, resourceGroupName st // can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *RacksClient) update(ctx context.Context, resourceGroupName string, rackName string, rackUpdateParameters RackPatchParameters, options *RacksClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, rackName, rackUpdateParameters, options) if err != nil { @@ -410,9 +395,6 @@ func (client *RacksClient) update(ctx context.Context, resourceGroupName string, // updateCreateRequest creates the Update request. func (client *RacksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, rackName string, rackUpdateParameters RackPatchParameters, options *RacksClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}" - 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") @@ -427,7 +409,7 @@ func (client *RacksClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, rackUpdateParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/racks_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/racks_client_example_test.go index f640e714207d..a828d7e7c011 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/racks_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/racks_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Racks_ListBySubscription.json func ExampleRacksClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleRacksClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("rackName"), // Type: to.Ptr("Microsoft.NetworkCloud/racks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -60,12 +60,12 @@ func ExampleRacksClient_NewListBySubscriptionPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.RackProperties{ // AvailabilityZone: to.Ptr("1"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // DetailedStatus: to.Ptr(armnetworkcloud.RackDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("Rack is operational"), // ProvisioningState: to.Ptr(armnetworkcloud.RackProvisioningStateSucceeded), @@ -78,7 +78,7 @@ func ExampleRacksClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Racks_ListByResourceGroup.json func ExampleRacksClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -105,7 +105,7 @@ func ExampleRacksClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("rackName"), // Type: to.Ptr("Microsoft.NetworkCloud/racks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -120,12 +120,12 @@ func ExampleRacksClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.RackProperties{ // AvailabilityZone: to.Ptr("1"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // DetailedStatus: to.Ptr(armnetworkcloud.RackDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("Rack is operational"), // ProvisioningState: to.Ptr(armnetworkcloud.RackProvisioningStateSucceeded), @@ -138,7 +138,7 @@ func ExampleRacksClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Racks_Get.json func ExampleRacksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -159,7 +159,7 @@ func ExampleRacksClient_Get() { // res.Rack = armnetworkcloud.Rack{ // Name: to.Ptr("rackName"), // Type: to.Ptr("Microsoft.NetworkCloud/racks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -174,12 +174,12 @@ func ExampleRacksClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.RackProperties{ // AvailabilityZone: to.Ptr("1"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // DetailedStatus: to.Ptr(armnetworkcloud.RackDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("Rack is operational"), // ProvisioningState: to.Ptr(armnetworkcloud.RackProvisioningStateSucceeded), @@ -190,7 +190,7 @@ func ExampleRacksClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Racks_Create.json func ExampleRacksClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -208,7 +208,7 @@ func ExampleRacksClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.RackProperties{ @@ -231,7 +231,7 @@ func ExampleRacksClient_BeginCreateOrUpdate() { // res.Rack = armnetworkcloud.Rack{ // Name: to.Ptr("rackName"), // Type: to.Ptr("Microsoft.NetworkCloud/racks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -246,12 +246,12 @@ func ExampleRacksClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.RackProperties{ // AvailabilityZone: to.Ptr("1"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // DetailedStatus: to.Ptr(armnetworkcloud.RackDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("Rack is operational"), // ProvisioningState: to.Ptr(armnetworkcloud.RackProvisioningStateSucceeded), @@ -262,7 +262,7 @@ func ExampleRacksClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Racks_Delete.json func ExampleRacksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -283,7 +283,7 @@ func ExampleRacksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Racks_Patch.json func ExampleRacksClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -317,7 +317,7 @@ func ExampleRacksClient_BeginUpdate() { // res.Rack = armnetworkcloud.Rack{ // Name: to.Ptr("rackName"), // Type: to.Ptr("Microsoft.NetworkCloud/racks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -332,12 +332,12 @@ func ExampleRacksClient_BeginUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.RackProperties{ // AvailabilityZone: to.Ptr("1"), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // DetailedStatus: to.Ptr(armnetworkcloud.RackDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("Rack is operational"), // ProvisioningState: to.Ptr(armnetworkcloud.RackProvisioningStateSucceeded), diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/rackskus_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/rackskus_client.go index f1322df3b8fc..208cff9a591e 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/rackskus_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/rackskus_client.go @@ -29,7 +29,7 @@ type RackSKUsClient struct { } // NewRackSKUsClient creates a new instance of RackSKUsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewRackSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RackSKUsClient, error) { @@ -47,7 +47,7 @@ func NewRackSKUsClient(subscriptionID string, credential azcore.TokenCredential, // Get - Get the properties of the provided rack SKU. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - rackSKUName - The name of the rack SKU. // - options - RackSKUsClientGetOptions contains the optional parameters for the RackSKUsClient.Get method. func (client *RackSKUsClient) Get(ctx context.Context, rackSKUName string, options *RackSKUsClientGetOptions) (RackSKUsClientGetResponse, error) { @@ -68,9 +68,6 @@ func (client *RackSKUsClient) Get(ctx context.Context, rackSKUName string, optio // getCreateRequest creates the Get request. func (client *RackSKUsClient) getCreateRequest(ctx context.Context, rackSKUName string, options *RackSKUsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus/{rackSkuName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if rackSKUName == "" { return nil, errors.New("parameter rackSKUName cannot be empty") @@ -81,7 +78,7 @@ func (client *RackSKUsClient) getCreateRequest(ctx context.Context, rackSKUName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -98,7 +95,7 @@ func (client *RackSKUsClient) getHandleResponse(resp *http.Response) (RackSKUsCl // NewListBySubscriptionPager - Get a list of rack SKUs in the provided subscription. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - options - RackSKUsClientListBySubscriptionOptions contains the optional parameters for the RackSKUsClient.NewListBySubscriptionPager // method. func (client *RackSKUsClient) NewListBySubscriptionPager(options *RackSKUsClientListBySubscriptionOptions) *runtime.Pager[RackSKUsClientListBySubscriptionResponse] { @@ -132,16 +129,13 @@ func (client *RackSKUsClient) NewListBySubscriptionPager(options *RackSKUsClient // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *RackSKUsClient) listBySubscriptionCreateRequest(ctx context.Context, options *RackSKUsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) 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", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/rackskus_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/rackskus_client_example_test.go index 9836b8cef251..5312922900ad 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/rackskus_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/rackskus_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/RackSkus_ListBySubscription.json func ExampleRackSKUsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -44,7 +44,7 @@ func ExampleRackSKUsClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("rackSkuName"), // Type: to.Ptr("Microsoft.NetworkCloud/rackSkus"), - // ID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -134,7 +134,7 @@ func ExampleRackSKUsClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/RackSkus_Get.json func ExampleRackSKUsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -155,7 +155,7 @@ func ExampleRackSKUsClient_Get() { // res.RackSKU = armnetworkcloud.RackSKU{ // Name: to.Ptr("rackSkuName"), // Type: to.Ptr("Microsoft.NetworkCloud/rackSkus"), - // ID: to.Ptr("/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/response_types.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/response_types.go index 96b1a373fc76..1246965eccfa 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/response_types.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/response_types.go @@ -9,6 +9,31 @@ package armnetworkcloud +// AgentPoolsClientCreateOrUpdateResponse contains the response from method AgentPoolsClient.BeginCreateOrUpdate. +type AgentPoolsClientCreateOrUpdateResponse struct { + AgentPool +} + +// AgentPoolsClientDeleteResponse contains the response from method AgentPoolsClient.BeginDelete. +type AgentPoolsClientDeleteResponse struct { + // placeholder for future response values +} + +// AgentPoolsClientGetResponse contains the response from method AgentPoolsClient.Get. +type AgentPoolsClientGetResponse struct { + AgentPool +} + +// AgentPoolsClientListByKubernetesClusterResponse contains the response from method AgentPoolsClient.NewListByKubernetesClusterPager. +type AgentPoolsClientListByKubernetesClusterResponse struct { + AgentPoolList +} + +// AgentPoolsClientUpdateResponse contains the response from method AgentPoolsClient.BeginUpdate. +type AgentPoolsClientUpdateResponse struct { + AgentPool +} + // BareMetalMachineKeySetsClientCreateOrUpdateResponse contains the response from method BareMetalMachineKeySetsClient.BeginCreateOrUpdate. type BareMetalMachineKeySetsClientCreateOrUpdateResponse struct { BareMetalMachineKeySet @@ -24,8 +49,8 @@ type BareMetalMachineKeySetsClientGetResponse struct { BareMetalMachineKeySet } -// BareMetalMachineKeySetsClientListByResourceGroupResponse contains the response from method BareMetalMachineKeySetsClient.NewListByResourceGroupPager. -type BareMetalMachineKeySetsClientListByResourceGroupResponse struct { +// BareMetalMachineKeySetsClientListByClusterResponse contains the response from method BareMetalMachineKeySetsClient.NewListByClusterPager. +type BareMetalMachineKeySetsClientListByClusterResponse struct { BareMetalMachineKeySetList } @@ -134,8 +159,8 @@ type BmcKeySetsClientGetResponse struct { BmcKeySet } -// BmcKeySetsClientListByResourceGroupResponse contains the response from method BmcKeySetsClient.NewListByResourceGroupPager. -type BmcKeySetsClientListByResourceGroupResponse struct { +// BmcKeySetsClientListByClusterResponse contains the response from method BmcKeySetsClient.NewListByClusterPager. +type BmcKeySetsClientListByClusterResponse struct { BmcKeySetList } @@ -259,8 +284,8 @@ type ConsolesClientGetResponse struct { Console } -// ConsolesClientListByResourceGroupResponse contains the response from method ConsolesClient.NewListByResourceGroupPager. -type ConsolesClientListByResourceGroupResponse struct { +// ConsolesClientListByVirtualMachineResponse contains the response from method ConsolesClient.NewListByVirtualMachinePager. +type ConsolesClientListByVirtualMachineResponse struct { ConsoleList } @@ -269,69 +294,39 @@ type ConsolesClientUpdateResponse struct { Console } -// DefaultCniNetworksClientCreateOrUpdateResponse contains the response from method DefaultCniNetworksClient.BeginCreateOrUpdate. -type DefaultCniNetworksClientCreateOrUpdateResponse struct { - DefaultCniNetwork +// KubernetesClustersClientCreateOrUpdateResponse contains the response from method KubernetesClustersClient.BeginCreateOrUpdate. +type KubernetesClustersClientCreateOrUpdateResponse struct { + KubernetesCluster } -// DefaultCniNetworksClientDeleteResponse contains the response from method DefaultCniNetworksClient.BeginDelete. -type DefaultCniNetworksClientDeleteResponse struct { +// KubernetesClustersClientDeleteResponse contains the response from method KubernetesClustersClient.BeginDelete. +type KubernetesClustersClientDeleteResponse struct { // placeholder for future response values } -// DefaultCniNetworksClientGetResponse contains the response from method DefaultCniNetworksClient.Get. -type DefaultCniNetworksClientGetResponse struct { - DefaultCniNetwork +// KubernetesClustersClientGetResponse contains the response from method KubernetesClustersClient.Get. +type KubernetesClustersClientGetResponse struct { + KubernetesCluster } -// DefaultCniNetworksClientListByResourceGroupResponse contains the response from method DefaultCniNetworksClient.NewListByResourceGroupPager. -type DefaultCniNetworksClientListByResourceGroupResponse struct { - DefaultCniNetworkList +// KubernetesClustersClientListByResourceGroupResponse contains the response from method KubernetesClustersClient.NewListByResourceGroupPager. +type KubernetesClustersClientListByResourceGroupResponse struct { + KubernetesClusterList } -// DefaultCniNetworksClientListBySubscriptionResponse contains the response from method DefaultCniNetworksClient.NewListBySubscriptionPager. -type DefaultCniNetworksClientListBySubscriptionResponse struct { - DefaultCniNetworkList +// KubernetesClustersClientListBySubscriptionResponse contains the response from method KubernetesClustersClient.NewListBySubscriptionPager. +type KubernetesClustersClientListBySubscriptionResponse struct { + KubernetesClusterList } -// DefaultCniNetworksClientUpdateResponse contains the response from method DefaultCniNetworksClient.Update. -type DefaultCniNetworksClientUpdateResponse struct { - DefaultCniNetwork -} - -// HybridAksClustersClientCreateOrUpdateResponse contains the response from method HybridAksClustersClient.BeginCreateOrUpdate. -type HybridAksClustersClientCreateOrUpdateResponse struct { - HybridAksCluster -} - -// HybridAksClustersClientDeleteResponse contains the response from method HybridAksClustersClient.BeginDelete. -type HybridAksClustersClientDeleteResponse struct { +// KubernetesClustersClientRestartNodeResponse contains the response from method KubernetesClustersClient.BeginRestartNode. +type KubernetesClustersClientRestartNodeResponse struct { // placeholder for future response values } -// HybridAksClustersClientGetResponse contains the response from method HybridAksClustersClient.Get. -type HybridAksClustersClientGetResponse struct { - HybridAksCluster -} - -// HybridAksClustersClientListByResourceGroupResponse contains the response from method HybridAksClustersClient.NewListByResourceGroupPager. -type HybridAksClustersClientListByResourceGroupResponse struct { - HybridAksClusterList -} - -// HybridAksClustersClientListBySubscriptionResponse contains the response from method HybridAksClustersClient.NewListBySubscriptionPager. -type HybridAksClustersClientListBySubscriptionResponse struct { - HybridAksClusterList -} - -// HybridAksClustersClientRestartNodeResponse contains the response from method HybridAksClustersClient.BeginRestartNode. -type HybridAksClustersClientRestartNodeResponse struct { - // placeholder for future response values -} - -// HybridAksClustersClientUpdateResponse contains the response from method HybridAksClustersClient.Update. -type HybridAksClustersClientUpdateResponse struct { - HybridAksCluster +// KubernetesClustersClientUpdateResponse contains the response from method KubernetesClustersClient.BeginUpdate. +type KubernetesClustersClientUpdateResponse struct { + KubernetesCluster } // L2NetworksClientCreateOrUpdateResponse contains the response from method L2NetworksClient.BeginCreateOrUpdate. @@ -409,8 +404,8 @@ type MetricsConfigurationsClientGetResponse struct { ClusterMetricsConfiguration } -// MetricsConfigurationsClientListByResourceGroupResponse contains the response from method MetricsConfigurationsClient.NewListByResourceGroupPager. -type MetricsConfigurationsClientListByResourceGroupResponse struct { +// MetricsConfigurationsClientListByClusterResponse contains the response from method MetricsConfigurationsClient.NewListByClusterPager. +type MetricsConfigurationsClientListByClusterResponse struct { ClusterMetricsConfigurationList } @@ -509,11 +504,6 @@ type StorageAppliancesClientUpdateResponse struct { StorageAppliance } -// StorageAppliancesClientValidateHardwareResponse contains the response from method StorageAppliancesClient.BeginValidateHardware. -type StorageAppliancesClientValidateHardwareResponse struct { - // placeholder for future response values -} - // TrunkedNetworksClientCreateOrUpdateResponse contains the response from method TrunkedNetworksClient.BeginCreateOrUpdate. type TrunkedNetworksClientCreateOrUpdateResponse struct { TrunkedNetwork diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/storageappliances_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/storageappliances_client.go index b0b64e0c12f8..4cd5e9dde285 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/storageappliances_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/storageappliances_client.go @@ -29,7 +29,7 @@ type StorageAppliancesClient struct { } // NewStorageAppliancesClient creates a new instance of StorageAppliancesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewStorageAppliancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StorageAppliancesClient, error) { @@ -48,7 +48,7 @@ func NewStorageAppliancesClient(subscriptionID string, credential azcore.TokenCr // requests will be rejected as the life cycle of this resource is managed by the system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - storageApplianceName - The name of the storage appliance. // - storageApplianceParameters - The request body. @@ -72,7 +72,7 @@ func (client *StorageAppliancesClient) BeginCreateOrUpdate(ctx context.Context, // will be rejected as the life cycle of this resource is managed by the system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *StorageAppliancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, storageApplianceName string, storageApplianceParameters StorageAppliance, options *StorageAppliancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, storageApplianceName, storageApplianceParameters, options) if err != nil { @@ -91,9 +91,6 @@ func (client *StorageAppliancesClient) createOrUpdate(ctx context.Context, resou // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *StorageAppliancesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, storageApplianceName string, storageApplianceParameters StorageAppliance, options *StorageAppliancesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}" - 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") @@ -108,7 +105,7 @@ func (client *StorageAppliancesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, storageApplianceParameters) @@ -118,7 +115,7 @@ func (client *StorageAppliancesClient) createOrUpdateCreateRequest(ctx context.C // of this resource is managed by the system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - storageApplianceName - The name of the storage appliance. // - options - StorageAppliancesClientBeginDeleteOptions contains the optional parameters for the StorageAppliancesClient.BeginDelete @@ -141,7 +138,7 @@ func (client *StorageAppliancesClient) BeginDelete(ctx context.Context, resource // resource is managed by the system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *StorageAppliancesClient) deleteOperation(ctx context.Context, resourceGroupName string, storageApplianceName string, options *StorageAppliancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, storageApplianceName, options) if err != nil { @@ -160,9 +157,6 @@ func (client *StorageAppliancesClient) deleteOperation(ctx context.Context, reso // deleteCreateRequest creates the Delete request. func (client *StorageAppliancesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, storageApplianceName string, options *StorageAppliancesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}" - 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") @@ -177,7 +171,7 @@ func (client *StorageAppliancesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +180,7 @@ func (client *StorageAppliancesClient) deleteCreateRequest(ctx context.Context, // BeginDisableRemoteVendorManagement - Disable remote vendor management of the provided storage appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - storageApplianceName - The name of the storage appliance. // - options - StorageAppliancesClientBeginDisableRemoteVendorManagementOptions contains the optional parameters for the StorageAppliancesClient.BeginDisableRemoteVendorManagement @@ -208,7 +202,7 @@ func (client *StorageAppliancesClient) BeginDisableRemoteVendorManagement(ctx co // DisableRemoteVendorManagement - Disable remote vendor management of the provided storage appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *StorageAppliancesClient) disableRemoteVendorManagement(ctx context.Context, resourceGroupName string, storageApplianceName string, options *StorageAppliancesClientBeginDisableRemoteVendorManagementOptions) (*http.Response, error) { req, err := client.disableRemoteVendorManagementCreateRequest(ctx, resourceGroupName, storageApplianceName, options) if err != nil { @@ -227,9 +221,6 @@ func (client *StorageAppliancesClient) disableRemoteVendorManagement(ctx context // disableRemoteVendorManagementCreateRequest creates the DisableRemoteVendorManagement request. func (client *StorageAppliancesClient) disableRemoteVendorManagementCreateRequest(ctx context.Context, resourceGroupName string, storageApplianceName string, options *StorageAppliancesClientBeginDisableRemoteVendorManagementOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/disableRemoteVendorManagement" - 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") @@ -244,7 +235,7 @@ func (client *StorageAppliancesClient) disableRemoteVendorManagementCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +244,7 @@ func (client *StorageAppliancesClient) disableRemoteVendorManagementCreateReques // BeginEnableRemoteVendorManagement - Enable remote vendor management of the provided storage appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - storageApplianceName - The name of the storage appliance. // - options - StorageAppliancesClientBeginEnableRemoteVendorManagementOptions contains the optional parameters for the StorageAppliancesClient.BeginEnableRemoteVendorManagement @@ -275,7 +266,7 @@ func (client *StorageAppliancesClient) BeginEnableRemoteVendorManagement(ctx con // EnableRemoteVendorManagement - Enable remote vendor management of the provided storage appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *StorageAppliancesClient) enableRemoteVendorManagement(ctx context.Context, resourceGroupName string, storageApplianceName string, options *StorageAppliancesClientBeginEnableRemoteVendorManagementOptions) (*http.Response, error) { req, err := client.enableRemoteVendorManagementCreateRequest(ctx, resourceGroupName, storageApplianceName, options) if err != nil { @@ -294,9 +285,6 @@ func (client *StorageAppliancesClient) enableRemoteVendorManagement(ctx context. // enableRemoteVendorManagementCreateRequest creates the EnableRemoteVendorManagement request. func (client *StorageAppliancesClient) enableRemoteVendorManagementCreateRequest(ctx context.Context, resourceGroupName string, storageApplianceName string, options *StorageAppliancesClientBeginEnableRemoteVendorManagementOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/enableRemoteVendorManagement" - 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") @@ -311,7 +299,7 @@ func (client *StorageAppliancesClient) enableRemoteVendorManagementCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.StorageApplianceEnableRemoteVendorManagementParameters != nil { @@ -323,7 +311,7 @@ func (client *StorageAppliancesClient) enableRemoteVendorManagementCreateRequest // Get - Get properties of the provided storage appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - storageApplianceName - The name of the storage appliance. // - options - StorageAppliancesClientGetOptions contains the optional parameters for the StorageAppliancesClient.Get method. @@ -345,9 +333,6 @@ func (client *StorageAppliancesClient) Get(ctx context.Context, resourceGroupNam // getCreateRequest creates the Get request. func (client *StorageAppliancesClient) getCreateRequest(ctx context.Context, resourceGroupName string, storageApplianceName string, options *StorageAppliancesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}" - 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") @@ -362,7 +347,7 @@ func (client *StorageAppliancesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -379,7 +364,7 @@ func (client *StorageAppliancesClient) getHandleResponse(resp *http.Response) (S // NewListByResourceGroupPager - Get a list of storage appliances in the provided resource group. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - StorageAppliancesClientListByResourceGroupOptions contains the optional parameters for the StorageAppliancesClient.NewListByResourceGroupPager // method. @@ -414,9 +399,6 @@ func (client *StorageAppliancesClient) NewListByResourceGroupPager(resourceGroup // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *StorageAppliancesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *StorageAppliancesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances" - 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") @@ -427,7 +409,7 @@ func (client *StorageAppliancesClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -444,7 +426,7 @@ func (client *StorageAppliancesClient) listByResourceGroupHandleResponse(resp *h // NewListBySubscriptionPager - Get a list of storage appliances in the provided subscription. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - options - StorageAppliancesClientListBySubscriptionOptions contains the optional parameters for the StorageAppliancesClient.NewListBySubscriptionPager // method. func (client *StorageAppliancesClient) NewListBySubscriptionPager(options *StorageAppliancesClientListBySubscriptionOptions) *runtime.Pager[StorageAppliancesClientListBySubscriptionResponse] { @@ -478,16 +460,13 @@ func (client *StorageAppliancesClient) NewListBySubscriptionPager(options *Stora // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *StorageAppliancesClient) listBySubscriptionCreateRequest(ctx context.Context, options *StorageAppliancesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/storageAppliances" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) 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", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -505,7 +484,7 @@ func (client *StorageAppliancesClient) listBySubscriptionHandleResponse(resp *ht // BeginRunReadCommands - Run and retrieve output from read only commands on the provided storage appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - storageApplianceName - The name of the storage appliance. // - storageApplianceRunReadCommandsParameters - The request body. @@ -528,7 +507,7 @@ func (client *StorageAppliancesClient) BeginRunReadCommands(ctx context.Context, // RunReadCommands - Run and retrieve output from read only commands on the provided storage appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *StorageAppliancesClient) runReadCommands(ctx context.Context, resourceGroupName string, storageApplianceName string, storageApplianceRunReadCommandsParameters StorageApplianceRunReadCommandsParameters, options *StorageAppliancesClientBeginRunReadCommandsOptions) (*http.Response, error) { req, err := client.runReadCommandsCreateRequest(ctx, resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters, options) if err != nil { @@ -547,9 +526,6 @@ func (client *StorageAppliancesClient) runReadCommands(ctx context.Context, reso // runReadCommandsCreateRequest creates the RunReadCommands request. func (client *StorageAppliancesClient) runReadCommandsCreateRequest(ctx context.Context, resourceGroupName string, storageApplianceName string, storageApplianceRunReadCommandsParameters StorageApplianceRunReadCommandsParameters, options *StorageAppliancesClientBeginRunReadCommandsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/runReadCommands" - 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") @@ -564,17 +540,17 @@ func (client *StorageAppliancesClient) runReadCommandsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, storageApplianceRunReadCommandsParameters) } -// BeginUpdate - Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. +// BeginUpdate - Update properties of the provided storage appliance, or update tags associated with the storage appliance // Properties and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - storageApplianceName - The name of the storage appliance. // - storageApplianceUpdateParameters - The request body. @@ -587,18 +563,18 @@ func (client *StorageAppliancesClient) BeginUpdate(ctx context.Context, resource return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[StorageAppliancesClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { return runtime.NewPollerFromResumeToken[StorageAppliancesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } -// Update - Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties +// Update - Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties // and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *StorageAppliancesClient) update(ctx context.Context, resourceGroupName string, storageApplianceName string, storageApplianceUpdateParameters StorageAppliancePatchParameters, options *StorageAppliancesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, storageApplianceName, storageApplianceUpdateParameters, options) if err != nil { @@ -617,9 +593,6 @@ func (client *StorageAppliancesClient) update(ctx context.Context, resourceGroup // updateCreateRequest creates the Update request. func (client *StorageAppliancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, storageApplianceName string, storageApplianceUpdateParameters StorageAppliancePatchParameters, options *StorageAppliancesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}" - 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") @@ -634,76 +607,8 @@ func (client *StorageAppliancesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, storageApplianceUpdateParameters) } - -// BeginValidateHardware - Validate the hardware of the provided storage appliance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - storageApplianceName - The name of the storage appliance. -// - storageApplianceValidateHardwareParameters - The request body. -// - options - StorageAppliancesClientBeginValidateHardwareOptions contains the optional parameters for the StorageAppliancesClient.BeginValidateHardware -// method. -func (client *StorageAppliancesClient) BeginValidateHardware(ctx context.Context, resourceGroupName string, storageApplianceName string, storageApplianceValidateHardwareParameters StorageApplianceValidateHardwareParameters, options *StorageAppliancesClientBeginValidateHardwareOptions) (*runtime.Poller[StorageAppliancesClientValidateHardwareResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.validateHardware(ctx, resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[StorageAppliancesClientValidateHardwareResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[StorageAppliancesClientValidateHardwareResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// ValidateHardware - Validate the hardware of the provided storage appliance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-12-12-preview -func (client *StorageAppliancesClient) validateHardware(ctx context.Context, resourceGroupName string, storageApplianceName string, storageApplianceValidateHardwareParameters StorageApplianceValidateHardwareParameters, options *StorageAppliancesClientBeginValidateHardwareOptions) (*http.Response, error) { - req, err := client.validateHardwareCreateRequest(ctx, resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// validateHardwareCreateRequest creates the ValidateHardware request. -func (client *StorageAppliancesClient) validateHardwareCreateRequest(ctx context.Context, resourceGroupName string, storageApplianceName string, storageApplianceValidateHardwareParameters StorageApplianceValidateHardwareParameters, options *StorageAppliancesClientBeginValidateHardwareOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/validateHardware" - 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 storageApplianceName == "" { - return nil, errors.New("parameter storageApplianceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{storageApplianceName}", url.PathEscape(storageApplianceName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, storageApplianceValidateHardwareParameters) -} diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/storageappliances_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/storageappliances_client_example_test.go index 7c2688eea2cb..a4a09da33858 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/storageappliances_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/storageappliances_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/StorageAppliances_ListBySubscription.json func ExampleStorageAppliancesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleStorageAppliancesClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("storageApplianceName"), // Type: to.Ptr("Microsoft.NetworkCloud/storageAppliances"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/storageAppliances/storageApplianceName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/storageAppliances/storageApplianceName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -60,7 +60,7 @@ func ExampleStorageAppliancesClient_NewListBySubscriptionPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.StorageApplianceProperties{ @@ -69,12 +69,12 @@ func ExampleStorageAppliancesClient_NewListBySubscriptionPager() { // }, // Capacity: to.Ptr[int64](893), // CapacityUsed: to.Ptr[int64](500), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // DetailedStatus: to.Ptr(armnetworkcloud.StorageApplianceDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("Storage appliance is up and running"), // ManagementIPv4Address: to.Ptr("192.0.2.2"), // ProvisioningState: to.Ptr(armnetworkcloud.StorageApplianceProvisioningStateSucceeded), - // RackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // RackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // RackSlot: to.Ptr[int64](1), // RemoteVendorManagementFeature: to.Ptr(armnetworkcloud.RemoteVendorManagementFeatureSupported), // RemoteVendorManagementStatus: to.Ptr(armnetworkcloud.RemoteVendorManagementStatusEnabled), @@ -86,7 +86,7 @@ func ExampleStorageAppliancesClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/StorageAppliances_ListByResourceGroup.json func ExampleStorageAppliancesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -113,7 +113,7 @@ func ExampleStorageAppliancesClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("storageApplianceName"), // Type: to.Ptr("Microsoft.NetworkCloud/storageAppliances"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/storageAppliances/storageApplianceName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/storageAppliances/storageApplianceName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -128,7 +128,7 @@ func ExampleStorageAppliancesClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.StorageApplianceProperties{ @@ -137,12 +137,12 @@ func ExampleStorageAppliancesClient_NewListByResourceGroupPager() { // }, // Capacity: to.Ptr[int64](893), // CapacityUsed: to.Ptr[int64](500), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // DetailedStatus: to.Ptr(armnetworkcloud.StorageApplianceDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("Storage appliance is up and running"), // ManagementIPv4Address: to.Ptr("192.0.2.2"), // ProvisioningState: to.Ptr(armnetworkcloud.StorageApplianceProvisioningStateSucceeded), - // RackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // RackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // RackSlot: to.Ptr[int64](1), // RemoteVendorManagementFeature: to.Ptr(armnetworkcloud.RemoteVendorManagementFeatureSupported), // RemoteVendorManagementStatus: to.Ptr(armnetworkcloud.RemoteVendorManagementStatusEnabled), @@ -154,7 +154,7 @@ func ExampleStorageAppliancesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/StorageAppliances_Get.json func ExampleStorageAppliancesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +175,7 @@ func ExampleStorageAppliancesClient_Get() { // res.StorageAppliance = armnetworkcloud.StorageAppliance{ // Name: to.Ptr("storageApplianceName"), // Type: to.Ptr("Microsoft.NetworkCloud/storageAppliances"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/storageAppliances/storageApplianceName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/storageAppliances/storageApplianceName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -190,7 +190,7 @@ func ExampleStorageAppliancesClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.StorageApplianceProperties{ @@ -199,12 +199,12 @@ func ExampleStorageAppliancesClient_Get() { // }, // Capacity: to.Ptr[int64](893), // CapacityUsed: to.Ptr[int64](500), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // DetailedStatus: to.Ptr(armnetworkcloud.StorageApplianceDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("Storage appliance is up and running"), // ManagementIPv4Address: to.Ptr("192.0.2.2"), // ProvisioningState: to.Ptr(armnetworkcloud.StorageApplianceProvisioningStateSucceeded), - // RackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // RackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // RackSlot: to.Ptr[int64](1), // RemoteVendorManagementFeature: to.Ptr(armnetworkcloud.RemoteVendorManagementFeatureSupported), // RemoteVendorManagementStatus: to.Ptr(armnetworkcloud.RemoteVendorManagementStatusEnabled), @@ -214,7 +214,7 @@ func ExampleStorageAppliancesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/StorageAppliances_Create.json func ExampleStorageAppliancesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -232,7 +232,7 @@ func ExampleStorageAppliancesClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.StorageApplianceProperties{ @@ -240,7 +240,7 @@ func ExampleStorageAppliancesClient_BeginCreateOrUpdate() { Password: to.Ptr("{password}"), Username: to.Ptr("adminUser"), }, - RackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + RackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), RackSlot: to.Ptr[int64](1), SerialNumber: to.Ptr("BM1219XXX"), StorageApplianceSKUID: to.Ptr("684E-3B16-399E"), @@ -259,7 +259,7 @@ func ExampleStorageAppliancesClient_BeginCreateOrUpdate() { // res.StorageAppliance = armnetworkcloud.StorageAppliance{ // Name: to.Ptr("storageApplianceName"), // Type: to.Ptr("Microsoft.NetworkCloud/storageAppliances"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/storageAppliances/storageApplianceName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/storageAppliances/storageApplianceName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -274,7 +274,7 @@ func ExampleStorageAppliancesClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.StorageApplianceProperties{ @@ -283,12 +283,12 @@ func ExampleStorageAppliancesClient_BeginCreateOrUpdate() { // }, // Capacity: to.Ptr[int64](893), // CapacityUsed: to.Ptr[int64](500), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // DetailedStatus: to.Ptr(armnetworkcloud.StorageApplianceDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("Storage appliance is up and running"), // ManagementIPv4Address: to.Ptr("192.0.2.2"), // ProvisioningState: to.Ptr(armnetworkcloud.StorageApplianceProvisioningStateSucceeded), - // RackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // RackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // RackSlot: to.Ptr[int64](1), // RemoteVendorManagementFeature: to.Ptr(armnetworkcloud.RemoteVendorManagementFeatureSupported), // RemoteVendorManagementStatus: to.Ptr(armnetworkcloud.RemoteVendorManagementStatusEnabled), @@ -298,7 +298,7 @@ func ExampleStorageAppliancesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/StorageAppliances_Delete.json func ExampleStorageAppliancesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -319,7 +319,7 @@ func ExampleStorageAppliancesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/StorageAppliances_Patch.json func ExampleStorageAppliancesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -352,7 +352,7 @@ func ExampleStorageAppliancesClient_BeginUpdate() { // res.StorageAppliance = armnetworkcloud.StorageAppliance{ // Name: to.Ptr("storageApplianceName"), // Type: to.Ptr("Microsoft.NetworkCloud/storageAppliances"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/storageAppliances/storageApplianceName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/storageAppliances/storageApplianceName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -367,7 +367,7 @@ func ExampleStorageAppliancesClient_BeginUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.StorageApplianceProperties{ @@ -376,12 +376,12 @@ func ExampleStorageAppliancesClient_BeginUpdate() { // }, // Capacity: to.Ptr[int64](893), // CapacityUsed: to.Ptr[int64](500), - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // DetailedStatus: to.Ptr(armnetworkcloud.StorageApplianceDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("Storage appliance is up and running"), // ManagementIPv4Address: to.Ptr("192.0.2.2"), // ProvisioningState: to.Ptr(armnetworkcloud.StorageApplianceProvisioningStateSucceeded), - // RackID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // RackID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // RackSlot: to.Ptr[int64](1), // RemoteVendorManagementFeature: to.Ptr(armnetworkcloud.RemoteVendorManagementFeatureSupported), // RemoteVendorManagementStatus: to.Ptr(armnetworkcloud.RemoteVendorManagementStatusEnabled), @@ -391,7 +391,7 @@ func ExampleStorageAppliancesClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_DisableRemoteVendorManagement.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/StorageAppliances_DisableRemoteVendorManagement.json func ExampleStorageAppliancesClient_BeginDisableRemoteVendorManagement() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -412,7 +412,7 @@ func ExampleStorageAppliancesClient_BeginDisableRemoteVendorManagement() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_EnableRemoteVendorManagement.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/StorageAppliances_EnableRemoteVendorManagement.json func ExampleStorageAppliancesClient_BeginEnableRemoteVendorManagement() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -437,7 +437,7 @@ func ExampleStorageAppliancesClient_BeginEnableRemoteVendorManagement() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_RunReadCommands.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/StorageAppliances_RunReadCommands.json func ExampleStorageAppliancesClient_BeginRunReadCommands() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -463,26 +463,3 @@ func ExampleStorageAppliancesClient_BeginRunReadCommands() { log.Fatalf("failed to pull the result: %v", err) } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ValidateHardware.json -func ExampleStorageAppliancesClient_BeginValidateHardware() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkcloud.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageAppliancesClient().BeginValidateHardware(ctx, "resourceGroupName", "storageApplianceName", armnetworkcloud.StorageApplianceValidateHardwareParameters{ - ValidationCategory: to.Ptr(armnetworkcloud.StorageApplianceHardwareValidationCategoryBasicValidation), - }, 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/networkcloud/armnetworkcloud/trunkednetworks_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/trunkednetworks_client.go index ae0065b04e55..52e3ec4499d6 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/trunkednetworks_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/trunkednetworks_client.go @@ -29,7 +29,7 @@ type TrunkedNetworksClient struct { } // NewTrunkedNetworksClient creates a new instance of TrunkedNetworksClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewTrunkedNetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TrunkedNetworksClient, error) { @@ -47,7 +47,7 @@ func NewTrunkedNetworksClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Create a new trunked network or update the properties of the existing trunked network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trunkedNetworkName - The name of the trunked network. // - trunkedNetworkParameters - The request body. @@ -70,7 +70,7 @@ func (client *TrunkedNetworksClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Create a new trunked network or update the properties of the existing trunked network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *TrunkedNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, trunkedNetworkName string, trunkedNetworkParameters TrunkedNetwork, options *TrunkedNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, trunkedNetworkName, trunkedNetworkParameters, options) if err != nil { @@ -89,9 +89,6 @@ func (client *TrunkedNetworksClient) createOrUpdate(ctx context.Context, resourc // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *TrunkedNetworksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, trunkedNetworkName string, trunkedNetworkParameters TrunkedNetwork, options *TrunkedNetworksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" - 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") @@ -106,7 +103,7 @@ func (client *TrunkedNetworksClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, trunkedNetworkParameters) @@ -115,7 +112,7 @@ func (client *TrunkedNetworksClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Delete the provided trunked network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trunkedNetworkName - The name of the trunked network. // - options - TrunkedNetworksClientBeginDeleteOptions contains the optional parameters for the TrunkedNetworksClient.BeginDelete @@ -137,7 +134,7 @@ func (client *TrunkedNetworksClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete the provided trunked network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *TrunkedNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, trunkedNetworkName string, options *TrunkedNetworksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, trunkedNetworkName, options) if err != nil { @@ -156,9 +153,6 @@ func (client *TrunkedNetworksClient) deleteOperation(ctx context.Context, resour // deleteCreateRequest creates the Delete request. func (client *TrunkedNetworksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, trunkedNetworkName string, options *TrunkedNetworksClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" - 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") @@ -173,7 +167,7 @@ func (client *TrunkedNetworksClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +176,7 @@ func (client *TrunkedNetworksClient) deleteCreateRequest(ctx context.Context, re // Get - Get properties of the provided trunked network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trunkedNetworkName - The name of the trunked network. // - options - TrunkedNetworksClientGetOptions contains the optional parameters for the TrunkedNetworksClient.Get method. @@ -204,9 +198,6 @@ func (client *TrunkedNetworksClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *TrunkedNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, trunkedNetworkName string, options *TrunkedNetworksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" - 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") @@ -221,7 +212,7 @@ func (client *TrunkedNetworksClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +229,7 @@ func (client *TrunkedNetworksClient) getHandleResponse(resp *http.Response) (Tru // NewListByResourceGroupPager - Get a list of trunked networks in the provided resource group. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - TrunkedNetworksClientListByResourceGroupOptions contains the optional parameters for the TrunkedNetworksClient.NewListByResourceGroupPager // method. @@ -273,9 +264,6 @@ func (client *TrunkedNetworksClient) NewListByResourceGroupPager(resourceGroupNa // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *TrunkedNetworksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *TrunkedNetworksClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks" - 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") @@ -286,7 +274,7 @@ func (client *TrunkedNetworksClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,7 +291,7 @@ func (client *TrunkedNetworksClient) listByResourceGroupHandleResponse(resp *htt // NewListBySubscriptionPager - Get a list of trunked networks in the provided subscription. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - options - TrunkedNetworksClientListBySubscriptionOptions contains the optional parameters for the TrunkedNetworksClient.NewListBySubscriptionPager // method. func (client *TrunkedNetworksClient) NewListBySubscriptionPager(options *TrunkedNetworksClientListBySubscriptionOptions) *runtime.Pager[TrunkedNetworksClientListBySubscriptionResponse] { @@ -337,16 +325,13 @@ func (client *TrunkedNetworksClient) NewListBySubscriptionPager(options *Trunked // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *TrunkedNetworksClient) listBySubscriptionCreateRequest(ctx context.Context, options *TrunkedNetworksClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/trunkedNetworks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) 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", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,7 +349,7 @@ func (client *TrunkedNetworksClient) listBySubscriptionHandleResponse(resp *http // Update - Update tags associated with the provided trunked network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - trunkedNetworkName - The name of the trunked network. // - trunkedNetworkUpdateParameters - The request body. @@ -387,9 +372,6 @@ func (client *TrunkedNetworksClient) Update(ctx context.Context, resourceGroupNa // updateCreateRequest creates the Update request. func (client *TrunkedNetworksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, trunkedNetworkName string, trunkedNetworkUpdateParameters TrunkedNetworkPatchParameters, options *TrunkedNetworksClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" - 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") @@ -404,7 +386,7 @@ func (client *TrunkedNetworksClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, trunkedNetworkUpdateParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/trunkednetworks_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/trunkednetworks_client_example_test.go index de3c74c92023..9a207c5c940b 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/trunkednetworks_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/trunkednetworks_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/TrunkedNetworks_ListBySubscription.json func ExampleTrunkedNetworksClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleTrunkedNetworksClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("trunkedNetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/trunkedNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -60,33 +60,30 @@ func ExampleTrunkedNetworksClient_NewListBySubscriptionPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.TrunkedNetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.TrunkedNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Trunked network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.TrunkedNetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Trunked network is up"), // InterfaceName: to.Ptr("eth0"), // IsolationDomainIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, // ProvisioningState: to.Ptr(armnetworkcloud.TrunkedNetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // Vlans: []*int64{ - // to.Ptr[int64](12), - // to.Ptr[int64](14)}, - // }, - // }}, - // } + // Vlans: []*int64{ + // to.Ptr[int64](12), + // to.Ptr[int64](14)}, + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/TrunkedNetworks_ListByResourceGroup.json func ExampleTrunkedNetworksClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -113,7 +110,7 @@ func ExampleTrunkedNetworksClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("trunkedNetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/trunkedNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -128,33 +125,30 @@ func ExampleTrunkedNetworksClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.TrunkedNetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.TrunkedNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Trunked network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.TrunkedNetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Trunked network is up"), // InterfaceName: to.Ptr("eth0"), // IsolationDomainIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, // ProvisioningState: to.Ptr(armnetworkcloud.TrunkedNetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // Vlans: []*int64{ - // to.Ptr[int64](12), - // to.Ptr[int64](14)}, - // }, - // }}, - // } + // Vlans: []*int64{ + // to.Ptr[int64](12), + // to.Ptr[int64](14)}, + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/TrunkedNetworks_Get.json func ExampleTrunkedNetworksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +169,7 @@ func ExampleTrunkedNetworksClient_Get() { // res.TrunkedNetwork = armnetworkcloud.TrunkedNetwork{ // Name: to.Ptr("trunkedNetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/trunkedNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -190,31 +184,28 @@ func ExampleTrunkedNetworksClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.TrunkedNetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.TrunkedNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Trunked network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.TrunkedNetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Trunked network is up"), // InterfaceName: to.Ptr("eth0"), // IsolationDomainIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, // ProvisioningState: to.Ptr(armnetworkcloud.TrunkedNetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // Vlans: []*int64{ - // to.Ptr[int64](12), - // to.Ptr[int64](14)}, - // }, - // } + // Vlans: []*int64{ + // to.Ptr[int64](12), + // to.Ptr[int64](14)}, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/TrunkedNetworks_Create.json func ExampleTrunkedNetworksClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -232,15 +223,14 @@ func ExampleTrunkedNetworksClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.TrunkedNetworkProperties{ - HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), - InterfaceName: to.Ptr("eth0"), + InterfaceName: to.Ptr("eth0"), IsolationDomainIDs: []*string{ - to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), - to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, + to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), + to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, Vlans: []*int64{ to.Ptr[int64](12), to.Ptr[int64](14)}, @@ -259,7 +249,7 @@ func ExampleTrunkedNetworksClient_BeginCreateOrUpdate() { // res.TrunkedNetwork = armnetworkcloud.TrunkedNetwork{ // Name: to.Ptr("trunkedNetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/trunkedNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -274,31 +264,28 @@ func ExampleTrunkedNetworksClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.TrunkedNetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.TrunkedNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Trunked network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.TrunkedNetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Trunked network is up"), // InterfaceName: to.Ptr("eth0"), // IsolationDomainIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, // ProvisioningState: to.Ptr(armnetworkcloud.TrunkedNetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // Vlans: []*int64{ - // to.Ptr[int64](12), - // to.Ptr[int64](14)}, - // }, - // } + // Vlans: []*int64{ + // to.Ptr[int64](12), + // to.Ptr[int64](14)}, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/TrunkedNetworks_Delete.json func ExampleTrunkedNetworksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -319,7 +306,7 @@ func ExampleTrunkedNetworksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/TrunkedNetworks_Patch.json func ExampleTrunkedNetworksClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -345,7 +332,7 @@ func ExampleTrunkedNetworksClient_Update() { // res.TrunkedNetwork = armnetworkcloud.TrunkedNetwork{ // Name: to.Ptr("trunkedNetworkName"), // Type: to.Ptr("Microsoft.NetworkCloud/trunkedNetworks"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/trunkedNetworks/trunkedNetworkName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -360,26 +347,23 @@ func ExampleTrunkedNetworksClient_Update() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.TrunkedNetworkProperties{ - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), - // DetailedStatus: to.Ptr(armnetworkcloud.TrunkedNetworkDetailedStatusAvailable), - // DetailedStatusMessage: to.Ptr("Trunked network is up"), - // HybridAksClustersAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/hybridAksClusters/hybridAksClusterName")}, - // HybridAksPluginType: to.Ptr(armnetworkcloud.HybridAksPluginTypeDPDK), + // AssociatedResourceIDs: []*string{ + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // DetailedStatus: to.Ptr(armnetworkcloud.TrunkedNetworkDetailedStatusAvailable), + // DetailedStatusMessage: to.Ptr("Trunked network is up"), // InterfaceName: to.Ptr("eth0"), // IsolationDomainIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName"), + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")}, // ProvisioningState: to.Ptr(armnetworkcloud.TrunkedNetworkProvisioningStateSucceeded), - // VirtualMachinesAssociatedIDs: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, - // Vlans: []*int64{ - // to.Ptr[int64](12), - // to.Ptr[int64](14)}, - // }, - // } + // Vlans: []*int64{ + // to.Ptr[int64](12), + // to.Ptr[int64](14)}, + // }, + // } } diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/virtualmachines_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/virtualmachines_client.go index 596e3fd996e8..11523a0e67a2 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/virtualmachines_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/virtualmachines_client.go @@ -29,7 +29,7 @@ type VirtualMachinesClient struct { } // NewVirtualMachinesClient creates a new instance of VirtualMachinesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachinesClient, error) { @@ -47,7 +47,7 @@ func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCred // BeginAttachVolume - Attach volume to the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - virtualMachineAttachVolumeParameters - The request body. @@ -70,7 +70,7 @@ func (client *VirtualMachinesClient) BeginAttachVolume(ctx context.Context, reso // AttachVolume - Attach volume to the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *VirtualMachinesClient) attachVolume(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineAttachVolumeParameters VirtualMachineVolumeParameters, options *VirtualMachinesClientBeginAttachVolumeOptions) (*http.Response, error) { req, err := client.attachVolumeCreateRequest(ctx, resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters, options) if err != nil { @@ -89,9 +89,6 @@ func (client *VirtualMachinesClient) attachVolume(ctx context.Context, resourceG // attachVolumeCreateRequest creates the AttachVolume request. func (client *VirtualMachinesClient) attachVolumeCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineAttachVolumeParameters VirtualMachineVolumeParameters, options *VirtualMachinesClientBeginAttachVolumeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/attachVolume" - 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") @@ -106,7 +103,7 @@ func (client *VirtualMachinesClient) attachVolumeCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, virtualMachineAttachVolumeParameters) @@ -115,7 +112,7 @@ func (client *VirtualMachinesClient) attachVolumeCreateRequest(ctx context.Conte // BeginCreateOrUpdate - Create a new virtual machine or update the properties of the existing virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - virtualMachineParameters - The request body. @@ -138,7 +135,7 @@ func (client *VirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Create a new virtual machine or update the properties of the existing virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *VirtualMachinesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineParameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, virtualMachineName, virtualMachineParameters, options) if err != nil { @@ -157,9 +154,6 @@ func (client *VirtualMachinesClient) createOrUpdate(ctx context.Context, resourc // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *VirtualMachinesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineParameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" - 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") @@ -174,7 +168,7 @@ func (client *VirtualMachinesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, virtualMachineParameters) @@ -183,7 +177,7 @@ func (client *VirtualMachinesClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Delete the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - options - VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete @@ -205,7 +199,7 @@ func (client *VirtualMachinesClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *VirtualMachinesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualMachineName, options) if err != nil { @@ -224,9 +218,6 @@ func (client *VirtualMachinesClient) deleteOperation(ctx context.Context, resour // deleteCreateRequest creates the Delete request. func (client *VirtualMachinesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" - 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") @@ -241,7 +232,7 @@ func (client *VirtualMachinesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +241,7 @@ func (client *VirtualMachinesClient) deleteCreateRequest(ctx context.Context, re // BeginDetachVolume - Detach volume from the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - virtualMachineDetachVolumeParameters - The request body. @@ -273,7 +264,7 @@ func (client *VirtualMachinesClient) BeginDetachVolume(ctx context.Context, reso // DetachVolume - Detach volume from the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *VirtualMachinesClient) detachVolume(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineDetachVolumeParameters VirtualMachineVolumeParameters, options *VirtualMachinesClientBeginDetachVolumeOptions) (*http.Response, error) { req, err := client.detachVolumeCreateRequest(ctx, resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters, options) if err != nil { @@ -292,9 +283,6 @@ func (client *VirtualMachinesClient) detachVolume(ctx context.Context, resourceG // detachVolumeCreateRequest creates the DetachVolume request. func (client *VirtualMachinesClient) detachVolumeCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineDetachVolumeParameters VirtualMachineVolumeParameters, options *VirtualMachinesClientBeginDetachVolumeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/detachVolume" - 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") @@ -309,7 +297,7 @@ func (client *VirtualMachinesClient) detachVolumeCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, virtualMachineDetachVolumeParameters) @@ -318,7 +306,7 @@ func (client *VirtualMachinesClient) detachVolumeCreateRequest(ctx context.Conte // Get - Get properties of the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - options - VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method. @@ -340,9 +328,6 @@ func (client *VirtualMachinesClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *VirtualMachinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" - 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") @@ -357,7 +342,7 @@ func (client *VirtualMachinesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -374,7 +359,7 @@ func (client *VirtualMachinesClient) getHandleResponse(resp *http.Response) (Vir // NewListByResourceGroupPager - Get a list of virtual machines in the provided resource group. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualMachinesClientListByResourceGroupOptions contains the optional parameters for the VirtualMachinesClient.NewListByResourceGroupPager // method. @@ -409,9 +394,6 @@ func (client *VirtualMachinesClient) NewListByResourceGroupPager(resourceGroupNa // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *VirtualMachinesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachinesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines" - 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") @@ -422,7 +404,7 @@ func (client *VirtualMachinesClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -439,7 +421,7 @@ func (client *VirtualMachinesClient) listByResourceGroupHandleResponse(resp *htt // NewListBySubscriptionPager - Get a list of virtual machines in the provided subscription. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - options - VirtualMachinesClientListBySubscriptionOptions contains the optional parameters for the VirtualMachinesClient.NewListBySubscriptionPager // method. func (client *VirtualMachinesClient) NewListBySubscriptionPager(options *VirtualMachinesClientListBySubscriptionOptions) *runtime.Pager[VirtualMachinesClientListBySubscriptionResponse] { @@ -473,16 +455,13 @@ func (client *VirtualMachinesClient) NewListBySubscriptionPager(options *Virtual // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *VirtualMachinesClient) listBySubscriptionCreateRequest(ctx context.Context, options *VirtualMachinesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/virtualMachines" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) 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", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -500,7 +479,7 @@ func (client *VirtualMachinesClient) listBySubscriptionHandleResponse(resp *http // BeginPowerOff - Power off the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - options - VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff @@ -522,7 +501,7 @@ func (client *VirtualMachinesClient) BeginPowerOff(ctx context.Context, resource // PowerOff - Power off the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *VirtualMachinesClient) powerOff(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginPowerOffOptions) (*http.Response, error) { req, err := client.powerOffCreateRequest(ctx, resourceGroupName, virtualMachineName, options) if err != nil { @@ -541,9 +520,6 @@ func (client *VirtualMachinesClient) powerOff(ctx context.Context, resourceGroup // powerOffCreateRequest creates the PowerOff request. func (client *VirtualMachinesClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginPowerOffOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/powerOff" - 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") @@ -558,7 +534,7 @@ func (client *VirtualMachinesClient) powerOffCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.VirtualMachinePowerOffParameters != nil { @@ -570,7 +546,7 @@ func (client *VirtualMachinesClient) powerOffCreateRequest(ctx context.Context, // BeginReimage - Reimage the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - options - VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage @@ -592,7 +568,7 @@ func (client *VirtualMachinesClient) BeginReimage(ctx context.Context, resourceG // Reimage - Reimage the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *VirtualMachinesClient) reimage(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginReimageOptions) (*http.Response, error) { req, err := client.reimageCreateRequest(ctx, resourceGroupName, virtualMachineName, options) if err != nil { @@ -611,9 +587,6 @@ func (client *VirtualMachinesClient) reimage(ctx context.Context, resourceGroupN // reimageCreateRequest creates the Reimage request. func (client *VirtualMachinesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginReimageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/reimage" - 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") @@ -628,7 +601,7 @@ func (client *VirtualMachinesClient) reimageCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -637,7 +610,7 @@ func (client *VirtualMachinesClient) reimageCreateRequest(ctx context.Context, r // BeginRestart - Restart the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - options - VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart @@ -659,7 +632,7 @@ func (client *VirtualMachinesClient) BeginRestart(ctx context.Context, resourceG // Restart - Restart the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *VirtualMachinesClient) restart(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginRestartOptions) (*http.Response, error) { req, err := client.restartCreateRequest(ctx, resourceGroupName, virtualMachineName, options) if err != nil { @@ -678,9 +651,6 @@ func (client *VirtualMachinesClient) restart(ctx context.Context, resourceGroupN // restartCreateRequest creates the Restart request. func (client *VirtualMachinesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginRestartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/restart" - 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") @@ -695,7 +665,7 @@ func (client *VirtualMachinesClient) restartCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -704,7 +674,7 @@ func (client *VirtualMachinesClient) restartCreateRequest(ctx context.Context, r // BeginStart - Start the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - options - VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart @@ -726,7 +696,7 @@ func (client *VirtualMachinesClient) BeginStart(ctx context.Context, resourceGro // Start - Start the provided virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *VirtualMachinesClient) start(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, virtualMachineName, options) if err != nil { @@ -745,9 +715,6 @@ func (client *VirtualMachinesClient) start(ctx context.Context, resourceGroupNam // startCreateRequest creates the Start request. func (client *VirtualMachinesClient) startCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginStartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/start" - 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") @@ -762,7 +729,7 @@ func (client *VirtualMachinesClient) startCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -772,7 +739,7 @@ func (client *VirtualMachinesClient) startCreateRequest(ctx context.Context, res // Properties and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineName - The name of the virtual machine. // - virtualMachineUpdateParameters - The request body. @@ -785,7 +752,7 @@ func (client *VirtualMachinesClient) BeginUpdate(ctx context.Context, resourceGr return nil, err } return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { return runtime.NewPollerFromResumeToken[VirtualMachinesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) @@ -796,7 +763,7 @@ func (client *VirtualMachinesClient) BeginUpdate(ctx context.Context, resourceGr // Properties and tag updates can be done independently. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *VirtualMachinesClient) update(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineUpdateParameters VirtualMachinePatchParameters, options *VirtualMachinesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, virtualMachineName, virtualMachineUpdateParameters, options) if err != nil { @@ -815,9 +782,6 @@ func (client *VirtualMachinesClient) update(ctx context.Context, resourceGroupNa // updateCreateRequest creates the Update request. func (client *VirtualMachinesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineName string, virtualMachineUpdateParameters VirtualMachinePatchParameters, options *VirtualMachinesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" - 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") @@ -832,7 +796,7 @@ func (client *VirtualMachinesClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, virtualMachineUpdateParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/virtualmachines_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/virtualmachines_client_example_test.go index 34f40c33586c..20704de4470a 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/virtualmachines_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/virtualmachines_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/VirtualMachines_ListBySubscription.json func ExampleVirtualMachinesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleVirtualMachinesClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("virtualMachineName"), // Type: to.Ptr("Microsoft.NetworkCloud/virtualMachines"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -60,25 +60,26 @@ func ExampleVirtualMachinesClient_NewListBySubscriptionPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.VirtualMachineProperties{ // AdminUsername: to.Ptr("username"), - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // AvailabilityZone: to.Ptr("1"), + // BareMetalMachineID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), // BootMethod: to.Ptr(armnetworkcloud.VirtualMachineBootMethodUEFI), // CloudServicesNetworkAttachment: &armnetworkcloud.NetworkAttachment{ - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), // }, - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // CPUCores: to.Ptr[int64](2), // DetailedStatus: to.Ptr(armnetworkcloud.VirtualMachineDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("VM is up and healthy"), // MemorySizeGB: to.Ptr[int64](8), // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), // IPv4Address: to.Ptr("198.51.100.1"), @@ -90,7 +91,7 @@ func ExampleVirtualMachinesClient_NewListBySubscriptionPager() { // PlacementHints: []*armnetworkcloud.VirtualMachinePlacementHint{ // { // HintType: to.Ptr(armnetworkcloud.VirtualMachinePlacementHintTypeAffinity), - // ResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // ResourceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // SchedulingExecution: to.Ptr(armnetworkcloud.VirtualMachineSchedulingExecutionHard), // Scope: to.Ptr(armnetworkcloud.VirtualMachinePlacementHintPodAffinityScope("")), // }}, @@ -107,7 +108,7 @@ func ExampleVirtualMachinesClient_NewListBySubscriptionPager() { // DiskSizeGB: to.Ptr[int64](120), // }, // VolumeAttachments: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, // }, // UserData: to.Ptr("dXNlckRhdGVTYW1wbGU="), // VMDeviceModel: to.Ptr(armnetworkcloud.VirtualMachineDeviceModelTypeT2), @@ -117,14 +118,14 @@ func ExampleVirtualMachinesClient_NewListBySubscriptionPager() { // Username: to.Ptr("myuser"), // }, // Volumes: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/VirtualMachines_ListByResourceGroup.json func ExampleVirtualMachinesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -151,7 +152,7 @@ func ExampleVirtualMachinesClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("virtualMachineName"), // Type: to.Ptr("Microsoft.NetworkCloud/virtualMachines"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -166,25 +167,26 @@ func ExampleVirtualMachinesClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.VirtualMachineProperties{ // AdminUsername: to.Ptr("username"), - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // AvailabilityZone: to.Ptr("1"), + // BareMetalMachineID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), // BootMethod: to.Ptr(armnetworkcloud.VirtualMachineBootMethodUEFI), // CloudServicesNetworkAttachment: &armnetworkcloud.NetworkAttachment{ - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), // }, - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // CPUCores: to.Ptr[int64](2), // DetailedStatus: to.Ptr(armnetworkcloud.VirtualMachineDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("VM is up and healthy"), // MemorySizeGB: to.Ptr[int64](8), // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), // IPv4Address: to.Ptr("198.51.100.1"), @@ -196,7 +198,7 @@ func ExampleVirtualMachinesClient_NewListByResourceGroupPager() { // PlacementHints: []*armnetworkcloud.VirtualMachinePlacementHint{ // { // HintType: to.Ptr(armnetworkcloud.VirtualMachinePlacementHintTypeAffinity), - // ResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // ResourceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // SchedulingExecution: to.Ptr(armnetworkcloud.VirtualMachineSchedulingExecutionHard), // Scope: to.Ptr(armnetworkcloud.VirtualMachinePlacementHintPodAffinityScope("")), // }}, @@ -213,7 +215,7 @@ func ExampleVirtualMachinesClient_NewListByResourceGroupPager() { // DiskSizeGB: to.Ptr[int64](120), // }, // VolumeAttachments: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, // }, // UserData: to.Ptr("dXNlckRhdGVTYW1wbGU="), // VMDeviceModel: to.Ptr(armnetworkcloud.VirtualMachineDeviceModelTypeT2), @@ -223,14 +225,14 @@ func ExampleVirtualMachinesClient_NewListByResourceGroupPager() { // Username: to.Ptr("myuser"), // }, // Volumes: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/VirtualMachines_Get.json func ExampleVirtualMachinesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -251,7 +253,7 @@ func ExampleVirtualMachinesClient_Get() { // res.VirtualMachine = armnetworkcloud.VirtualMachine{ // Name: to.Ptr("virtualMachineName"), // Type: to.Ptr("Microsoft.NetworkCloud/virtualMachines"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -266,25 +268,26 @@ func ExampleVirtualMachinesClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.VirtualMachineProperties{ // AdminUsername: to.Ptr("username"), - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // AvailabilityZone: to.Ptr("1"), + // BareMetalMachineID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), // BootMethod: to.Ptr(armnetworkcloud.VirtualMachineBootMethodUEFI), // CloudServicesNetworkAttachment: &armnetworkcloud.NetworkAttachment{ - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), // }, - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // CPUCores: to.Ptr[int64](2), // DetailedStatus: to.Ptr(armnetworkcloud.VirtualMachineDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("VM is up and healthy"), // MemorySizeGB: to.Ptr[int64](8), // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), // IPv4Address: to.Ptr("198.51.100.1"), @@ -296,7 +299,7 @@ func ExampleVirtualMachinesClient_Get() { // PlacementHints: []*armnetworkcloud.VirtualMachinePlacementHint{ // { // HintType: to.Ptr(armnetworkcloud.VirtualMachinePlacementHintTypeAffinity), - // ResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // ResourceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // SchedulingExecution: to.Ptr(armnetworkcloud.VirtualMachineSchedulingExecutionHard), // Scope: to.Ptr(armnetworkcloud.VirtualMachinePlacementHintPodAffinityScope("")), // }}, @@ -313,7 +316,7 @@ func ExampleVirtualMachinesClient_Get() { // DiskSizeGB: to.Ptr[int64](120), // }, // VolumeAttachments: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, // }, // UserData: to.Ptr("dXNlckRhdGVTYW1wbGU="), // VMDeviceModel: to.Ptr(armnetworkcloud.VirtualMachineDeviceModelTypeT2), @@ -323,12 +326,12 @@ func ExampleVirtualMachinesClient_Get() { // Username: to.Ptr("myuser"), // }, // Volumes: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/VirtualMachines_Create.json func ExampleVirtualMachinesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -346,21 +349,21 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.VirtualMachineProperties{ AdminUsername: to.Ptr("username"), BootMethod: to.Ptr(armnetworkcloud.VirtualMachineBootMethodUEFI), CloudServicesNetworkAttachment: &armnetworkcloud.NetworkAttachment{ - AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), }, CPUCores: to.Ptr[int64](2), MemorySizeGB: to.Ptr[int64](8), NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ { - AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), IPv4Address: to.Ptr("198.51.100.1"), @@ -371,7 +374,7 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate() { PlacementHints: []*armnetworkcloud.VirtualMachinePlacementHint{ { HintType: to.Ptr(armnetworkcloud.VirtualMachinePlacementHintTypeAffinity), - ResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + ResourceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), SchedulingExecution: to.Ptr(armnetworkcloud.VirtualMachineSchedulingExecutionHard), Scope: to.Ptr(armnetworkcloud.VirtualMachinePlacementHintPodAffinityScope("")), }}, @@ -386,7 +389,7 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate() { DiskSizeGB: to.Ptr[int64](120), }, VolumeAttachments: []*string{ - to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, + to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, }, UserData: to.Ptr("dXNlckRhdGVTYW1wbGU="), VMDeviceModel: to.Ptr(armnetworkcloud.VirtualMachineDeviceModelTypeT2), @@ -411,7 +414,7 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate() { // res.VirtualMachine = armnetworkcloud.VirtualMachine{ // Name: to.Ptr("virtualMachineName"), // Type: to.Ptr("Microsoft.NetworkCloud/virtualMachines"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -426,25 +429,26 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.VirtualMachineProperties{ // AdminUsername: to.Ptr("username"), - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // AvailabilityZone: to.Ptr("1"), + // BareMetalMachineID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), // BootMethod: to.Ptr(armnetworkcloud.VirtualMachineBootMethodUEFI), // CloudServicesNetworkAttachment: &armnetworkcloud.NetworkAttachment{ - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), // }, - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // CPUCores: to.Ptr[int64](2), // DetailedStatus: to.Ptr(armnetworkcloud.VirtualMachineDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("VM is up and healthy"), // MemorySizeGB: to.Ptr[int64](8), // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), // IPv4Address: to.Ptr("198.51.100.1"), @@ -456,7 +460,7 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate() { // PlacementHints: []*armnetworkcloud.VirtualMachinePlacementHint{ // { // HintType: to.Ptr(armnetworkcloud.VirtualMachinePlacementHintTypeAffinity), - // ResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // ResourceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // SchedulingExecution: to.Ptr(armnetworkcloud.VirtualMachineSchedulingExecutionHard), // Scope: to.Ptr(armnetworkcloud.VirtualMachinePlacementHintPodAffinityScope("")), // }}, @@ -473,7 +477,7 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate() { // DiskSizeGB: to.Ptr[int64](120), // }, // VolumeAttachments: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, // }, // UserData: to.Ptr("dXNlckRhdGVTYW1wbGU="), // VMDeviceModel: to.Ptr(armnetworkcloud.VirtualMachineDeviceModelTypeT2), @@ -483,12 +487,12 @@ func ExampleVirtualMachinesClient_BeginCreateOrUpdate() { // Username: to.Ptr("myuser"), // }, // Volumes: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/VirtualMachines_Delete.json func ExampleVirtualMachinesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -509,7 +513,7 @@ func ExampleVirtualMachinesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/VirtualMachines_Patch.json func ExampleVirtualMachinesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -546,7 +550,7 @@ func ExampleVirtualMachinesClient_BeginUpdate() { // res.VirtualMachine = armnetworkcloud.VirtualMachine{ // Name: to.Ptr("virtualMachineName"), // Type: to.Ptr("Microsoft.NetworkCloud/virtualMachines"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -561,25 +565,26 @@ func ExampleVirtualMachinesClient_BeginUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.VirtualMachineProperties{ // AdminUsername: to.Ptr("username"), - // BareMetalMachineID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), + // AvailabilityZone: to.Ptr("1"), + // BareMetalMachineID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/bareMetalMachines/bareMetalMachineName"), // BootMethod: to.Ptr(armnetworkcloud.VirtualMachineBootMethodUEFI), // CloudServicesNetworkAttachment: &armnetworkcloud.NetworkAttachment{ - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"), // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), // }, - // ClusterID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), + // ClusterID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/clusters/clusterName"), // CPUCores: to.Ptr[int64](2), // DetailedStatus: to.Ptr(armnetworkcloud.VirtualMachineDetailedStatusAvailable), // DetailedStatusMessage: to.Ptr("VM is up and healthy"), // MemorySizeGB: to.Ptr[int64](8), // NetworkAttachments: []*armnetworkcloud.NetworkAttachment{ // { - // AttachedNetworkID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), + // AttachedNetworkID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"), // DefaultGateway: to.Ptr(armnetworkcloud.DefaultGatewayTrue), // IPAllocationMethod: to.Ptr(armnetworkcloud.VirtualMachineIPAllocationMethodDynamic), // IPv4Address: to.Ptr("198.51.100.1"), @@ -591,7 +596,7 @@ func ExampleVirtualMachinesClient_BeginUpdate() { // PlacementHints: []*armnetworkcloud.VirtualMachinePlacementHint{ // { // HintType: to.Ptr(armnetworkcloud.VirtualMachinePlacementHintTypeAffinity), - // ResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), + // ResourceID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"), // SchedulingExecution: to.Ptr(armnetworkcloud.VirtualMachineSchedulingExecutionHard), // Scope: to.Ptr(armnetworkcloud.VirtualMachinePlacementHintPodAffinityScope("")), // }}, @@ -608,7 +613,7 @@ func ExampleVirtualMachinesClient_BeginUpdate() { // DiskSizeGB: to.Ptr[int64](120), // }, // VolumeAttachments: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, // }, // UserData: to.Ptr("dXNlckRhdGVTYW1wbGU="), // VMDeviceModel: to.Ptr(armnetworkcloud.VirtualMachineDeviceModelTypeT2), @@ -618,12 +623,12 @@ func ExampleVirtualMachinesClient_BeginUpdate() { // Username: to.Ptr("myuser"), // }, // Volumes: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")}, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_AttachVolume.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/VirtualMachines_AttachVolume.json func ExampleVirtualMachinesClient_BeginAttachVolume() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -635,7 +640,7 @@ func ExampleVirtualMachinesClient_BeginAttachVolume() { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginAttachVolume(ctx, "resourceGroupName", "virtualMachineName", armnetworkcloud.VirtualMachineVolumeParameters{ - VolumeID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), + VolumeID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -646,7 +651,7 @@ func ExampleVirtualMachinesClient_BeginAttachVolume() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_DetachVolume.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/VirtualMachines_DetachVolume.json func ExampleVirtualMachinesClient_BeginDetachVolume() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -658,7 +663,7 @@ func ExampleVirtualMachinesClient_BeginDetachVolume() { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginDetachVolume(ctx, "resourceGroupName", "virtualMachineName", armnetworkcloud.VirtualMachineVolumeParameters{ - VolumeID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), + VolumeID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -669,7 +674,7 @@ func ExampleVirtualMachinesClient_BeginDetachVolume() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_PowerOff.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/VirtualMachines_PowerOff.json func ExampleVirtualMachinesClient_BeginPowerOff() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -693,7 +698,7 @@ func ExampleVirtualMachinesClient_BeginPowerOff() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Reimage.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/VirtualMachines_Reimage.json func ExampleVirtualMachinesClient_BeginReimage() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -714,7 +719,7 @@ func ExampleVirtualMachinesClient_BeginReimage() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Restart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/VirtualMachines_Restart.json func ExampleVirtualMachinesClient_BeginRestart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -735,7 +740,7 @@ func ExampleVirtualMachinesClient_BeginRestart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Start.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/VirtualMachines_Start.json func ExampleVirtualMachinesClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/volumes_client.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/volumes_client.go index c3bea40b29f0..3dd67372dd28 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/volumes_client.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/volumes_client.go @@ -29,7 +29,7 @@ type VolumesClient struct { } // NewVolumesClient creates a new instance of VolumesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewVolumesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VolumesClient, error) { @@ -47,7 +47,7 @@ func NewVolumesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create a new volume or update the properties of the existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - volumeName - The name of the volume. // - volumeParameters - The request body. @@ -70,7 +70,7 @@ func (client *VolumesClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Create a new volume or update the properties of the existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *VolumesClient) createOrUpdate(ctx context.Context, resourceGroupName string, volumeName string, volumeParameters Volume, options *VolumesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, volumeName, volumeParameters, options) if err != nil { @@ -89,9 +89,6 @@ func (client *VolumesClient) createOrUpdate(ctx context.Context, resourceGroupNa // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *VolumesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, volumeName string, volumeParameters Volume, options *VolumesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" - 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") @@ -106,7 +103,7 @@ func (client *VolumesClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, volumeParameters) @@ -115,7 +112,7 @@ func (client *VolumesClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Delete the provided volume. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - volumeName - The name of the volume. // - options - VolumesClientBeginDeleteOptions contains the optional parameters for the VolumesClient.BeginDelete method. @@ -136,7 +133,7 @@ func (client *VolumesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete the provided volume. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview func (client *VolumesClient) deleteOperation(ctx context.Context, resourceGroupName string, volumeName string, options *VolumesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, volumeName, options) if err != nil { @@ -155,9 +152,6 @@ func (client *VolumesClient) deleteOperation(ctx context.Context, resourceGroupN // deleteCreateRequest creates the Delete request. func (client *VolumesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, volumeName string, options *VolumesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" - 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") @@ -172,7 +166,7 @@ func (client *VolumesClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +175,7 @@ func (client *VolumesClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Get properties of the provided volume. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - volumeName - The name of the volume. // - options - VolumesClientGetOptions contains the optional parameters for the VolumesClient.Get method. @@ -203,9 +197,6 @@ func (client *VolumesClient) Get(ctx context.Context, resourceGroupName string, // getCreateRequest creates the Get request. func (client *VolumesClient) getCreateRequest(ctx context.Context, resourceGroupName string, volumeName string, options *VolumesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" - 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") @@ -220,7 +211,7 @@ func (client *VolumesClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,7 +228,7 @@ func (client *VolumesClient) getHandleResponse(resp *http.Response) (VolumesClie // NewListByResourceGroupPager - Get a list of volumes in the provided resource group. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VolumesClientListByResourceGroupOptions contains the optional parameters for the VolumesClient.NewListByResourceGroupPager // method. @@ -272,9 +263,6 @@ func (client *VolumesClient) NewListByResourceGroupPager(resourceGroupName strin // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *VolumesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VolumesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes" - 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") @@ -285,7 +273,7 @@ func (client *VolumesClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,7 +290,7 @@ func (client *VolumesClient) listByResourceGroupHandleResponse(resp *http.Respon // NewListBySubscriptionPager - Get a list of volumes in the provided subscription. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - options - VolumesClientListBySubscriptionOptions contains the optional parameters for the VolumesClient.NewListBySubscriptionPager // method. func (client *VolumesClient) NewListBySubscriptionPager(options *VolumesClientListBySubscriptionOptions) *runtime.Pager[VolumesClientListBySubscriptionResponse] { @@ -336,16 +324,13 @@ func (client *VolumesClient) NewListBySubscriptionPager(options *VolumesClientLi // listBySubscriptionCreateRequest creates the ListBySubscription request. func (client *VolumesClient) listBySubscriptionCreateRequest(ctx context.Context, options *VolumesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/volumes" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) 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", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -363,7 +348,7 @@ func (client *VolumesClient) listBySubscriptionHandleResponse(resp *http.Respons // Update - Update tags associated with the provided volume. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-12-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - volumeName - The name of the volume. // - volumeUpdateParameters - The request body. @@ -386,9 +371,6 @@ func (client *VolumesClient) Update(ctx context.Context, resourceGroupName strin // updateCreateRequest creates the Update request. func (client *VolumesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, volumeName string, volumeUpdateParameters VolumePatchParameters, options *VolumesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" - 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") @@ -403,7 +385,7 @@ func (client *VolumesClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-12-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, volumeUpdateParameters) diff --git a/sdk/resourcemanager/networkcloud/armnetworkcloud/volumes_client_example_test.go b/sdk/resourcemanager/networkcloud/armnetworkcloud/volumes_client_example_test.go index 71a51ba8767c..fbf312c72356 100644 --- a/sdk/resourcemanager/networkcloud/armnetworkcloud/volumes_client_example_test.go +++ b/sdk/resourcemanager/networkcloud/armnetworkcloud/volumes_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkcloud/armnetworkcloud" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Volumes_ListBySubscription.json func ExampleVolumesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleVolumesClient_NewListBySubscriptionPager() { // { // Name: to.Ptr("volumeName"), // Type: to.Ptr("Microsoft.NetworkCloud/volumes"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -60,12 +60,12 @@ func ExampleVolumesClient_NewListBySubscriptionPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.VolumeProperties{ // AttachedTo: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, // DetailedStatus: to.Ptr(armnetworkcloud.VolumeDetailedStatusActive), // DetailedStatusMessage: to.Ptr("Volume is available"), // ProvisioningState: to.Ptr(armnetworkcloud.VolumeProvisioningStateSucceeded), @@ -77,7 +77,7 @@ func ExampleVolumesClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Volumes_ListByResourceGroup.json func ExampleVolumesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -104,7 +104,7 @@ func ExampleVolumesClient_NewListByResourceGroupPager() { // { // Name: to.Ptr("volumeName"), // Type: to.Ptr("Microsoft.NetworkCloud/volumes"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -119,12 +119,12 @@ func ExampleVolumesClient_NewListByResourceGroupPager() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.VolumeProperties{ // AttachedTo: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, // DetailedStatus: to.Ptr(armnetworkcloud.VolumeDetailedStatusActive), // DetailedStatusMessage: to.Ptr("Volume is available"), // ProvisioningState: to.Ptr(armnetworkcloud.VolumeProvisioningStateSucceeded), @@ -136,7 +136,7 @@ func ExampleVolumesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Volumes_Get.json func ExampleVolumesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -157,7 +157,7 @@ func ExampleVolumesClient_Get() { // res.Volume = armnetworkcloud.Volume{ // Name: to.Ptr("volumeName"), // Type: to.Ptr("Microsoft.NetworkCloud/volumes"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -172,12 +172,12 @@ func ExampleVolumesClient_Get() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.VolumeProperties{ // AttachedTo: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, // DetailedStatus: to.Ptr(armnetworkcloud.VolumeDetailedStatusActive), // DetailedStatusMessage: to.Ptr("Volume is available"), // ProvisioningState: to.Ptr(armnetworkcloud.VolumeProvisioningStateSucceeded), @@ -187,7 +187,7 @@ func ExampleVolumesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Volumes_Create.json func ExampleVolumesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -205,7 +205,7 @@ func ExampleVolumesClient_BeginCreateOrUpdate() { "key2": to.Ptr("myvalue2"), }, ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), Type: to.Ptr("CustomLocation"), }, Properties: &armnetworkcloud.VolumeProperties{ @@ -225,7 +225,7 @@ func ExampleVolumesClient_BeginCreateOrUpdate() { // res.Volume = armnetworkcloud.Volume{ // Name: to.Ptr("volumeName"), // Type: to.Ptr("Microsoft.NetworkCloud/volumes"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -240,12 +240,12 @@ func ExampleVolumesClient_BeginCreateOrUpdate() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.VolumeProperties{ // AttachedTo: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, // DetailedStatus: to.Ptr(armnetworkcloud.VolumeDetailedStatusActive), // DetailedStatusMessage: to.Ptr("Volume is available"), // ProvisioningState: to.Ptr(armnetworkcloud.VolumeProvisioningStateSucceeded), @@ -255,7 +255,7 @@ func ExampleVolumesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Volumes_Delete.json func ExampleVolumesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -276,7 +276,7 @@ func ExampleVolumesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2023-05-01-preview/examples/Volumes_Patch.json func ExampleVolumesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -302,7 +302,7 @@ func ExampleVolumesClient_Update() { // res.Volume = armnetworkcloud.Volume{ // Name: to.Ptr("volumeName"), // Type: to.Ptr("Microsoft.NetworkCloud/volumes"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), + // ID: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), // SystemData: &armnetworkcloud.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-22T13:27:03.008Z"); return t}()), // CreatedBy: to.Ptr("identityA"), @@ -317,12 +317,12 @@ func ExampleVolumesClient_Update() { // "key2": to.Ptr("myvalue2"), // }, // ExtendedLocation: &armnetworkcloud.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), + // Name: to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"), // Type: to.Ptr("CustomLocation"), // }, // Properties: &armnetworkcloud.VolumeProperties{ // AttachedTo: []*string{ - // to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, + // to.Ptr("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/virtualMachines/virtualMachineName")}, // DetailedStatus: to.Ptr(armnetworkcloud.VolumeDetailedStatusActive), // DetailedStatusMessage: to.Ptr("Volume is available"), // ProvisioningState: to.Ptr(armnetworkcloud.VolumeProvisioningStateSucceeded),