From 65b5a14a9f72d71c2b6520a4de0c6ebfd95ed71b Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Tue, 11 Jul 2023 16:21:51 +0800 Subject: [PATCH 1/3] [Release] sdk/resourcemanager/containerservice/armcontainerservice/4.1.0 generation from spec commit: c53808ba54beef57059371708f1fa6949a11a280 --- .../armcontainerservice/CHANGELOG.md | 91 +- .../armcontainerservice/agentpools_client.go | 78 +- .../agentpools_client_example_test.go | 273 +--- .../armcontainerservice/autorest.md | 12 +- .../armcontainerservice/client_factory.go | 15 - .../armcontainerservice/constants.go | 316 +---- .../fake/agentpools_server.go | 460 ------- .../armcontainerservice/fake/date_type.go | 59 - .../armcontainerservice/fake/internal.go | 78 -- .../fake/maintenanceconfigurations_server.go | 240 ---- .../fake/managedclusters_server.go | 1157 ---------------- .../fake/managedclustersnapshots_server.go | 304 ---- .../fake/operations_server.go | 86 -- .../fake/privateendpointconnections_server.go | 242 ---- .../fake/privatelinkresources_server.go | 100 -- .../resolveprivatelinkserviceid_server.go | 104 -- .../fake/snapshots_server.go | 304 ---- .../armcontainerservice/fake/time_rfc3339.go | 86 -- .../fake/trustedaccessrolebindings_server.go | 240 ---- .../fake/trustedaccessroles_server.go | 102 -- .../armcontainerservice/fake_example_test.go | 78 -- .../maintenanceconfigurations_client.go | 30 +- ...nanceconfigurations_client_example_test.go | 41 +- .../managedclusters_client.go | 208 +-- .../managedclusters_client_example_test.go | 1219 ++++------------- .../managedclustersnapshots_client.go | 431 ------ ...gedclustersnapshots_client_example_test.go | 343 ----- .../armcontainerservice/models.go | 617 +-------- .../armcontainerservice/models_serde.go | 1210 +--------------- .../armcontainerservice/operations_client.go | 6 +- .../operations_client_example_test.go | 2 +- .../privateendpointconnections_client.go | 34 +- ...endpointconnections_client_example_test.go | 8 +- .../privatelinkresources_client.go | 8 +- ...rivatelinkresources_client_example_test.go | 2 +- .../resolveprivatelinkserviceid_client.go | 8 +- ...rivatelinkserviceid_client_example_test.go | 2 +- .../armcontainerservice/response_types.go | 55 - .../armcontainerservice/snapshots_client.go | 44 +- .../snapshots_client_example_test.go | 12 +- .../trustedaccessrolebindings_client.go | 320 ----- ...daccessrolebindings_client_example_test.go | 144 -- .../trustedaccessroles_client.go | 111 -- .../trustedaccessroles_client_example_test.go | 63 - 44 files changed, 526 insertions(+), 8817 deletions(-) delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/agentpools_server.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/date_type.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/internal.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/maintenanceconfigurations_server.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclusters_server.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclustersnapshots_server.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/operations_server.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/privateendpointconnections_server.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/privatelinkresources_server.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/resolveprivatelinkserviceid_server.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/snapshots_server.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/time_rfc3339.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/trustedaccessrolebindings_server.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/trustedaccessroles_server.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake_example_test.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client_example_test.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client_example_test.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client_example_test.go diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md index 098b1d1617a9..da80f0ddb495 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md +++ b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md @@ -1,106 +1,17 @@ # Release History -## 4.1.0-beta.3 (2023-06-23) +## 4.1.0 (2023-07-28) ### Features Added -- New struct `NetworkMonitoring` -- New field `Monitoring` in struct `NetworkProfile` - - -## 4.1.0-beta.2 (2023-06-12) - -### Features Added - -- Support for test fakes and OpenTelemetry trace spans. - -## 4.1.0-beta.1 (2023-05-26) -### Features Added - -- New value `OSSKUMariner` added to enum type `OSSKU` -- New value `PublicNetworkAccessSecuredByPerimeter` added to enum type `PublicNetworkAccess` -- New value `SnapshotTypeManagedCluster` added to enum type `SnapshotType` -- New value `WorkloadRuntimeKataMshvVMIsolation` added to enum type `WorkloadRuntime` -- New enum type `BackendPoolType` with values `BackendPoolTypeNodeIP`, `BackendPoolTypeNodeIPConfiguration` -- New enum type `ControlPlaneUpgradeOverride` with values `ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations` -- New enum type `ControlledValues` with values `ControlledValuesRequestsAndLimits`, `ControlledValuesRequestsOnly` -- New enum type `IpvsScheduler` with values `IpvsSchedulerLeastConnection`, `IpvsSchedulerRoundRobin` -- New enum type `IstioIngressGatewayMode` with values `IstioIngressGatewayModeExternal`, `IstioIngressGatewayModeInternal` -- New enum type `Level` with values `LevelEnforcement`, `LevelOff`, `LevelWarning` -- New enum type `Mode` with values `ModeIPTABLES`, `ModeIPVS` -- New enum type `NodeOSUpgradeChannel` with values `NodeOSUpgradeChannelNodeImage`, `NodeOSUpgradeChannelNone`, `NodeOSUpgradeChannelSecurityPatch`, `NodeOSUpgradeChannelUnmanaged` -- New enum type `Protocol` with values `ProtocolTCP`, `ProtocolUDP` -- New enum type `RestrictionLevel` with values `RestrictionLevelReadOnly`, `RestrictionLevelUnrestricted` -- New enum type `ServiceMeshMode` with values `ServiceMeshModeDisabled`, `ServiceMeshModeIstio` -- New enum type `TrustedAccessRoleBindingProvisioningState` with values `TrustedAccessRoleBindingProvisioningStateCanceled`, `TrustedAccessRoleBindingProvisioningStateDeleting`, `TrustedAccessRoleBindingProvisioningStateFailed`, `TrustedAccessRoleBindingProvisioningStateSucceeded`, `TrustedAccessRoleBindingProvisioningStateUpdating` - New enum type `Type` with values `TypeFirst`, `TypeFourth`, `TypeLast`, `TypeSecond`, `TypeThird` -- New enum type `UpdateMode` with values `UpdateModeAuto`, `UpdateModeInitial`, `UpdateModeOff`, `UpdateModeRecreate` -- New function `*ClientFactory.NewManagedClusterSnapshotsClient() *ManagedClusterSnapshotsClient` -- New function `*ClientFactory.NewTrustedAccessRoleBindingsClient() *TrustedAccessRoleBindingsClient` -- New function `*ClientFactory.NewTrustedAccessRolesClient() *TrustedAccessRolesClient` -- New function `NewManagedClusterSnapshotsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error)` -- New function `*ManagedClusterSnapshotsClient.CreateOrUpdate(context.Context, string, string, ManagedClusterSnapshot, *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error)` -- New function `*ManagedClusterSnapshotsClient.Delete(context.Context, string, string, *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error)` -- New function `*ManagedClusterSnapshotsClient.Get(context.Context, string, string, *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error)` -- New function `*ManagedClusterSnapshotsClient.NewListByResourceGroupPager(string, *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse]` -- New function `*ManagedClusterSnapshotsClient.NewListPager(*ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse]` -- New function `*ManagedClusterSnapshotsClient.UpdateTags(context.Context, string, string, TagsObject, *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error)` -- New function `NewTrustedAccessRoleBindingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TrustedAccessRoleBindingsClient, error)` -- New function `*TrustedAccessRoleBindingsClient.CreateOrUpdate(context.Context, string, string, string, TrustedAccessRoleBinding, *TrustedAccessRoleBindingsClientCreateOrUpdateOptions) (TrustedAccessRoleBindingsClientCreateOrUpdateResponse, error)` -- New function `*TrustedAccessRoleBindingsClient.Delete(context.Context, string, string, string, *TrustedAccessRoleBindingsClientDeleteOptions) (TrustedAccessRoleBindingsClientDeleteResponse, error)` -- New function `*TrustedAccessRoleBindingsClient.Get(context.Context, string, string, string, *TrustedAccessRoleBindingsClientGetOptions) (TrustedAccessRoleBindingsClientGetResponse, error)` -- New function `*TrustedAccessRoleBindingsClient.NewListPager(string, string, *TrustedAccessRoleBindingsClientListOptions) *runtime.Pager[TrustedAccessRoleBindingsClientListResponse]` -- New function `NewTrustedAccessRolesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TrustedAccessRolesClient, error)` -- New function `*TrustedAccessRolesClient.NewListPager(string, *TrustedAccessRolesClientListOptions) *runtime.Pager[TrustedAccessRolesClientListResponse]` - New struct `AbsoluteMonthlySchedule` -- New struct `AgentPoolNetworkProfile` -- New struct `AgentPoolWindowsProfile` -- New struct `ClusterUpgradeSettings` - New struct `DailySchedule` - New struct `DateSpan` -- New struct `GuardrailsProfile` -- New struct `IPTag` -- New struct `IstioComponents` -- New struct `IstioIngressGateway` -- New struct `IstioServiceMesh` - New struct `MaintenanceWindow` -- New struct `ManagedClusterIngressProfile` -- New struct `ManagedClusterIngressProfileWebAppRouting` -- New struct `ManagedClusterNodeResourceGroupProfile` -- New struct `ManagedClusterPropertiesForSnapshot` -- New struct `ManagedClusterSecurityProfileNodeRestriction` -- New struct `ManagedClusterSnapshot` -- New struct `ManagedClusterSnapshotListResult` -- New struct `ManagedClusterSnapshotProperties` -- New struct `ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler` -- New struct `NetworkProfileForSnapshot` -- New struct `NetworkProfileKubeProxyConfig` -- New struct `NetworkProfileKubeProxyConfigIpvsConfig` -- New struct `PortRange` - New struct `RelativeMonthlySchedule` - New struct `Schedule` -- New struct `ServiceMeshProfile` -- New struct `TrustedAccessRole` -- New struct `TrustedAccessRoleBinding` -- New struct `TrustedAccessRoleBindingListResult` -- New struct `TrustedAccessRoleBindingProperties` -- New struct `TrustedAccessRoleListResult` -- New struct `TrustedAccessRoleRule` -- New struct `UpgradeOverrideSettings` - New struct `WeeklySchedule` -- New field `IgnorePodDisruptionBudget` in struct `AgentPoolsClientBeginDeleteOptions` - New field `MaintenanceWindow` in struct `MaintenanceConfigurationProperties` -- New field `EnableVnetIntegration`, `SubnetID` in struct `ManagedClusterAPIServerAccessProfile` -- New field `CapacityReservationGroupID`, `EnableCustomCATrust`, `MessageOfTheDay`, `NetworkProfile`, `WindowsProfile` in struct `ManagedClusterAgentPoolProfile` -- New field `CapacityReservationGroupID`, `EnableCustomCATrust`, `MessageOfTheDay`, `NetworkProfile`, `WindowsProfile` in struct `ManagedClusterAgentPoolProfileProperties` -- New field `NodeOSUpgradeChannel` in struct `ManagedClusterAutoUpgradeProfile` -- New field `EffectiveNoProxy` in struct `ManagedClusterHTTPProxyConfig` -- New field `BackendPoolType` in struct `ManagedClusterLoadBalancerProfile` -- New field `CreationData`, `EnableNamespaceResources`, `GuardrailsProfile`, `IngressProfile`, `NodeResourceGroupProfile`, `ServiceMeshProfile`, `UpgradeSettings` in struct `ManagedClusterProperties` -- New field `CustomCATrustCertificates`, `NodeRestriction` in struct `ManagedClusterSecurityProfile` -- New field `Version` in struct `ManagedClusterStorageProfileDiskCSIDriver` -- New field `VerticalPodAutoscaler` in struct `ManagedClusterWorkloadAutoScalerProfile` -- New field `IgnorePodDisruptionBudget` in struct `ManagedClustersClientBeginDeleteOptions` -- New field `KubeProxyConfig` in struct `NetworkProfile` ## 4.0.0 (2023-05-26) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go index 82a468460b17..412a591764e1 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go @@ -17,7 +17,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" - "strconv" "strings" ) @@ -46,10 +45,10 @@ func NewAgentPoolsClient(subscriptionID string, credential azcore.TokenCredentia // BeginAbortLatestOperation - Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a // Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes -// before cancellation can take place, an error is returned. +// before cancellation can take place, a 409 error code is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -72,16 +71,12 @@ func (client *AgentPoolsClient) BeginAbortLatestOperation(ctx context.Context, r // AbortLatestOperation - Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling // state and eventually to a Canceled state when cancellation finishes. If the operation completes -// before cancellation can take place, an error is returned. +// before cancellation can take place, a 409 error code is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *AgentPoolsClient) abortLatestOperation(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginAbortLatestOperationOptions) (*http.Response, error) { var err error - const operationName = "AgentPoolsClient.BeginAbortLatestOperation" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.abortLatestOperationCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { return nil, err @@ -121,7 +116,7 @@ func (client *AgentPoolsClient) abortLatestOperationCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -130,7 +125,7 @@ func (client *AgentPoolsClient) abortLatestOperationCreateRequest(ctx context.Co // BeginCreateOrUpdate - Creates or updates an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -153,13 +148,9 @@ func (client *AgentPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *AgentPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool, options *AgentPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error - const operationName = "AgentPoolsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, parameters, options) if err != nil { return nil, err @@ -199,7 +190,7 @@ func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -211,7 +202,7 @@ func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -232,13 +223,9 @@ func (client *AgentPoolsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *AgentPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (*http.Response, error) { var err error - const operationName = "AgentPoolsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { return nil, err @@ -278,10 +265,7 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") - if options != nil && options.IgnorePodDisruptionBudget != nil { - reqQP.Set("ignore-pod-disruption-budget", strconv.FormatBool(*options.IgnorePodDisruptionBudget)) - } + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -290,17 +274,13 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the specified managed cluster agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. // - options - AgentPoolsClientGetOptions contains the optional parameters for the AgentPoolsClient.Get method. func (client *AgentPoolsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientGetOptions) (AgentPoolsClientGetResponse, error) { var err error - const operationName = "AgentPoolsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { return AgentPoolsClientGetResponse{}, err @@ -341,7 +321,7 @@ func (client *AgentPoolsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -360,17 +340,13 @@ func (client *AgentPoolsClient) getHandleResponse(resp *http.Response) (AgentPoo // for more details about the version lifecycle. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - AgentPoolsClientGetAvailableAgentPoolVersionsOptions contains the optional parameters for the AgentPoolsClient.GetAvailableAgentPoolVersions // method. func (client *AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string, options *AgentPoolsClientGetAvailableAgentPoolVersionsOptions) (AgentPoolsClientGetAvailableAgentPoolVersionsResponse, error) { var err error - const operationName = "AgentPoolsClient.GetAvailableAgentPoolVersions" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.getAvailableAgentPoolVersionsCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return AgentPoolsClientGetAvailableAgentPoolVersionsResponse{}, err @@ -407,7 +383,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -425,7 +401,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsHandleResponse(resp // GetUpgradeProfile - Gets the upgrade profile for an agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -433,10 +409,6 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsHandleResponse(resp // method. func (client *AgentPoolsClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientGetUpgradeProfileOptions) (AgentPoolsClientGetUpgradeProfileResponse, error) { var err error - const operationName = "AgentPoolsClient.GetUpgradeProfile" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.getUpgradeProfileCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { return AgentPoolsClientGetUpgradeProfileResponse{}, err @@ -477,7 +449,7 @@ func (client *AgentPoolsClient) getUpgradeProfileCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -494,7 +466,7 @@ func (client *AgentPoolsClient) getUpgradeProfileHandleResponse(resp *http.Respo // NewListPager - Gets a list of agent pools in the specified managed cluster. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - AgentPoolsClientListOptions contains the optional parameters for the AgentPoolsClient.NewListPager method. @@ -504,7 +476,6 @@ func (client *AgentPoolsClient) NewListPager(resourceGroupName string, resourceN return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *AgentPoolsClientListResponse) (AgentPoolsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AgentPoolsClient.NewListPager") var req *policy.Request var err error if page == nil { @@ -524,7 +495,6 @@ func (client *AgentPoolsClient) NewListPager(resourceGroupName string, resourceN } return client.listHandleResponse(resp) }, - Tracer: client.internal.Tracer(), }) } @@ -548,7 +518,7 @@ func (client *AgentPoolsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -568,7 +538,7 @@ func (client *AgentPoolsClient) listHandleResponse(resp *http.Response) (AgentPo // versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -594,13 +564,9 @@ func (client *AgentPoolsClient) BeginUpgradeNodeImageVersion(ctx context.Context // versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *AgentPoolsClient) upgradeNodeImageVersion(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginUpgradeNodeImageVersionOptions) (*http.Response, error) { var err error - const operationName = "AgentPoolsClient.BeginUpgradeNodeImageVersion" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.upgradeNodeImageVersionCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { return nil, err @@ -640,7 +606,7 @@ func (client *AgentPoolsClient) upgradeNodeImageVersionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go index 6d08ce362c91..ace10157b1dd 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsAbortOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsAbortOperation.json func ExampleAgentPoolsClient_BeginAbortLatestOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleAgentPoolsClient_BeginAbortLatestOperation() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsList.json func ExampleAgentPoolsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -81,7 +81,7 @@ func ExampleAgentPoolsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsGet.json func ExampleAgentPoolsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -118,54 +118,7 @@ func ExampleAgentPoolsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsAssociate_CRG.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_associateAgentPoolWithCapacityReservationGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{ - Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - CapacityReservationGroupID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"), - Count: to.Ptr[int32](3), - OrchestratorVersion: to.Ptr(""), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - }, - }, 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 = armcontainerservice.AgentPool{ - // Name: to.Ptr("agentpool1"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // CapacityReservationGroupID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"), - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), - // MaxPods: to.Ptr[int32](110), - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // VMSize: to.Ptr("Standard_DS2_v2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_Snapshot.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_Snapshot.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolUsingAnAgentPoolSnapshot() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -218,54 +171,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolUsingAnAgentPool // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_EnableCustomCATrust.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithCustomCaTrustEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{ - Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - Count: to.Ptr[int32](3), - EnableCustomCATrust: to.Ptr(true), - OrchestratorVersion: to.Ptr(""), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - }, - }, 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 = armcontainerservice.AgentPool{ - // Name: to.Ptr("agentpool1"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.19.6"), - // EnableCustomCATrust: to.Ptr(true), - // MaxPods: to.Ptr[int32](110), - // OrchestratorVersion: to.Ptr("1.19.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // VMSize: to.Ptr("Standard_DS2_v2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_DedicatedHostGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_DedicatedHostGroup.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithDedicatedHostGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -301,7 +207,6 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithDedicatedHos // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.19.6"), // HostGroupID: to.Ptr("/subscriptions/subid1/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"), // MaxPods: to.Ptr[int32](110), // OrchestratorVersion: to.Ptr("1.19.6"), @@ -312,7 +217,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithDedicatedHos // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_EnableEncryptionAtHost.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEncryptionAtHostEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -359,7 +264,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEncryptionAt // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_Ephemeral.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_Ephemeral.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEphemeralOsDisk() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -408,7 +313,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEphemeralOsD // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_EnableFIPS.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_EnableFIPS.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithFipsEnabledOs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -455,7 +360,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithFipsEnabledO // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_GPUMIG.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_GPUMIG.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithGpumig() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -548,7 +453,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithGpumig() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_WasmWasi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_WasmWasi.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKrustletAndTheWasiRuntime() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -599,7 +504,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKrustletAndT // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_CustomNodeConfig.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_CustomNodeConfig.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKubeletConfigAndLinuxOsConfig() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -690,58 +595,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKubeletConfi // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_MessageOfTheDay.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithMessageOfTheDay() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{ - Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - Count: to.Ptr[int32](3), - MessageOfTheDay: to.Ptr("Zm9vCg=="), - Mode: to.Ptr(armcontainerservice.AgentPoolModeUser), - OrchestratorVersion: to.Ptr(""), - OSDiskSizeGB: to.Ptr[int32](64), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - }, - }, 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 = armcontainerservice.AgentPool{ - // Name: to.Ptr("agentpool1"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.17.8"), - // MaxPods: to.Ptr[int32](110), - // MessageOfTheDay: to.Ptr("Zm9vCg=="), - // Mode: to.Ptr(armcontainerservice.AgentPoolModeUser), - // OrchestratorVersion: to.Ptr("1.17.8"), - // OSDiskSizeGB: to.Ptr[int32](64), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // VMSize: to.Ptr("Standard_DS2_v2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_OSSKU.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_OSSKU.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithOssku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -834,7 +688,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithOssku() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_PPG.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_PPG.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithPpg() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -881,7 +735,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithPpg() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_EnableUltraSSD.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_EnableUltraSSD.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithUltraSsdEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -928,7 +782,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithUltraSsdEnab // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_WindowsOSSKU.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_WindowsOSSKU.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithWindowsOssku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -975,7 +829,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithWindowsOssku // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_Spot.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_Spot.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createSpotAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1041,60 +895,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createSpotAgentPool() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createWindowsAgentPoolWithDisablingOutboundNat() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "wnp2", armcontainerservice.AgentPool{ - Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - Count: to.Ptr[int32](3), - OrchestratorVersion: to.Ptr("1.23.8"), - OSSKU: to.Ptr(armcontainerservice.OSSKUWindows2022), - OSType: to.Ptr(armcontainerservice.OSTypeWindows), - VMSize: to.Ptr("Standard_D4s_v3"), - WindowsProfile: &armcontainerservice.AgentPoolWindowsProfile{ - DisableOutboundNat: to.Ptr(true), - }, - }, - }, 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 = armcontainerservice.AgentPool{ - // Name: to.Ptr("wnp2"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.23.8"), - // MaxPods: to.Ptr[int32](110), - // OrchestratorVersion: to.Ptr("1.23.8"), - // OSSKU: to.Ptr(armcontainerservice.OSSKUWindows2022), - // OSType: to.Ptr(armcontainerservice.OSTypeWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // VMSize: to.Ptr("Standard_D4s_v3"), - // WindowsProfile: &armcontainerservice.AgentPoolWindowsProfile{ - // DisableOutboundNat: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsCreate_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsCreate_Update.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createUpdateAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1140,6 +941,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createUpdateAgentPool() { // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ // Count: to.Ptr[int32](3), + // CurrentOrchestratorVersion: to.Ptr("1.9.6"), // MaxPods: to.Ptr[int32](110), // Mode: to.Ptr(armcontainerservice.AgentPoolModeUser), // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), @@ -1161,7 +963,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createUpdateAgentPool() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPools_Start.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPools_Start.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_startAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1206,7 +1008,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_startAgentPool() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPools_Stop.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPools_Stop.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_stopAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1249,7 +1051,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_stopAgentPool() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPools_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPools_Update.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_updateAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1308,29 +1110,8 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_updateAgentPool() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsDelete.json -func ExampleAgentPoolsClient_BeginDelete_deleteAgentPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAgentPoolsClient().BeginDelete(ctx, "rg1", "clustername1", "agentpool1", &armcontainerservice.AgentPoolsClientBeginDeleteOptions{IgnorePodDisruptionBudget: 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/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsDelete_IgnorePodDisruptionBudget.json -func ExampleAgentPoolsClient_BeginDelete_deleteAgentPoolByIgnoringPodDisruptionBudget() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsDelete.json +func ExampleAgentPoolsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1340,7 +1121,7 @@ func ExampleAgentPoolsClient_BeginDelete_deleteAgentPoolByIgnoringPodDisruptionB if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewAgentPoolsClient().BeginDelete(ctx, "rg1", "clustername1", "agentpool1", &armcontainerservice.AgentPoolsClientBeginDeleteOptions{IgnorePodDisruptionBudget: nil}) + poller, err := clientFactory.NewAgentPoolsClient().BeginDelete(ctx, "rg1", "clustername1", "agentpool1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1350,7 +1131,7 @@ func ExampleAgentPoolsClient_BeginDelete_deleteAgentPoolByIgnoringPodDisruptionB } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsGetUpgradeProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsGetUpgradeProfile.json func ExampleAgentPoolsClient_GetUpgradeProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1384,7 +1165,7 @@ func ExampleAgentPoolsClient_GetUpgradeProfile() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json func ExampleAgentPoolsClient_GetAvailableAgentPoolVersions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1423,7 +1204,7 @@ func ExampleAgentPoolsClient_GetAvailableAgentPoolVersions() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/AgentPoolsUpgradeNodeImageVersion.json func ExampleAgentPoolsClient_BeginUpgradeNodeImageVersion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md b/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md index 9a7f995bf82c..f3f0d653d5a9 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md +++ b/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md @@ -5,13 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module: github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 -module-version: 4.1.0-beta.3 -tag: package-preview-2023-05 -azcore-version: 1.7.0-beta.2 -generate-fakes: true -inject-spans: true +module-version: 4.1.0 +tag: package-2023-05 ``` diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go b/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go index 491ebb6ea5bf..dbfbd3b638bc 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go @@ -76,18 +76,3 @@ func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient { subClient, _ := NewSnapshotsClient(c.subscriptionID, c.credential, c.options) return subClient } - -func (c *ClientFactory) NewManagedClusterSnapshotsClient() *ManagedClusterSnapshotsClient { - subClient, _ := NewManagedClusterSnapshotsClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewTrustedAccessRolesClient() *TrustedAccessRolesClient { - subClient, _ := NewTrustedAccessRolesClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewTrustedAccessRoleBindingsClient() *TrustedAccessRoleBindingsClient { - subClient, _ := NewTrustedAccessRoleBindingsClient(c.subscriptionID, c.credential, c.options) - return subClient -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/constants.go b/sdk/resourcemanager/containerservice/armcontainerservice/constants.go index ec471d304966..1fb7767febcf 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/constants.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/constants.go @@ -10,7 +10,7 @@ package armcontainerservice const ( moduleName = "armcontainerservice" - moduleVersion = "v4.1.0-beta.3" + moduleVersion = "v4.1.0" ) // AgentPoolMode - A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent @@ -51,24 +51,6 @@ func PossibleAgentPoolTypeValues() []AgentPoolType { } } -// BackendPoolType - The type of the managed inbound Load Balancer BackendPool. -type BackendPoolType string - -const ( - // BackendPoolTypeNodeIP - The type of the managed inbound Load Balancer BackendPool. https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. - BackendPoolTypeNodeIP BackendPoolType = "NodeIP" - // BackendPoolTypeNodeIPConfiguration - The type of the managed inbound Load Balancer BackendPool. https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. - BackendPoolTypeNodeIPConfiguration BackendPoolType = "NodeIPConfiguration" -) - -// PossibleBackendPoolTypeValues returns the possible values for the BackendPoolType const type. -func PossibleBackendPoolTypeValues() []BackendPoolType { - return []BackendPoolType{ - BackendPoolTypeNodeIP, - BackendPoolTypeNodeIPConfiguration, - } -} - // Code - Tells whether the cluster is Running or Stopped type Code string @@ -107,40 +89,6 @@ func PossibleConnectionStatusValues() []ConnectionStatus { } } -// ControlPlaneUpgradeOverride - The list of control plane upgrade override settings. -type ControlPlaneUpgradeOverride string - -const ( - // ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations - Upgrade the cluster control plane version without checking for - // recent Kubernetes deprecations usage. - ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations ControlPlaneUpgradeOverride = "IgnoreKubernetesDeprecations" -) - -// PossibleControlPlaneUpgradeOverrideValues returns the possible values for the ControlPlaneUpgradeOverride const type. -func PossibleControlPlaneUpgradeOverrideValues() []ControlPlaneUpgradeOverride { - return []ControlPlaneUpgradeOverride{ - ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations, - } -} - -// ControlledValues - Controls which resource value autoscaler will change. Default value is RequestsAndLimits. -type ControlledValues string - -const ( - // ControlledValuesRequestsAndLimits - Autoscaler will control resource requests and limits. - ControlledValuesRequestsAndLimits ControlledValues = "RequestsAndLimits" - // ControlledValuesRequestsOnly - Autoscaler will control resource requests only. - ControlledValuesRequestsOnly ControlledValues = "RequestsOnly" -) - -// PossibleControlledValuesValues returns the possible values for the ControlledValues const type. -func PossibleControlledValuesValues() []ControlledValues { - return []ControlledValues{ - ControlledValuesRequestsAndLimits, - ControlledValuesRequestsOnly, - } -} - // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -261,42 +209,6 @@ func PossibleIPFamilyValues() []IPFamily { } } -// IpvsScheduler - IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. -type IpvsScheduler string - -const ( - // IpvsSchedulerLeastConnection - Least Connection - IpvsSchedulerLeastConnection IpvsScheduler = "LeastConnection" - // IpvsSchedulerRoundRobin - Round Robin - IpvsSchedulerRoundRobin IpvsScheduler = "RoundRobin" -) - -// PossibleIpvsSchedulerValues returns the possible values for the IpvsScheduler const type. -func PossibleIpvsSchedulerValues() []IpvsScheduler { - return []IpvsScheduler{ - IpvsSchedulerLeastConnection, - IpvsSchedulerRoundRobin, - } -} - -// IstioIngressGatewayMode - Mode of an ingress gateway. -type IstioIngressGatewayMode string - -const ( - // IstioIngressGatewayModeExternal - The ingress gateway is assigned a public IP address and is publicly accessible. - IstioIngressGatewayModeExternal IstioIngressGatewayMode = "External" - // IstioIngressGatewayModeInternal - The ingress gateway is assigned an internal IP address and cannot is accessed publicly. - IstioIngressGatewayModeInternal IstioIngressGatewayMode = "Internal" -) - -// PossibleIstioIngressGatewayModeValues returns the possible values for the IstioIngressGatewayMode const type. -func PossibleIstioIngressGatewayModeValues() []IstioIngressGatewayMode { - return []IstioIngressGatewayMode{ - IstioIngressGatewayModeExternal, - IstioIngressGatewayModeInternal, - } -} - // KeyVaultNetworkAccessTypes - Network access of key vault. The possible values are Public and Private. Public means the // key vault allows public access from all networks. Private means the key vault disables public access and // enables private link. The default value is Public. @@ -353,25 +265,6 @@ func PossibleKubernetesSupportPlanValues() []KubernetesSupportPlan { } } -// Level - The guardrails level to be used. By default, Guardrails is enabled for all namespaces except those that AKS excludes -// via systemExcludedNamespaces -type Level string - -const ( - LevelEnforcement Level = "Enforcement" - LevelOff Level = "Off" - LevelWarning Level = "Warning" -) - -// PossibleLevelValues returns the possible values for the Level const type. -func PossibleLevelValues() []Level { - return []Level{ - LevelEnforcement, - LevelOff, - LevelWarning, - } -} - // LicenseType - The license type to use for Windows VMs. See Azure Hybrid User Benefits [https://azure.microsoft.com/pricing/hybrid-benefit/faq/] // for more details. type LicenseType string @@ -478,24 +371,6 @@ func PossibleManagedClusterSKUTierValues() []ManagedClusterSKUTier { } } -// Mode - Specify which proxy mode to use ('IPTABLES' or 'IPVS') -type Mode string - -const ( - // ModeIPTABLES - IPTables proxy mode - ModeIPTABLES Mode = "IPTABLES" - // ModeIPVS - IPVS proxy mode. Must be using Kubernetes version >= 1.22. - ModeIPVS Mode = "IPVS" -) - -// PossibleModeValues returns the possible values for the Mode const type. -func PossibleModeValues() []Mode { - return []Mode{ - ModeIPTABLES, - ModeIPVS, - } -} - // NetworkDataplane - Network dataplane used in the Kubernetes cluster. type NetworkDataplane string @@ -544,8 +419,8 @@ const ( // NetworkPluginKubenet - Use the Kubenet network plugin. See [Kubenet (basic) networking](https://docs.microsoft.com/azure/aks/concepts-network#kubenet-basic-networking) // for more information. NetworkPluginKubenet NetworkPlugin = "kubenet" - // NetworkPluginNone - Do not use a network plugin. A custom CNI will need to be installed after cluster creation for networking - // functionality. + // NetworkPluginNone - No CNI plugin is pre-installed. See [BYO CNI](https://docs.microsoft.com/en-us/azure/aks/use-byo-cni) + // for more information. NetworkPluginNone NetworkPlugin = "none" ) @@ -562,8 +437,8 @@ func PossibleNetworkPluginValues() []NetworkPlugin { type NetworkPluginMode string const ( - // NetworkPluginModeOverlay - Pods are given IPs from the PodCIDR address space but use Azure Routing Domains rather than - // Kubenet reference plugins host-local and bridge. + // NetworkPluginModeOverlay - Used with networkPlugin=azure, pods are given IPs from the PodCIDR address space but use Azure + // Routing Domains rather than Kubenet's method of route tables. For more information visit https://aka.ms/aks/azure-cni-overlay. NetworkPluginModeOverlay NetworkPluginMode = "overlay" ) @@ -597,41 +472,6 @@ func PossibleNetworkPolicyValues() []NetworkPolicy { } } -// NodeOSUpgradeChannel - The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. -type NodeOSUpgradeChannel string - -const ( - // NodeOSUpgradeChannelNodeImage - AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes - // on a weekly cadence. With the VHD update machines will be rolling reimaged to that VHD following maintenance windows and - // surge settings. No extra VHD cost is incurred when choosing this option as AKS hosts the images. - NodeOSUpgradeChannelNodeImage NodeOSUpgradeChannel = "NodeImage" - // NodeOSUpgradeChannelNone - No attempt to update your machines OS will be made either by OS or by rolling VHDs. This means - // you are responsible for your security updates - NodeOSUpgradeChannelNone NodeOSUpgradeChannel = "None" - // NodeOSUpgradeChannelSecurityPatch - AKS will update the nodes VHD with patches from the image maintainer labelled "security - // only" on a regular basis. Where possible, patches will also be applied without reimaging to existing nodes. Some patches, - // such as kernel patches, cannot be applied to existing nodes without disruption. For such patches, the VHD will be updated, - // and machines will be rolling reimaged to that VHD following maintenance windows and surge settings. This option incurs - // the extra cost of hosting the VHDs in your node resource group. - NodeOSUpgradeChannelSecurityPatch NodeOSUpgradeChannel = "SecurityPatch" - // NodeOSUpgradeChannelUnmanaged - OS updates will be applied automatically through the OS built-in patching infrastructure. - // Newly scaled in machines will be unpatched initially, and will be patched at some later time by the OS's infrastructure. - // Behavior of this option depends on the OS in question. Ubuntu and Mariner apply security patches through unattended upgrade - // roughly once a day around 06:00 UTC. Windows does not apply security patches automatically and so for them this option - // is equivalent to None till further notice - NodeOSUpgradeChannelUnmanaged NodeOSUpgradeChannel = "Unmanaged" -) - -// PossibleNodeOSUpgradeChannelValues returns the possible values for the NodeOSUpgradeChannel const type. -func PossibleNodeOSUpgradeChannelValues() []NodeOSUpgradeChannel { - return []NodeOSUpgradeChannel{ - NodeOSUpgradeChannelNodeImage, - NodeOSUpgradeChannelNone, - NodeOSUpgradeChannelSecurityPatch, - NodeOSUpgradeChannelUnmanaged, - } -} - // OSDiskType - The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. // Otherwise, defaults to 'Managed'. May not be changed after creation. For more information // see Ephemeral OS [https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os]. @@ -656,9 +496,8 @@ func PossibleOSDiskTypeValues() []OSDiskType { } } -// OSSKU - Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 -// if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 -// after Windows2019 is deprecated. +// OSSKU - Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 +// when Kubernetes = 1.25 if OSType is Windows. type OSSKU string const ( @@ -667,8 +506,6 @@ const ( OSSKUAzureLinux OSSKU = "AzureLinux" // OSSKUCBLMariner - Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead. OSSKUCBLMariner OSSKU = "CBLMariner" - // OSSKUMariner - Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead. - OSSKUMariner OSSKU = "Mariner" // OSSKUUbuntu - Use Ubuntu as the OS for node images. OSSKUUbuntu OSSKU = "Ubuntu" // OSSKUWindows2019 - Use Windows2019 as the OS for node images. Unsupported for system node pools. Windows2019 only supports @@ -684,7 +521,6 @@ func PossibleOSSKUValues() []OSSKU { return []OSSKU{ OSSKUAzureLinux, OSSKUCBLMariner, - OSSKUMariner, OSSKUUbuntu, OSSKUWindows2019, OSSKUWindows2022, @@ -759,34 +595,12 @@ func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpoin } } -// Protocol - The network protocol of the port. -type Protocol string - -const ( - // ProtocolTCP - TCP protocol. - ProtocolTCP Protocol = "TCP" - // ProtocolUDP - UDP protocol. - ProtocolUDP Protocol = "UDP" -) - -// PossibleProtocolValues returns the possible values for the Protocol const type. -func PossibleProtocolValues() []Protocol { - return []Protocol{ - ProtocolTCP, - ProtocolUDP, - } -} - // PublicNetworkAccess - Allow or deny public network access for AKS type PublicNetworkAccess string const ( - // PublicNetworkAccessDisabled - Inbound traffic to managedCluster is disabled, traffic from managedCluster is allowed. PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - // PublicNetworkAccessEnabled - Inbound/Outbound to the managedCluster is allowed. - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" - // PublicNetworkAccessSecuredByPerimeter - Inbound/Outbound traffic is managed by Microsoft.Network/NetworkSecurityPerimeters. - PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" ) // PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. @@ -794,7 +608,6 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { return []PublicNetworkAccess{ PublicNetworkAccessDisabled, PublicNetworkAccessEnabled, - PublicNetworkAccessSecuredByPerimeter, } } @@ -823,24 +636,6 @@ func PossibleResourceIdentityTypeValues() []ResourceIdentityType { } } -// RestrictionLevel - The restriction level applied to the cluster's node resource group -type RestrictionLevel string - -const ( - // RestrictionLevelReadOnly - Only */read RBAC permissions allowed on the managed node resource group - RestrictionLevelReadOnly RestrictionLevel = "ReadOnly" - // RestrictionLevelUnrestricted - All RBAC permissions are allowed on the managed node resource group - RestrictionLevelUnrestricted RestrictionLevel = "Unrestricted" -) - -// PossibleRestrictionLevelValues returns the possible values for the RestrictionLevel const type. -func PossibleRestrictionLevelValues() []RestrictionLevel { - return []RestrictionLevel{ - RestrictionLevelReadOnly, - RestrictionLevelUnrestricted, - } -} - // ScaleDownMode - Describes how VMs are added to or removed from Agent Pools. See billing states [https://docs.microsoft.com/azure/virtual-machines/states-billing]. type ScaleDownMode string @@ -901,30 +696,10 @@ func PossibleScaleSetPriorityValues() []ScaleSetPriority { } } -// ServiceMeshMode - Mode of the service mesh. -type ServiceMeshMode string - -const ( - // ServiceMeshModeDisabled - Mesh is disabled. - ServiceMeshModeDisabled ServiceMeshMode = "Disabled" - // ServiceMeshModeIstio - Istio deployed as an AKS addon. - ServiceMeshModeIstio ServiceMeshMode = "Istio" -) - -// PossibleServiceMeshModeValues returns the possible values for the ServiceMeshMode const type. -func PossibleServiceMeshModeValues() []ServiceMeshMode { - return []ServiceMeshMode{ - ServiceMeshModeDisabled, - ServiceMeshModeIstio, - } -} - // SnapshotType - The type of a snapshot. The default is NodePool. type SnapshotType string const ( - // SnapshotTypeManagedCluster - The snapshot is a snapshot of a managed cluster. - SnapshotTypeManagedCluster SnapshotType = "ManagedCluster" // SnapshotTypeNodePool - The snapshot is a snapshot of a node pool. SnapshotTypeNodePool SnapshotType = "NodePool" ) @@ -932,46 +707,23 @@ const ( // PossibleSnapshotTypeValues returns the possible values for the SnapshotType const type. func PossibleSnapshotTypeValues() []SnapshotType { return []SnapshotType{ - SnapshotTypeManagedCluster, SnapshotTypeNodePool, } } -// TrustedAccessRoleBindingProvisioningState - The current provisioning state of trusted access role binding. -type TrustedAccessRoleBindingProvisioningState string - -const ( - TrustedAccessRoleBindingProvisioningStateCanceled TrustedAccessRoleBindingProvisioningState = "Canceled" - TrustedAccessRoleBindingProvisioningStateDeleting TrustedAccessRoleBindingProvisioningState = "Deleting" - TrustedAccessRoleBindingProvisioningStateFailed TrustedAccessRoleBindingProvisioningState = "Failed" - TrustedAccessRoleBindingProvisioningStateSucceeded TrustedAccessRoleBindingProvisioningState = "Succeeded" - TrustedAccessRoleBindingProvisioningStateUpdating TrustedAccessRoleBindingProvisioningState = "Updating" -) - -// PossibleTrustedAccessRoleBindingProvisioningStateValues returns the possible values for the TrustedAccessRoleBindingProvisioningState const type. -func PossibleTrustedAccessRoleBindingProvisioningStateValues() []TrustedAccessRoleBindingProvisioningState { - return []TrustedAccessRoleBindingProvisioningState{ - TrustedAccessRoleBindingProvisioningStateCanceled, - TrustedAccessRoleBindingProvisioningStateDeleting, - TrustedAccessRoleBindingProvisioningStateFailed, - TrustedAccessRoleBindingProvisioningStateSucceeded, - TrustedAccessRoleBindingProvisioningStateUpdating, - } -} - -// Type - Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. +// Type - Specifies on which week of the month the dayOfWeek applies. type Type string const ( - // TypeFirst - First. + // TypeFirst - First week of the month. TypeFirst Type = "First" - // TypeFourth - Fourth. + // TypeFourth - Fourth week of the month. TypeFourth Type = "Fourth" - // TypeLast - Last. + // TypeLast - Last week of the month. TypeLast Type = "Last" - // TypeSecond - Second. + // TypeSecond - Second week of the month. TypeSecond Type = "Second" - // TypeThird - Third. + // TypeThird - Third week of the month. TypeThird Type = "Third" ) @@ -986,41 +738,14 @@ func PossibleTypeValues() []Type { } } -// UpdateMode - Each update mode level is a superset of the lower levels. Off[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/abort` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - agentPoolNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.BeginAbortLatestOperation(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, agentPoolNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - a.beginAbortLatestOperation = &respr - } - - resp, err := server.PollerResponderNext(a.beginAbortLatestOperation, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(a.beginAbortLatestOperation) { - a.beginAbortLatestOperation = nil - } - - return resp, nil -} - -func (a *AgentPoolsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if a.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - if a.beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.AgentPool](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - agentPoolNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, agentPoolNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - a.beginCreateOrUpdate = &respr - } - - resp, err := server.PollerResponderNext(a.beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(a.beginCreateOrUpdate) { - a.beginCreateOrUpdate = nil - } - - return resp, nil -} - -func (a *AgentPoolsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if a.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - if a.beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - agentPoolNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) - if err != nil { - return nil, err - } - ignorePodDisruptionBudgetUnescaped, err := url.QueryUnescape(qp.Get("ignore-pod-disruption-budget")) - if err != nil { - return nil, err - } - ignorePodDisruptionBudgetParam, err := parseOptional(ignorePodDisruptionBudgetUnescaped, strconv.ParseBool) - if err != nil { - return nil, err - } - var options *armcontainerservice.AgentPoolsClientBeginDeleteOptions - if ignorePodDisruptionBudgetParam != nil { - options = &armcontainerservice.AgentPoolsClientBeginDeleteOptions{ - IgnorePodDisruptionBudget: ignorePodDisruptionBudgetParam, - } - } - respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, agentPoolNameUnescaped, options) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - a.beginDelete = &respr - } - - resp, err := server.PollerResponderNext(a.beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(a.beginDelete) { - a.beginDelete = nil - } - - return resp, nil -} - -func (a *AgentPoolsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if a.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - agentPoolNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, agentPoolNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AgentPool, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AgentPoolsServerTransport) dispatchGetAvailableAgentPoolVersions(req *http.Request) (*http.Response, error) { - if a.srv.GetAvailableAgentPoolVersions == nil { - return nil, &nonRetriableError{errors.New("fake for method GetAvailableAgentPoolVersions not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/availableAgentPoolVersions` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.GetAvailableAgentPoolVersions(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AgentPoolAvailableVersions, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AgentPoolsServerTransport) dispatchGetUpgradeProfile(req *http.Request) (*http.Response, error) { - if a.srv.GetUpgradeProfile == nil { - return nil, &nonRetriableError{errors.New("fake for method GetUpgradeProfile not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/upgradeProfiles/default` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - agentPoolNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.GetUpgradeProfile(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, agentPoolNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AgentPoolUpgradeProfile, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AgentPoolsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if a.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - if a.newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - resp := a.srv.NewListPager(resourceGroupNameUnescaped, resourceNameUnescaped, nil) - a.newListPager = &resp - server.PagerResponderInjectNextLinks(a.newListPager, req, func(page *armcontainerservice.AgentPoolsClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(a.newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(a.newListPager) { - a.newListPager = nil - } - return resp, nil -} - -func (a *AgentPoolsServerTransport) dispatchBeginUpgradeNodeImageVersion(req *http.Request) (*http.Response, error) { - if a.srv.BeginUpgradeNodeImageVersion == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpgradeNodeImageVersion not implemented")} - } - if a.beginUpgradeNodeImageVersion == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/upgradeNodeImageVersion` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - agentPoolNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.BeginUpgradeNodeImageVersion(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, agentPoolNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - a.beginUpgradeNodeImageVersion = &respr - } - - resp, err := server.PollerResponderNext(a.beginUpgradeNodeImageVersion, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(a.beginUpgradeNodeImageVersion) { - a.beginUpgradeNodeImageVersion = nil - } - - return resp, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/date_type.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/date_type.go deleted file mode 100644 index efb0b705ae45..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/date_type.go +++ /dev/null @@ -1,59 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "strings" - "time" -) - -const ( - fullDateJSON = `"2006-01-02"` - jsonFormat = `"%04d-%02d-%02d"` -) - -type dateType time.Time - -func (t dateType) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(jsonFormat, time.Time(t).Year(), time.Time(t).Month(), time.Time(t).Day())), nil -} - -func (d *dateType) UnmarshalJSON(data []byte) (err error) { - t, err := time.Parse(fullDateJSON, string(data)) - *d = (dateType)(t) - return err -} - -func populateDateType(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateType)(t) -} - -func unpopulateDateType(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { - return nil - } - var aux dateType - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/internal.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/internal.go deleted file mode 100644 index e9c8222f2199..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/internal.go +++ /dev/null @@ -1,78 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "io" - "net/http" - "reflect" -) - -type nonRetriableError struct { - error -} - -func (nonRetriableError) NonRetriable() { - // marker method -} - -func getOptional[T any](v T) *T { - if reflect.ValueOf(v).IsZero() { - return nil - } - return &v -} - -func getHeaderValue(h http.Header, k string) string { - v := h[k] - if len(v) == 0 { - return "" - } - return v[0] -} - -func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) { - if v == "" { - return nil, nil - } - t, err := parse(v) - if err != nil { - return nil, err - } - return &t, err -} - -func parseWithCast[T any](v string, parse func(v string) (T, error)) (T, error) { - t, err := parse(v) - if err != nil { - return *new(T), err - } - return t, err -} - -func readRequestBody(req *http.Request) ([]byte, error) { - if req.Body == nil { - return nil, nil - } - body, err := io.ReadAll(req.Body) - if err != nil { - return nil, err - } - req.Body.Close() - return body, nil -} - -func contains[T comparable](s []T, v T) bool { - for _, vv := range s { - if vv == v { - return true - } - } - return false -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/maintenanceconfigurations_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/maintenanceconfigurations_server.go deleted file mode 100644 index dd8417d0f540..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/maintenanceconfigurations_server.go +++ /dev/null @@ -1,240 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "net/http" - "net/url" - "regexp" -) - -// MaintenanceConfigurationsServer is a fake server for instances of the armcontainerservice.MaintenanceConfigurationsClient type. -type MaintenanceConfigurationsServer struct { - // CreateOrUpdate is the fake for method MaintenanceConfigurationsClient.CreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - CreateOrUpdate func(ctx context.Context, resourceGroupName string, resourceName string, configName string, parameters armcontainerservice.MaintenanceConfiguration, options *armcontainerservice.MaintenanceConfigurationsClientCreateOrUpdateOptions) (resp azfake.Responder[armcontainerservice.MaintenanceConfigurationsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // Delete is the fake for method MaintenanceConfigurationsClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, resourceGroupName string, resourceName string, configName string, options *armcontainerservice.MaintenanceConfigurationsClientDeleteOptions) (resp azfake.Responder[armcontainerservice.MaintenanceConfigurationsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method MaintenanceConfigurationsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, resourceName string, configName string, options *armcontainerservice.MaintenanceConfigurationsClientGetOptions) (resp azfake.Responder[armcontainerservice.MaintenanceConfigurationsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByManagedClusterPager is the fake for method MaintenanceConfigurationsClient.NewListByManagedClusterPager - // HTTP status codes to indicate success: http.StatusOK - NewListByManagedClusterPager func(resourceGroupName string, resourceName string, options *armcontainerservice.MaintenanceConfigurationsClientListByManagedClusterOptions) (resp azfake.PagerResponder[armcontainerservice.MaintenanceConfigurationsClientListByManagedClusterResponse]) -} - -// NewMaintenanceConfigurationsServerTransport creates a new instance of MaintenanceConfigurationsServerTransport with the provided implementation. -// The returned MaintenanceConfigurationsServerTransport instance is connected to an instance of armcontainerservice.MaintenanceConfigurationsClient by way of the -// undefined.Transporter field. -func NewMaintenanceConfigurationsServerTransport(srv *MaintenanceConfigurationsServer) *MaintenanceConfigurationsServerTransport { - return &MaintenanceConfigurationsServerTransport{srv: srv} -} - -// MaintenanceConfigurationsServerTransport connects instances of armcontainerservice.MaintenanceConfigurationsClient to instances of MaintenanceConfigurationsServer. -// Don't use this type directly, use NewMaintenanceConfigurationsServerTransport instead. -type MaintenanceConfigurationsServerTransport struct { - srv *MaintenanceConfigurationsServer - newListByManagedClusterPager *azfake.PagerResponder[armcontainerservice.MaintenanceConfigurationsClientListByManagedClusterResponse] -} - -// Do implements the policy.Transporter interface for MaintenanceConfigurationsServerTransport. -func (m *MaintenanceConfigurationsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "MaintenanceConfigurationsClient.CreateOrUpdate": - resp, err = m.dispatchCreateOrUpdate(req) - case "MaintenanceConfigurationsClient.Delete": - resp, err = m.dispatchDelete(req) - case "MaintenanceConfigurationsClient.Get": - resp, err = m.dispatchGet(req) - case "MaintenanceConfigurationsClient.NewListByManagedClusterPager": - resp, err = m.dispatchNewListByManagedClusterPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (m *MaintenanceConfigurationsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { - if m.srv.CreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/maintenanceConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.MaintenanceConfiguration](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - configNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("configName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.CreateOrUpdate(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, configNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MaintenanceConfiguration, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *MaintenanceConfigurationsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if m.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/maintenanceConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - configNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("configName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.Delete(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, configNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *MaintenanceConfigurationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if m.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/maintenanceConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - configNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("configName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, configNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MaintenanceConfiguration, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *MaintenanceConfigurationsServerTransport) dispatchNewListByManagedClusterPager(req *http.Request) (*http.Response, error) { - if m.srv.NewListByManagedClusterPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByManagedClusterPager not implemented")} - } - if m.newListByManagedClusterPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/maintenanceConfigurations` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - resp := m.srv.NewListByManagedClusterPager(resourceGroupNameUnescaped, resourceNameUnescaped, nil) - m.newListByManagedClusterPager = &resp - server.PagerResponderInjectNextLinks(m.newListByManagedClusterPager, req, func(page *armcontainerservice.MaintenanceConfigurationsClientListByManagedClusterResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(m.newListByManagedClusterPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(m.newListByManagedClusterPager) { - m.newListByManagedClusterPager = nil - } - return resp, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclusters_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclusters_server.go deleted file mode 100644 index 8d3cc87deb38..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclusters_server.go +++ /dev/null @@ -1,1157 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "net/http" - "net/url" - "regexp" - "strconv" -) - -// ManagedClustersServer is a fake server for instances of the armcontainerservice.ManagedClustersClient type. -type ManagedClustersServer struct { - // BeginAbortLatestOperation is the fake for method ManagedClustersClient.BeginAbortLatestOperation - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginAbortLatestOperation func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientBeginAbortLatestOperationOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientAbortLatestOperationResponse], errResp azfake.ErrorResponder) - - // BeginCreateOrUpdate is the fake for method ManagedClustersClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.ManagedCluster, options *armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method ManagedClustersClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method ManagedClustersClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientGetOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetResponse], errResp azfake.ErrorResponder) - - // GetAccessProfile is the fake for method ManagedClustersClient.GetAccessProfile - // HTTP status codes to indicate success: http.StatusOK - GetAccessProfile func(ctx context.Context, resourceGroupName string, resourceName string, roleName string, options *armcontainerservice.ManagedClustersClientGetAccessProfileOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetAccessProfileResponse], errResp azfake.ErrorResponder) - - // GetCommandResult is the fake for method ManagedClustersClient.GetCommandResult - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - GetCommandResult func(ctx context.Context, resourceGroupName string, resourceName string, commandID string, options *armcontainerservice.ManagedClustersClientGetCommandResultOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetCommandResultResponse], errResp azfake.ErrorResponder) - - // GetOSOptions is the fake for method ManagedClustersClient.GetOSOptions - // HTTP status codes to indicate success: http.StatusOK - GetOSOptions func(ctx context.Context, location string, options *armcontainerservice.ManagedClustersClientGetOSOptionsOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetOSOptionsResponse], errResp azfake.ErrorResponder) - - // GetUpgradeProfile is the fake for method ManagedClustersClient.GetUpgradeProfile - // HTTP status codes to indicate success: http.StatusOK - GetUpgradeProfile func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientGetUpgradeProfileOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetUpgradeProfileResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method ManagedClustersClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(options *armcontainerservice.ManagedClustersClientListOptions) (resp azfake.PagerResponder[armcontainerservice.ManagedClustersClientListResponse]) - - // NewListByResourceGroupPager is the fake for method ManagedClustersClient.NewListByResourceGroupPager - // HTTP status codes to indicate success: http.StatusOK - NewListByResourceGroupPager func(resourceGroupName string, options *armcontainerservice.ManagedClustersClientListByResourceGroupOptions) (resp azfake.PagerResponder[armcontainerservice.ManagedClustersClientListByResourceGroupResponse]) - - // ListClusterAdminCredentials is the fake for method ManagedClustersClient.ListClusterAdminCredentials - // HTTP status codes to indicate success: http.StatusOK - ListClusterAdminCredentials func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientListClusterAdminCredentialsOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientListClusterAdminCredentialsResponse], errResp azfake.ErrorResponder) - - // ListClusterMonitoringUserCredentials is the fake for method ManagedClustersClient.ListClusterMonitoringUserCredentials - // HTTP status codes to indicate success: http.StatusOK - ListClusterMonitoringUserCredentials func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientListClusterMonitoringUserCredentialsOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientListClusterMonitoringUserCredentialsResponse], errResp azfake.ErrorResponder) - - // ListClusterUserCredentials is the fake for method ManagedClustersClient.ListClusterUserCredentials - // HTTP status codes to indicate success: http.StatusOK - ListClusterUserCredentials func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientListClusterUserCredentialsOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientListClusterUserCredentialsResponse], errResp azfake.ErrorResponder) - - // ListKubernetesVersions is the fake for method ManagedClustersClient.ListKubernetesVersions - // HTTP status codes to indicate success: http.StatusOK - ListKubernetesVersions func(ctx context.Context, location string, options *armcontainerservice.ManagedClustersClientListKubernetesVersionsOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientListKubernetesVersionsResponse], errResp azfake.ErrorResponder) - - // NewListOutboundNetworkDependenciesEndpointsPager is the fake for method ManagedClustersClient.NewListOutboundNetworkDependenciesEndpointsPager - // HTTP status codes to indicate success: http.StatusOK - NewListOutboundNetworkDependenciesEndpointsPager func(resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions) (resp azfake.PagerResponder[armcontainerservice.ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse]) - - // BeginResetAADProfile is the fake for method ManagedClustersClient.BeginResetAADProfile - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginResetAADProfile func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.ManagedClusterAADProfile, options *armcontainerservice.ManagedClustersClientBeginResetAADProfileOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetAADProfileResponse], errResp azfake.ErrorResponder) - - // BeginResetServicePrincipalProfile is the fake for method ManagedClustersClient.BeginResetServicePrincipalProfile - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginResetServicePrincipalProfile func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.ManagedClusterServicePrincipalProfile, options *armcontainerservice.ManagedClustersClientBeginResetServicePrincipalProfileOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetServicePrincipalProfileResponse], errResp azfake.ErrorResponder) - - // BeginRotateClusterCertificates is the fake for method ManagedClustersClient.BeginRotateClusterCertificates - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginRotateClusterCertificates func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientBeginRotateClusterCertificatesOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientRotateClusterCertificatesResponse], errResp azfake.ErrorResponder) - - // BeginRotateServiceAccountSigningKeys is the fake for method ManagedClustersClient.BeginRotateServiceAccountSigningKeys - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginRotateServiceAccountSigningKeys func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientRotateServiceAccountSigningKeysResponse], errResp azfake.ErrorResponder) - - // BeginRunCommand is the fake for method ManagedClustersClient.BeginRunCommand - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginRunCommand func(ctx context.Context, resourceGroupName string, resourceName string, requestPayload armcontainerservice.RunCommandRequest, options *armcontainerservice.ManagedClustersClientBeginRunCommandOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientRunCommandResponse], errResp azfake.ErrorResponder) - - // BeginStart is the fake for method ManagedClustersClient.BeginStart - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginStart func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientBeginStartOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientStartResponse], errResp azfake.ErrorResponder) - - // BeginStop is the fake for method ManagedClustersClient.BeginStop - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginStop func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientBeginStopOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientStopResponse], errResp azfake.ErrorResponder) - - // BeginUpdateTags is the fake for method ManagedClustersClient.BeginUpdateTags - // HTTP status codes to indicate success: http.StatusOK - BeginUpdateTags func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.TagsObject, options *armcontainerservice.ManagedClustersClientBeginUpdateTagsOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientUpdateTagsResponse], errResp azfake.ErrorResponder) -} - -// NewManagedClustersServerTransport creates a new instance of ManagedClustersServerTransport with the provided implementation. -// The returned ManagedClustersServerTransport instance is connected to an instance of armcontainerservice.ManagedClustersClient by way of the -// undefined.Transporter field. -func NewManagedClustersServerTransport(srv *ManagedClustersServer) *ManagedClustersServerTransport { - return &ManagedClustersServerTransport{srv: srv} -} - -// ManagedClustersServerTransport connects instances of armcontainerservice.ManagedClustersClient to instances of ManagedClustersServer. -// Don't use this type directly, use NewManagedClustersServerTransport instead. -type ManagedClustersServerTransport struct { - srv *ManagedClustersServer - beginAbortLatestOperation *azfake.PollerResponder[armcontainerservice.ManagedClustersClientAbortLatestOperationResponse] - beginCreateOrUpdate *azfake.PollerResponder[armcontainerservice.ManagedClustersClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcontainerservice.ManagedClustersClientDeleteResponse] - newListPager *azfake.PagerResponder[armcontainerservice.ManagedClustersClientListResponse] - newListByResourceGroupPager *azfake.PagerResponder[armcontainerservice.ManagedClustersClientListByResourceGroupResponse] - newListOutboundNetworkDependenciesEndpointsPager *azfake.PagerResponder[armcontainerservice.ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse] - beginResetAADProfile *azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetAADProfileResponse] - beginResetServicePrincipalProfile *azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetServicePrincipalProfileResponse] - beginRotateClusterCertificates *azfake.PollerResponder[armcontainerservice.ManagedClustersClientRotateClusterCertificatesResponse] - beginRotateServiceAccountSigningKeys *azfake.PollerResponder[armcontainerservice.ManagedClustersClientRotateServiceAccountSigningKeysResponse] - beginRunCommand *azfake.PollerResponder[armcontainerservice.ManagedClustersClientRunCommandResponse] - beginStart *azfake.PollerResponder[armcontainerservice.ManagedClustersClientStartResponse] - beginStop *azfake.PollerResponder[armcontainerservice.ManagedClustersClientStopResponse] - beginUpdateTags *azfake.PollerResponder[armcontainerservice.ManagedClustersClientUpdateTagsResponse] -} - -// Do implements the policy.Transporter interface for ManagedClustersServerTransport. -func (m *ManagedClustersServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "ManagedClustersClient.BeginAbortLatestOperation": - resp, err = m.dispatchBeginAbortLatestOperation(req) - case "ManagedClustersClient.BeginCreateOrUpdate": - resp, err = m.dispatchBeginCreateOrUpdate(req) - case "ManagedClustersClient.BeginDelete": - resp, err = m.dispatchBeginDelete(req) - case "ManagedClustersClient.Get": - resp, err = m.dispatchGet(req) - case "ManagedClustersClient.GetAccessProfile": - resp, err = m.dispatchGetAccessProfile(req) - case "ManagedClustersClient.GetCommandResult": - resp, err = m.dispatchGetCommandResult(req) - case "ManagedClustersClient.GetOSOptions": - resp, err = m.dispatchGetOSOptions(req) - case "ManagedClustersClient.GetUpgradeProfile": - resp, err = m.dispatchGetUpgradeProfile(req) - case "ManagedClustersClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - case "ManagedClustersClient.NewListByResourceGroupPager": - resp, err = m.dispatchNewListByResourceGroupPager(req) - case "ManagedClustersClient.ListClusterAdminCredentials": - resp, err = m.dispatchListClusterAdminCredentials(req) - case "ManagedClustersClient.ListClusterMonitoringUserCredentials": - resp, err = m.dispatchListClusterMonitoringUserCredentials(req) - case "ManagedClustersClient.ListClusterUserCredentials": - resp, err = m.dispatchListClusterUserCredentials(req) - case "ManagedClustersClient.ListKubernetesVersions": - resp, err = m.dispatchListKubernetesVersions(req) - case "ManagedClustersClient.NewListOutboundNetworkDependenciesEndpointsPager": - resp, err = m.dispatchNewListOutboundNetworkDependenciesEndpointsPager(req) - case "ManagedClustersClient.BeginResetAADProfile": - resp, err = m.dispatchBeginResetAADProfile(req) - case "ManagedClustersClient.BeginResetServicePrincipalProfile": - resp, err = m.dispatchBeginResetServicePrincipalProfile(req) - case "ManagedClustersClient.BeginRotateClusterCertificates": - resp, err = m.dispatchBeginRotateClusterCertificates(req) - case "ManagedClustersClient.BeginRotateServiceAccountSigningKeys": - resp, err = m.dispatchBeginRotateServiceAccountSigningKeys(req) - case "ManagedClustersClient.BeginRunCommand": - resp, err = m.dispatchBeginRunCommand(req) - case "ManagedClustersClient.BeginStart": - resp, err = m.dispatchBeginStart(req) - case "ManagedClustersClient.BeginStop": - resp, err = m.dispatchBeginStop(req) - case "ManagedClustersClient.BeginUpdateTags": - resp, err = m.dispatchBeginUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchBeginAbortLatestOperation(req *http.Request) (*http.Response, error) { - if m.srv.BeginAbortLatestOperation == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginAbortLatestOperation not implemented")} - } - if m.beginAbortLatestOperation == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/abort` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginAbortLatestOperation(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - m.beginAbortLatestOperation = &respr - } - - resp, err := server.PollerResponderNext(m.beginAbortLatestOperation, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(m.beginAbortLatestOperation) { - m.beginAbortLatestOperation = nil - } - - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if m.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - if m.beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.ManagedCluster](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - m.beginCreateOrUpdate = &respr - } - - resp, err := server.PollerResponderNext(m.beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(m.beginCreateOrUpdate) { - m.beginCreateOrUpdate = nil - } - - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if m.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - if m.beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - ignorePodDisruptionBudgetUnescaped, err := url.QueryUnescape(qp.Get("ignore-pod-disruption-budget")) - if err != nil { - return nil, err - } - ignorePodDisruptionBudgetParam, err := parseOptional(ignorePodDisruptionBudgetUnescaped, strconv.ParseBool) - if err != nil { - return nil, err - } - var options *armcontainerservice.ManagedClustersClientBeginDeleteOptions - if ignorePodDisruptionBudgetParam != nil { - options = &armcontainerservice.ManagedClustersClientBeginDeleteOptions{ - IgnorePodDisruptionBudget: ignorePodDisruptionBudgetParam, - } - } - respr, errRespr := m.srv.BeginDelete(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, options) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - m.beginDelete = &respr - } - - resp, err := server.PollerResponderNext(m.beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(m.beginDelete) { - m.beginDelete = nil - } - - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if m.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagedCluster, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchGetAccessProfile(req *http.Request) (*http.Response, error) { - if m.srv.GetAccessProfile == nil { - return nil, &nonRetriableError{errors.New("fake for method GetAccessProfile not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accessProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listCredential` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - roleNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("roleName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.GetAccessProfile(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, roleNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagedClusterAccessProfile, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchGetCommandResult(req *http.Request) (*http.Response, error) { - if m.srv.GetCommandResult == nil { - return nil, &nonRetriableError{errors.New("fake for method GetCommandResult not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/commandResults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - commandIDUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("commandId")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.GetCommandResult(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, commandIDUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusAccepted}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RunCommandResult, req) - if err != nil { - return nil, err - } - if val := server.GetResponse(respr).Location; val != nil { - resp.Header.Set("Location", *val) - } - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchGetOSOptions(req *http.Request) (*http.Response, error) { - if m.srv.GetOSOptions == nil { - return nil, &nonRetriableError{errors.New("fake for method GetOSOptions not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/osOptions/default` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - locationUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - resourceTypeUnescaped, err := url.QueryUnescape(qp.Get("resource-type")) - if err != nil { - return nil, err - } - resourceTypeParam := getOptional(resourceTypeUnescaped) - var options *armcontainerservice.ManagedClustersClientGetOSOptionsOptions - if resourceTypeParam != nil { - options = &armcontainerservice.ManagedClustersClientGetOSOptionsOptions{ - ResourceType: resourceTypeParam, - } - } - respr, errRespr := m.srv.GetOSOptions(req.Context(), locationUnescaped, options) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OSOptionProfile, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchGetUpgradeProfile(req *http.Request) (*http.Response, error) { - if m.srv.GetUpgradeProfile == nil { - return nil, &nonRetriableError{errors.New("fake for method GetUpgradeProfile not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/upgradeProfiles/default` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.GetUpgradeProfile(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagedClusterUpgradeProfile, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if m.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - if m.newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resp := m.srv.NewListPager(nil) - m.newListPager = &resp - server.PagerResponderInjectNextLinks(m.newListPager, req, func(page *armcontainerservice.ManagedClustersClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(m.newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(m.newListPager) { - m.newListPager = nil - } - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { - if m.srv.NewListByResourceGroupPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} - } - if m.newListByResourceGroupPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resp := m.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - m.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(m.newListByResourceGroupPager, req, func(page *armcontainerservice.ManagedClustersClientListByResourceGroupResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(m.newListByResourceGroupPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(m.newListByResourceGroupPager) { - m.newListByResourceGroupPager = nil - } - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchListClusterAdminCredentials(req *http.Request) (*http.Response, error) { - if m.srv.ListClusterAdminCredentials == nil { - return nil, &nonRetriableError{errors.New("fake for method ListClusterAdminCredentials not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listClusterAdminCredential` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - serverFqdnUnescaped, err := url.QueryUnescape(qp.Get("server-fqdn")) - if err != nil { - return nil, err - } - serverFqdnParam := getOptional(serverFqdnUnescaped) - var options *armcontainerservice.ManagedClustersClientListClusterAdminCredentialsOptions - if serverFqdnParam != nil { - options = &armcontainerservice.ManagedClustersClientListClusterAdminCredentialsOptions{ - ServerFqdn: serverFqdnParam, - } - } - respr, errRespr := m.srv.ListClusterAdminCredentials(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, options) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CredentialResults, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchListClusterMonitoringUserCredentials(req *http.Request) (*http.Response, error) { - if m.srv.ListClusterMonitoringUserCredentials == nil { - return nil, &nonRetriableError{errors.New("fake for method ListClusterMonitoringUserCredentials not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listClusterMonitoringUserCredential` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - serverFqdnUnescaped, err := url.QueryUnescape(qp.Get("server-fqdn")) - if err != nil { - return nil, err - } - serverFqdnParam := getOptional(serverFqdnUnescaped) - var options *armcontainerservice.ManagedClustersClientListClusterMonitoringUserCredentialsOptions - if serverFqdnParam != nil { - options = &armcontainerservice.ManagedClustersClientListClusterMonitoringUserCredentialsOptions{ - ServerFqdn: serverFqdnParam, - } - } - respr, errRespr := m.srv.ListClusterMonitoringUserCredentials(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, options) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CredentialResults, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchListClusterUserCredentials(req *http.Request) (*http.Response, error) { - if m.srv.ListClusterUserCredentials == nil { - return nil, &nonRetriableError{errors.New("fake for method ListClusterUserCredentials not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listClusterUserCredential` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - serverFqdnUnescaped, err := url.QueryUnescape(qp.Get("server-fqdn")) - if err != nil { - return nil, err - } - serverFqdnParam := getOptional(serverFqdnUnescaped) - formatUnescaped, err := url.QueryUnescape(qp.Get("format")) - if err != nil { - return nil, err - } - formatParam := getOptional(armcontainerservice.Format(formatUnescaped)) - var options *armcontainerservice.ManagedClustersClientListClusterUserCredentialsOptions - if serverFqdnParam != nil || formatParam != nil { - options = &armcontainerservice.ManagedClustersClientListClusterUserCredentialsOptions{ - ServerFqdn: serverFqdnParam, - Format: formatParam, - } - } - respr, errRespr := m.srv.ListClusterUserCredentials(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, options) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CredentialResults, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchListKubernetesVersions(req *http.Request) (*http.Response, error) { - if m.srv.ListKubernetesVersions == nil { - return nil, &nonRetriableError{errors.New("fake for method ListKubernetesVersions not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/kubernetesVersions` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - locationUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.ListKubernetesVersions(req.Context(), locationUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).KubernetesVersionListResult, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchNewListOutboundNetworkDependenciesEndpointsPager(req *http.Request) (*http.Response, error) { - if m.srv.NewListOutboundNetworkDependenciesEndpointsPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListOutboundNetworkDependenciesEndpointsPager not implemented")} - } - if m.newListOutboundNetworkDependenciesEndpointsPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/outboundNetworkDependenciesEndpoints` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - resp := m.srv.NewListOutboundNetworkDependenciesEndpointsPager(resourceGroupNameUnescaped, resourceNameUnescaped, nil) - m.newListOutboundNetworkDependenciesEndpointsPager = &resp - server.PagerResponderInjectNextLinks(m.newListOutboundNetworkDependenciesEndpointsPager, req, func(page *armcontainerservice.ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(m.newListOutboundNetworkDependenciesEndpointsPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(m.newListOutboundNetworkDependenciesEndpointsPager) { - m.newListOutboundNetworkDependenciesEndpointsPager = nil - } - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchBeginResetAADProfile(req *http.Request) (*http.Response, error) { - if m.srv.BeginResetAADProfile == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginResetAADProfile not implemented")} - } - if m.beginResetAADProfile == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resetAADProfile` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.ManagedClusterAADProfile](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginResetAADProfile(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - m.beginResetAADProfile = &respr - } - - resp, err := server.PollerResponderNext(m.beginResetAADProfile, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(m.beginResetAADProfile) { - m.beginResetAADProfile = nil - } - - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchBeginResetServicePrincipalProfile(req *http.Request) (*http.Response, error) { - if m.srv.BeginResetServicePrincipalProfile == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginResetServicePrincipalProfile not implemented")} - } - if m.beginResetServicePrincipalProfile == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resetServicePrincipalProfile` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.ManagedClusterServicePrincipalProfile](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginResetServicePrincipalProfile(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - m.beginResetServicePrincipalProfile = &respr - } - - resp, err := server.PollerResponderNext(m.beginResetServicePrincipalProfile, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(m.beginResetServicePrincipalProfile) { - m.beginResetServicePrincipalProfile = nil - } - - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchBeginRotateClusterCertificates(req *http.Request) (*http.Response, error) { - if m.srv.BeginRotateClusterCertificates == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginRotateClusterCertificates not implemented")} - } - if m.beginRotateClusterCertificates == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rotateClusterCertificates` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginRotateClusterCertificates(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - m.beginRotateClusterCertificates = &respr - } - - resp, err := server.PollerResponderNext(m.beginRotateClusterCertificates, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(m.beginRotateClusterCertificates) { - m.beginRotateClusterCertificates = nil - } - - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchBeginRotateServiceAccountSigningKeys(req *http.Request) (*http.Response, error) { - if m.srv.BeginRotateServiceAccountSigningKeys == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginRotateServiceAccountSigningKeys not implemented")} - } - if m.beginRotateServiceAccountSigningKeys == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rotateServiceAccountSigningKeys` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginRotateServiceAccountSigningKeys(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - m.beginRotateServiceAccountSigningKeys = &respr - } - - resp, err := server.PollerResponderNext(m.beginRotateServiceAccountSigningKeys, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(m.beginRotateServiceAccountSigningKeys) { - m.beginRotateServiceAccountSigningKeys = nil - } - - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchBeginRunCommand(req *http.Request) (*http.Response, error) { - if m.srv.BeginRunCommand == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginRunCommand not implemented")} - } - if m.beginRunCommand == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommand` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.RunCommandRequest](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginRunCommand(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - m.beginRunCommand = &respr - } - - resp, err := server.PollerResponderNext(m.beginRunCommand, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(m.beginRunCommand) { - m.beginRunCommand = nil - } - - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchBeginStart(req *http.Request) (*http.Response, error) { - if m.srv.BeginStart == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} - } - if m.beginStart == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/start` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginStart(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - m.beginStart = &respr - } - - resp, err := server.PollerResponderNext(m.beginStart, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(m.beginStart) { - m.beginStart = nil - } - - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchBeginStop(req *http.Request) (*http.Response, error) { - if m.srv.BeginStop == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginStop not implemented")} - } - if m.beginStop == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stop` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginStop(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - m.beginStop = &respr - } - - resp, err := server.PollerResponderNext(m.beginStop, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(m.beginStop) { - m.beginStop = nil - } - - return resp, nil -} - -func (m *ManagedClustersServerTransport) dispatchBeginUpdateTags(req *http.Request) (*http.Response, error) { - if m.srv.BeginUpdateTags == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdateTags not implemented")} - } - if m.beginUpdateTags == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.TagsObject](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginUpdateTags(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - m.beginUpdateTags = &respr - } - - resp, err := server.PollerResponderNext(m.beginUpdateTags, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PollerResponderMore(m.beginUpdateTags) { - m.beginUpdateTags = nil - } - - return resp, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclustersnapshots_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclustersnapshots_server.go deleted file mode 100644 index 3d834abe57a1..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclustersnapshots_server.go +++ /dev/null @@ -1,304 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "net/http" - "net/url" - "regexp" -) - -// ManagedClusterSnapshotsServer is a fake server for instances of the armcontainerservice.ManagedClusterSnapshotsClient type. -type ManagedClusterSnapshotsServer struct { - // CreateOrUpdate is the fake for method ManagedClusterSnapshotsClient.CreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - CreateOrUpdate func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.ManagedClusterSnapshot, options *armcontainerservice.ManagedClusterSnapshotsClientCreateOrUpdateOptions) (resp azfake.Responder[armcontainerservice.ManagedClusterSnapshotsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // Delete is the fake for method ManagedClusterSnapshotsClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClusterSnapshotsClientDeleteOptions) (resp azfake.Responder[armcontainerservice.ManagedClusterSnapshotsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method ManagedClusterSnapshotsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClusterSnapshotsClientGetOptions) (resp azfake.Responder[armcontainerservice.ManagedClusterSnapshotsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method ManagedClusterSnapshotsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(options *armcontainerservice.ManagedClusterSnapshotsClientListOptions) (resp azfake.PagerResponder[armcontainerservice.ManagedClusterSnapshotsClientListResponse]) - - // NewListByResourceGroupPager is the fake for method ManagedClusterSnapshotsClient.NewListByResourceGroupPager - // HTTP status codes to indicate success: http.StatusOK - NewListByResourceGroupPager func(resourceGroupName string, options *armcontainerservice.ManagedClusterSnapshotsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armcontainerservice.ManagedClusterSnapshotsClientListByResourceGroupResponse]) - - // UpdateTags is the fake for method ManagedClusterSnapshotsClient.UpdateTags - // HTTP status codes to indicate success: http.StatusOK - UpdateTags func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.TagsObject, options *armcontainerservice.ManagedClusterSnapshotsClientUpdateTagsOptions) (resp azfake.Responder[armcontainerservice.ManagedClusterSnapshotsClientUpdateTagsResponse], errResp azfake.ErrorResponder) -} - -// NewManagedClusterSnapshotsServerTransport creates a new instance of ManagedClusterSnapshotsServerTransport with the provided implementation. -// The returned ManagedClusterSnapshotsServerTransport instance is connected to an instance of armcontainerservice.ManagedClusterSnapshotsClient by way of the -// undefined.Transporter field. -func NewManagedClusterSnapshotsServerTransport(srv *ManagedClusterSnapshotsServer) *ManagedClusterSnapshotsServerTransport { - return &ManagedClusterSnapshotsServerTransport{srv: srv} -} - -// ManagedClusterSnapshotsServerTransport connects instances of armcontainerservice.ManagedClusterSnapshotsClient to instances of ManagedClusterSnapshotsServer. -// Don't use this type directly, use NewManagedClusterSnapshotsServerTransport instead. -type ManagedClusterSnapshotsServerTransport struct { - srv *ManagedClusterSnapshotsServer - newListPager *azfake.PagerResponder[armcontainerservice.ManagedClusterSnapshotsClientListResponse] - newListByResourceGroupPager *azfake.PagerResponder[armcontainerservice.ManagedClusterSnapshotsClientListByResourceGroupResponse] -} - -// Do implements the policy.Transporter interface for ManagedClusterSnapshotsServerTransport. -func (m *ManagedClusterSnapshotsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "ManagedClusterSnapshotsClient.CreateOrUpdate": - resp, err = m.dispatchCreateOrUpdate(req) - case "ManagedClusterSnapshotsClient.Delete": - resp, err = m.dispatchDelete(req) - case "ManagedClusterSnapshotsClient.Get": - resp, err = m.dispatchGet(req) - case "ManagedClusterSnapshotsClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - case "ManagedClusterSnapshotsClient.NewListByResourceGroupPager": - resp, err = m.dispatchNewListByResourceGroupPager(req) - case "ManagedClusterSnapshotsClient.UpdateTags": - resp, err = m.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (m *ManagedClusterSnapshotsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { - if m.srv.CreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedclustersnapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.ManagedClusterSnapshot](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.CreateOrUpdate(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagedClusterSnapshot, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *ManagedClusterSnapshotsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if m.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedclustersnapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.Delete(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *ManagedClusterSnapshotsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if m.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedclustersnapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagedClusterSnapshot, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *ManagedClusterSnapshotsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if m.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - if m.newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedclustersnapshots` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resp := m.srv.NewListPager(nil) - m.newListPager = &resp - server.PagerResponderInjectNextLinks(m.newListPager, req, func(page *armcontainerservice.ManagedClusterSnapshotsClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(m.newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(m.newListPager) { - m.newListPager = nil - } - return resp, nil -} - -func (m *ManagedClusterSnapshotsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { - if m.srv.NewListByResourceGroupPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} - } - if m.newListByResourceGroupPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedclustersnapshots` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resp := m.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - m.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(m.newListByResourceGroupPager, req, func(page *armcontainerservice.ManagedClusterSnapshotsClientListByResourceGroupResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(m.newListByResourceGroupPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(m.newListByResourceGroupPager) { - m.newListByResourceGroupPager = nil - } - return resp, nil -} - -func (m *ManagedClusterSnapshotsServerTransport) dispatchUpdateTags(req *http.Request) (*http.Response, error) { - if m.srv.UpdateTags == nil { - return nil, &nonRetriableError{errors.New("fake for method UpdateTags not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedclustersnapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.TagsObject](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.UpdateTags(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagedClusterSnapshot, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/operations_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/operations_server.go deleted file mode 100644 index e10a64a1f6df..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/operations_server.go +++ /dev/null @@ -1,86 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "net/http" -) - -// OperationsServer is a fake server for instances of the armcontainerservice.OperationsClient type. -type OperationsServer struct { - // NewListPager is the fake for method OperationsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(options *armcontainerservice.OperationsClientListOptions) (resp azfake.PagerResponder[armcontainerservice.OperationsClientListResponse]) -} - -// NewOperationsServerTransport creates a new instance of OperationsServerTransport with the provided implementation. -// The returned OperationsServerTransport instance is connected to an instance of armcontainerservice.OperationsClient by way of the -// undefined.Transporter field. -func NewOperationsServerTransport(srv *OperationsServer) *OperationsServerTransport { - return &OperationsServerTransport{srv: srv} -} - -// OperationsServerTransport connects instances of armcontainerservice.OperationsClient to instances of OperationsServer. -// Don't use this type directly, use NewOperationsServerTransport instead. -type OperationsServerTransport struct { - srv *OperationsServer - newListPager *azfake.PagerResponder[armcontainerservice.OperationsClientListResponse] -} - -// Do implements the policy.Transporter interface for OperationsServerTransport. -func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if o.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - if o.newListPager == nil { - resp := o.srv.NewListPager(nil) - o.newListPager = &resp - } - resp, err := server.PagerResponderNext(o.newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(o.newListPager) { - o.newListPager = nil - } - return resp, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/privateendpointconnections_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/privateendpointconnections_server.go deleted file mode 100644 index 44ad41e5d958..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/privateendpointconnections_server.go +++ /dev/null @@ -1,242 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "net/http" - "net/url" - "regexp" -) - -// PrivateEndpointConnectionsServer is a fake server for instances of the armcontainerservice.PrivateEndpointConnectionsClient type. -type PrivateEndpointConnectionsServer struct { - // BeginDelete is the fake for method PrivateEndpointConnectionsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *armcontainerservice.PrivateEndpointConnectionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerservice.PrivateEndpointConnectionsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method PrivateEndpointConnectionsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *armcontainerservice.PrivateEndpointConnectionsClientGetOptions) (resp azfake.Responder[armcontainerservice.PrivateEndpointConnectionsClientGetResponse], errResp azfake.ErrorResponder) - - // List is the fake for method PrivateEndpointConnectionsClient.List - // HTTP status codes to indicate success: http.StatusOK - List func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.PrivateEndpointConnectionsClientListOptions) (resp azfake.Responder[armcontainerservice.PrivateEndpointConnectionsClientListResponse], errResp azfake.ErrorResponder) - - // Update is the fake for method PrivateEndpointConnectionsClient.Update - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - Update func(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, parameters armcontainerservice.PrivateEndpointConnection, options *armcontainerservice.PrivateEndpointConnectionsClientUpdateOptions) (resp azfake.Responder[armcontainerservice.PrivateEndpointConnectionsClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewPrivateEndpointConnectionsServerTransport creates a new instance of PrivateEndpointConnectionsServerTransport with the provided implementation. -// The returned PrivateEndpointConnectionsServerTransport instance is connected to an instance of armcontainerservice.PrivateEndpointConnectionsClient by way of the -// undefined.Transporter field. -func NewPrivateEndpointConnectionsServerTransport(srv *PrivateEndpointConnectionsServer) *PrivateEndpointConnectionsServerTransport { - return &PrivateEndpointConnectionsServerTransport{srv: srv} -} - -// PrivateEndpointConnectionsServerTransport connects instances of armcontainerservice.PrivateEndpointConnectionsClient to instances of PrivateEndpointConnectionsServer. -// Don't use this type directly, use NewPrivateEndpointConnectionsServerTransport instead. -type PrivateEndpointConnectionsServerTransport struct { - srv *PrivateEndpointConnectionsServer - beginDelete *azfake.PollerResponder[armcontainerservice.PrivateEndpointConnectionsClientDeleteResponse] -} - -// Do implements the policy.Transporter interface for PrivateEndpointConnectionsServerTransport. -func (p *PrivateEndpointConnectionsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "PrivateEndpointConnectionsClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "PrivateEndpointConnectionsClient.Get": - resp, err = p.dispatchGet(req) - case "PrivateEndpointConnectionsClient.List": - resp, err = p.dispatchList(req) - case "PrivateEndpointConnectionsClient.Update": - resp, err = p.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if p.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - if p.beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - privateEndpointConnectionNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) - if err != nil { - return nil, err - } - respr, errRespr := p.srv.BeginDelete(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, privateEndpointConnectionNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - p.beginDelete = &respr - } - - resp, err := server.PollerResponderNext(p.beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusNoContent}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(p.beginDelete) { - p.beginDelete = nil - } - - return resp, nil -} - -func (p *PrivateEndpointConnectionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if p.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - privateEndpointConnectionNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) - if err != nil { - return nil, err - } - respr, errRespr := p.srv.Get(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, privateEndpointConnectionNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnection, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (p *PrivateEndpointConnectionsServerTransport) dispatchList(req *http.Request) (*http.Response, error) { - if p.srv.List == nil { - return nil, &nonRetriableError{errors.New("fake for method List not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := p.srv.List(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnectionListResult, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (p *PrivateEndpointConnectionsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { - if p.srv.Update == nil { - return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.PrivateEndpointConnection](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - privateEndpointConnectionNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) - if err != nil { - return nil, err - } - respr, errRespr := p.srv.Update(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, privateEndpointConnectionNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnection, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/privatelinkresources_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/privatelinkresources_server.go deleted file mode 100644 index 90c9710af4af..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/privatelinkresources_server.go +++ /dev/null @@ -1,100 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "net/http" - "net/url" - "regexp" -) - -// PrivateLinkResourcesServer is a fake server for instances of the armcontainerservice.PrivateLinkResourcesClient type. -type PrivateLinkResourcesServer struct { - // List is the fake for method PrivateLinkResourcesClient.List - // HTTP status codes to indicate success: http.StatusOK - List func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.PrivateLinkResourcesClientListOptions) (resp azfake.Responder[armcontainerservice.PrivateLinkResourcesClientListResponse], errResp azfake.ErrorResponder) -} - -// NewPrivateLinkResourcesServerTransport creates a new instance of PrivateLinkResourcesServerTransport with the provided implementation. -// The returned PrivateLinkResourcesServerTransport instance is connected to an instance of armcontainerservice.PrivateLinkResourcesClient by way of the -// undefined.Transporter field. -func NewPrivateLinkResourcesServerTransport(srv *PrivateLinkResourcesServer) *PrivateLinkResourcesServerTransport { - return &PrivateLinkResourcesServerTransport{srv: srv} -} - -// PrivateLinkResourcesServerTransport connects instances of armcontainerservice.PrivateLinkResourcesClient to instances of PrivateLinkResourcesServer. -// Don't use this type directly, use NewPrivateLinkResourcesServerTransport instead. -type PrivateLinkResourcesServerTransport struct { - srv *PrivateLinkResourcesServer -} - -// Do implements the policy.Transporter interface for PrivateLinkResourcesServerTransport. -func (p *PrivateLinkResourcesServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "PrivateLinkResourcesClient.List": - resp, err = p.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (p *PrivateLinkResourcesServerTransport) dispatchList(req *http.Request) (*http.Response, error) { - if p.srv.List == nil { - return nil, &nonRetriableError{errors.New("fake for method List not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := p.srv.List(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateLinkResourcesListResult, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/resolveprivatelinkserviceid_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/resolveprivatelinkserviceid_server.go deleted file mode 100644 index 62d03655a286..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/resolveprivatelinkserviceid_server.go +++ /dev/null @@ -1,104 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "net/http" - "net/url" - "regexp" -) - -// ResolvePrivateLinkServiceIDServer is a fake server for instances of the armcontainerservice.ResolvePrivateLinkServiceIDClient type. -type ResolvePrivateLinkServiceIDServer struct { - // POST is the fake for method ResolvePrivateLinkServiceIDClient.POST - // HTTP status codes to indicate success: http.StatusOK - POST func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.PrivateLinkResource, options *armcontainerservice.ResolvePrivateLinkServiceIDClientPOSTOptions) (resp azfake.Responder[armcontainerservice.ResolvePrivateLinkServiceIDClientPOSTResponse], errResp azfake.ErrorResponder) -} - -// NewResolvePrivateLinkServiceIDServerTransport creates a new instance of ResolvePrivateLinkServiceIDServerTransport with the provided implementation. -// The returned ResolvePrivateLinkServiceIDServerTransport instance is connected to an instance of armcontainerservice.ResolvePrivateLinkServiceIDClient by way of the -// undefined.Transporter field. -func NewResolvePrivateLinkServiceIDServerTransport(srv *ResolvePrivateLinkServiceIDServer) *ResolvePrivateLinkServiceIDServerTransport { - return &ResolvePrivateLinkServiceIDServerTransport{srv: srv} -} - -// ResolvePrivateLinkServiceIDServerTransport connects instances of armcontainerservice.ResolvePrivateLinkServiceIDClient to instances of ResolvePrivateLinkServiceIDServer. -// Don't use this type directly, use NewResolvePrivateLinkServiceIDServerTransport instead. -type ResolvePrivateLinkServiceIDServerTransport struct { - srv *ResolvePrivateLinkServiceIDServer -} - -// Do implements the policy.Transporter interface for ResolvePrivateLinkServiceIDServerTransport. -func (r *ResolvePrivateLinkServiceIDServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "ResolvePrivateLinkServiceIDClient.POST": - resp, err = r.dispatchPOST(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (r *ResolvePrivateLinkServiceIDServerTransport) dispatchPOST(req *http.Request) (*http.Response, error) { - if r.srv.POST == nil { - return nil, &nonRetriableError{errors.New("fake for method POST not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resolvePrivateLinkServiceId` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.PrivateLinkResource](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := r.srv.POST(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateLinkResource, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/snapshots_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/snapshots_server.go deleted file mode 100644 index 90ef02f34ffc..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/snapshots_server.go +++ /dev/null @@ -1,304 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "net/http" - "net/url" - "regexp" -) - -// SnapshotsServer is a fake server for instances of the armcontainerservice.SnapshotsClient type. -type SnapshotsServer struct { - // CreateOrUpdate is the fake for method SnapshotsClient.CreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - CreateOrUpdate func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.Snapshot, options *armcontainerservice.SnapshotsClientCreateOrUpdateOptions) (resp azfake.Responder[armcontainerservice.SnapshotsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // Delete is the fake for method SnapshotsClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.SnapshotsClientDeleteOptions) (resp azfake.Responder[armcontainerservice.SnapshotsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method SnapshotsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.SnapshotsClientGetOptions) (resp azfake.Responder[armcontainerservice.SnapshotsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method SnapshotsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(options *armcontainerservice.SnapshotsClientListOptions) (resp azfake.PagerResponder[armcontainerservice.SnapshotsClientListResponse]) - - // NewListByResourceGroupPager is the fake for method SnapshotsClient.NewListByResourceGroupPager - // HTTP status codes to indicate success: http.StatusOK - NewListByResourceGroupPager func(resourceGroupName string, options *armcontainerservice.SnapshotsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armcontainerservice.SnapshotsClientListByResourceGroupResponse]) - - // UpdateTags is the fake for method SnapshotsClient.UpdateTags - // HTTP status codes to indicate success: http.StatusOK - UpdateTags func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.TagsObject, options *armcontainerservice.SnapshotsClientUpdateTagsOptions) (resp azfake.Responder[armcontainerservice.SnapshotsClientUpdateTagsResponse], errResp azfake.ErrorResponder) -} - -// NewSnapshotsServerTransport creates a new instance of SnapshotsServerTransport with the provided implementation. -// The returned SnapshotsServerTransport instance is connected to an instance of armcontainerservice.SnapshotsClient by way of the -// undefined.Transporter field. -func NewSnapshotsServerTransport(srv *SnapshotsServer) *SnapshotsServerTransport { - return &SnapshotsServerTransport{srv: srv} -} - -// SnapshotsServerTransport connects instances of armcontainerservice.SnapshotsClient to instances of SnapshotsServer. -// Don't use this type directly, use NewSnapshotsServerTransport instead. -type SnapshotsServerTransport struct { - srv *SnapshotsServer - newListPager *azfake.PagerResponder[armcontainerservice.SnapshotsClientListResponse] - newListByResourceGroupPager *azfake.PagerResponder[armcontainerservice.SnapshotsClientListByResourceGroupResponse] -} - -// Do implements the policy.Transporter interface for SnapshotsServerTransport. -func (s *SnapshotsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "SnapshotsClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "SnapshotsClient.Delete": - resp, err = s.dispatchDelete(req) - case "SnapshotsClient.Get": - resp, err = s.dispatchGet(req) - case "SnapshotsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "SnapshotsClient.NewListByResourceGroupPager": - resp, err = s.dispatchNewListByResourceGroupPager(req) - case "SnapshotsClient.UpdateTags": - resp, err = s.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (s *SnapshotsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { - if s.srv.CreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/snapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.Snapshot](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.CreateOrUpdate(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Snapshot, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (s *SnapshotsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if s.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/snapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Delete(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (s *SnapshotsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if s.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/snapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Snapshot, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (s *SnapshotsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if s.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - if s.newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/snapshots` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resp := s.srv.NewListPager(nil) - s.newListPager = &resp - server.PagerResponderInjectNextLinks(s.newListPager, req, func(page *armcontainerservice.SnapshotsClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(s.newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(s.newListPager) { - s.newListPager = nil - } - return resp, nil -} - -func (s *SnapshotsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { - if s.srv.NewListByResourceGroupPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} - } - if s.newListByResourceGroupPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/snapshots` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resp := s.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - s.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(s.newListByResourceGroupPager, req, func(page *armcontainerservice.SnapshotsClientListByResourceGroupResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(s.newListByResourceGroupPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(s.newListByResourceGroupPager) { - s.newListByResourceGroupPager = nil - } - return resp, nil -} - -func (s *SnapshotsServerTransport) dispatchUpdateTags(req *http.Request) (*http.Response, error) { - if s.srv.UpdateTags == nil { - return nil, &nonRetriableError{errors.New("fake for method UpdateTags not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/snapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.TagsObject](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := s.srv.UpdateTags(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Snapshot, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/time_rfc3339.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/time_rfc3339.go deleted file mode 100644 index 45fe10cbc6df..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/time_rfc3339.go +++ /dev/null @@ -1,86 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -const ( - utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` - utcLayout = "2006-01-02T15:04:05.999999999" - rfc3339JSON = `"` + time.RFC3339Nano + `"` -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) - -type timeRFC3339 time.Time - -func (t timeRFC3339) MarshalJSON() (json []byte, err error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t timeRFC3339) MarshalText() (text []byte, err error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *timeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcLayoutJSON - if tzOffsetRegex.Match(data) { - layout = rfc3339JSON - } - return t.Parse(layout, string(data)) -} - -func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { - layout := utcLayout - if tzOffsetRegex.Match(data) { - layout = time.RFC3339Nano - } - return t.Parse(layout, string(data)) -} - -func (t *timeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = timeRFC3339(p) - return err -} - -func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*timeRFC3339)(t) -} - -func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { - return nil - } - var aux timeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/trustedaccessrolebindings_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/trustedaccessrolebindings_server.go deleted file mode 100644 index 8d5534dd5348..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/trustedaccessrolebindings_server.go +++ /dev/null @@ -1,240 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "net/http" - "net/url" - "regexp" -) - -// TrustedAccessRoleBindingsServer is a fake server for instances of the armcontainerservice.TrustedAccessRoleBindingsClient type. -type TrustedAccessRoleBindingsServer struct { - // CreateOrUpdate is the fake for method TrustedAccessRoleBindingsClient.CreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - CreateOrUpdate func(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, trustedAccessRoleBinding armcontainerservice.TrustedAccessRoleBinding, options *armcontainerservice.TrustedAccessRoleBindingsClientCreateOrUpdateOptions) (resp azfake.Responder[armcontainerservice.TrustedAccessRoleBindingsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // Delete is the fake for method TrustedAccessRoleBindingsClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *armcontainerservice.TrustedAccessRoleBindingsClientDeleteOptions) (resp azfake.Responder[armcontainerservice.TrustedAccessRoleBindingsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method TrustedAccessRoleBindingsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *armcontainerservice.TrustedAccessRoleBindingsClientGetOptions) (resp azfake.Responder[armcontainerservice.TrustedAccessRoleBindingsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method TrustedAccessRoleBindingsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, resourceName string, options *armcontainerservice.TrustedAccessRoleBindingsClientListOptions) (resp azfake.PagerResponder[armcontainerservice.TrustedAccessRoleBindingsClientListResponse]) -} - -// NewTrustedAccessRoleBindingsServerTransport creates a new instance of TrustedAccessRoleBindingsServerTransport with the provided implementation. -// The returned TrustedAccessRoleBindingsServerTransport instance is connected to an instance of armcontainerservice.TrustedAccessRoleBindingsClient by way of the -// undefined.Transporter field. -func NewTrustedAccessRoleBindingsServerTransport(srv *TrustedAccessRoleBindingsServer) *TrustedAccessRoleBindingsServerTransport { - return &TrustedAccessRoleBindingsServerTransport{srv: srv} -} - -// TrustedAccessRoleBindingsServerTransport connects instances of armcontainerservice.TrustedAccessRoleBindingsClient to instances of TrustedAccessRoleBindingsServer. -// Don't use this type directly, use NewTrustedAccessRoleBindingsServerTransport instead. -type TrustedAccessRoleBindingsServerTransport struct { - srv *TrustedAccessRoleBindingsServer - newListPager *azfake.PagerResponder[armcontainerservice.TrustedAccessRoleBindingsClientListResponse] -} - -// Do implements the policy.Transporter interface for TrustedAccessRoleBindingsServerTransport. -func (t *TrustedAccessRoleBindingsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "TrustedAccessRoleBindingsClient.CreateOrUpdate": - resp, err = t.dispatchCreateOrUpdate(req) - case "TrustedAccessRoleBindingsClient.Delete": - resp, err = t.dispatchDelete(req) - case "TrustedAccessRoleBindingsClient.Get": - resp, err = t.dispatchGet(req) - case "TrustedAccessRoleBindingsClient.NewListPager": - resp, err = t.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (t *TrustedAccessRoleBindingsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { - if t.srv.CreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/trustedAccessRoleBindings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerservice.TrustedAccessRoleBinding](req) - if err != nil { - return nil, err - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - trustedAccessRoleBindingNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("trustedAccessRoleBindingName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.CreateOrUpdate(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, trustedAccessRoleBindingNameUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).TrustedAccessRoleBinding, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (t *TrustedAccessRoleBindingsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if t.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/trustedAccessRoleBindings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - trustedAccessRoleBindingNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("trustedAccessRoleBindingName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.Delete(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, trustedAccessRoleBindingNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (t *TrustedAccessRoleBindingsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if t.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/trustedAccessRoleBindings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - trustedAccessRoleBindingNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("trustedAccessRoleBindingName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.Get(req.Context(), resourceGroupNameUnescaped, resourceNameUnescaped, trustedAccessRoleBindingNameUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).TrustedAccessRoleBinding, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (t *TrustedAccessRoleBindingsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if t.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - if t.newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/trustedAccessRoleBindings` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNameUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - resp := t.srv.NewListPager(resourceGroupNameUnescaped, resourceNameUnescaped, nil) - t.newListPager = &resp - server.PagerResponderInjectNextLinks(t.newListPager, req, func(page *armcontainerservice.TrustedAccessRoleBindingsClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(t.newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(t.newListPager) { - t.newListPager = nil - } - return resp, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/trustedaccessroles_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/trustedaccessroles_server.go deleted file mode 100644 index 0e4419ff31b5..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/trustedaccessroles_server.go +++ /dev/null @@ -1,102 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "net/http" - "net/url" - "regexp" -) - -// TrustedAccessRolesServer is a fake server for instances of the armcontainerservice.TrustedAccessRolesClient type. -type TrustedAccessRolesServer struct { - // NewListPager is the fake for method TrustedAccessRolesClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(location string, options *armcontainerservice.TrustedAccessRolesClientListOptions) (resp azfake.PagerResponder[armcontainerservice.TrustedAccessRolesClientListResponse]) -} - -// NewTrustedAccessRolesServerTransport creates a new instance of TrustedAccessRolesServerTransport with the provided implementation. -// The returned TrustedAccessRolesServerTransport instance is connected to an instance of armcontainerservice.TrustedAccessRolesClient by way of the -// undefined.Transporter field. -func NewTrustedAccessRolesServerTransport(srv *TrustedAccessRolesServer) *TrustedAccessRolesServerTransport { - return &TrustedAccessRolesServerTransport{srv: srv} -} - -// TrustedAccessRolesServerTransport connects instances of armcontainerservice.TrustedAccessRolesClient to instances of TrustedAccessRolesServer. -// Don't use this type directly, use NewTrustedAccessRolesServerTransport instead. -type TrustedAccessRolesServerTransport struct { - srv *TrustedAccessRolesServer - newListPager *azfake.PagerResponder[armcontainerservice.TrustedAccessRolesClientListResponse] -} - -// Do implements the policy.Transporter interface for TrustedAccessRolesServerTransport. -func (t *TrustedAccessRolesServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "TrustedAccessRolesClient.NewListPager": - resp, err = t.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (t *TrustedAccessRolesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if t.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - if t.newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.ContainerService/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/trustedAccessRoles` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - locationUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - resp := t.srv.NewListPager(locationUnescaped, nil) - t.newListPager = &resp - server.PagerResponderInjectNextLinks(t.newListPager, req, func(page *armcontainerservice.TrustedAccessRolesClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(t.newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(t.newListPager) { - t.newListPager = nil - } - return resp, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake_example_test.go deleted file mode 100644 index 900eedd867b6..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake_example_test.go +++ /dev/null @@ -1,78 +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. - -package armcontainerservice_test - -import ( - "context" - "fmt" - "log" - "net/http" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4/fake" -) - -func ExampleManagedClustersServer() { - // first, create an instance of the fake server for the client you wish to test. - // the type name of the server will be similar to the corresponding client, with - // the suffix "Server" instead of "Client". - fakeManagedClustersServer := fake.ManagedClustersServer{ - - // next, provide implementations for the APIs you wish to fake. - // this fake corresponds to the VirtualMachinesClient.Get() API. - Get: func(ctx context.Context, resourceGroupName, resourceName string, options *armcontainerservice.ManagedClustersClientGetOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetResponse], errResp azfake.ErrorResponder) { - // the values of ctx, resourceGroupName, resourceName, and options come from the API call. - - // the named return values resp and errResp are used to construct the response - // and are meant to be mutually exclusive. if both responses have been constructed, - // the error response is selected. - - // construct the response type, populating fields as required - clusterResp := armcontainerservice.ManagedClustersClientGetResponse{} - clusterResp.ID = to.Ptr("/fake/resource/id") - - // use resp to set the desired response - resp.SetResponse(http.StatusOK, clusterResp, nil) - - // to simulate the failure case, use errResp - //errResp.SetResponseError(http.StatusBadRequest, "ThisIsASimulatedError") - - return - }, - } - - client, err := armcontainerservice.NewManagedClustersClient("subscriptionID", azfake.NewTokenCredential(), &arm.ClientOptions{ - ClientOptions: azcore.ClientOptions{ - Transport: fake.NewManagedClustersServerTransport(&fakeManagedClustersServer), - }, - }) - if err != nil { - log.Fatal(err) - } - - // call the API. the provided values will be passed to the fake's implementation. - // the response or error values returned by the API call are from the fake. - resp, err := client.Get(context.TODO(), "fakeResourceGroup", "fakeResource", nil) - if err != nil { - log.Fatal(err) - } - - fmt.Println(*resp.ID) - - // APIs that haven't been faked will return an error - _, err = client.GetAccessProfile(context.TODO(), "fakeResourceGroup", "fakeResource", "fakeRole", nil) - - fmt.Println(err.Error()) - - // Output: - // /fake/resource/id - // fake for method GetAccessProfile not implemented -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go index 133886a10b94..07102e52da5e 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go @@ -46,7 +46,7 @@ func NewMaintenanceConfigurationsClient(subscriptionID string, credential azcore // CreateOrUpdate - Creates or updates a maintenance configuration in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - configName - The name of the maintenance configuration. @@ -55,10 +55,6 @@ func NewMaintenanceConfigurationsClient(subscriptionID string, credential azcore // method. func (client *MaintenanceConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, configName string, parameters MaintenanceConfiguration, options *MaintenanceConfigurationsClientCreateOrUpdateOptions) (MaintenanceConfigurationsClientCreateOrUpdateResponse, error) { var err error - const operationName = "MaintenanceConfigurationsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, configName, parameters, options) if err != nil { return MaintenanceConfigurationsClientCreateOrUpdateResponse{}, err @@ -99,7 +95,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +116,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateHandleResponse(resp // Delete - Deletes a maintenance configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - configName - The name of the maintenance configuration. @@ -128,10 +124,6 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateHandleResponse(resp // method. func (client *MaintenanceConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, configName string, options *MaintenanceConfigurationsClientDeleteOptions) (MaintenanceConfigurationsClientDeleteResponse, error) { var err error - const operationName = "MaintenanceConfigurationsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, configName, options) if err != nil { return MaintenanceConfigurationsClientDeleteResponse{}, err @@ -171,7 +163,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +172,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C // Get - Gets the specified maintenance configuration of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - configName - The name of the maintenance configuration. @@ -188,10 +180,6 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C // method. func (client *MaintenanceConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, configName string, options *MaintenanceConfigurationsClientGetOptions) (MaintenanceConfigurationsClientGetResponse, error) { var err error - const operationName = "MaintenanceConfigurationsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, configName, options) if err != nil { return MaintenanceConfigurationsClientGetResponse{}, err @@ -232,7 +220,7 @@ func (client *MaintenanceConfigurationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +237,7 @@ func (client *MaintenanceConfigurationsClient) getHandleResponse(resp *http.Resp // NewListByManagedClusterPager - Gets a list of maintenance configurations in the specified managed cluster. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - MaintenanceConfigurationsClientListByManagedClusterOptions contains the optional parameters for the MaintenanceConfigurationsClient.NewListByManagedClusterPager @@ -260,7 +248,6 @@ func (client *MaintenanceConfigurationsClient) NewListByManagedClusterPager(reso return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *MaintenanceConfigurationsClientListByManagedClusterResponse) (MaintenanceConfigurationsClientListByManagedClusterResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MaintenanceConfigurationsClient.NewListByManagedClusterPager") var req *policy.Request var err error if page == nil { @@ -280,7 +267,6 @@ func (client *MaintenanceConfigurationsClient) NewListByManagedClusterPager(reso } return client.listByManagedClusterHandleResponse(resp) }, - Tracer: client.internal.Tracer(), }) } @@ -304,7 +290,7 @@ func (client *MaintenanceConfigurationsClient) listByManagedClusterCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go index 9803b68b8fcc..9f7f81612ce8 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go @@ -20,7 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/MaintenanceConfigurationsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/MaintenanceConfigurationsList.json func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMaintenanceConfigurationsByManagedCluster() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMai } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/MaintenanceConfigurationsList_MaintenanceWindow.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/MaintenanceConfigurationsList_MaintenanceWindow.json func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMaintenanceConfigurationsConfiguredWithMaintenanceWindowByManagedCluster() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -92,7 +92,7 @@ func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMai // Value: []*armcontainerservice.MaintenanceConfiguration{ // { // Name: to.Ptr("aksManagedNodeOSUpgradeSchedule"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/aksManagedNodeOSUpgradeSchedule"), // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ // MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ // DurationHours: to.Ptr[int32](10), @@ -109,7 +109,7 @@ func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMai // }, // { // Name: to.Ptr("aksManagedAutoUpgradeSchedule"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/aksManagedAutoUpgradeSchedule"), // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ // MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ // DurationHours: to.Ptr[int32](5), @@ -138,7 +138,7 @@ func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMai } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/MaintenanceConfigurationsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/MaintenanceConfigurationsGet.json func ExampleMaintenanceConfigurationsClient_Get_getMaintenanceConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -184,7 +184,7 @@ func ExampleMaintenanceConfigurationsClient_Get_getMaintenanceConfiguration() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json func ExampleMaintenanceConfigurationsClient_Get_getMaintenanceConfigurationConfiguredWithMaintenanceWindow() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -204,7 +204,7 @@ func ExampleMaintenanceConfigurationsClient_Get_getMaintenanceConfigurationConfi // 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.MaintenanceConfiguration = armcontainerservice.MaintenanceConfiguration{ // Name: to.Ptr("aksManagedNodeOSUpgradeSchedule"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/aksManagedNodeOSUpgradeSchedule"), // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ // MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ // DurationHours: to.Ptr[int32](4), @@ -227,18 +227,10 @@ func ExampleMaintenanceConfigurationsClient_Get_getMaintenanceConfigurationConfi // UTCOffset: to.Ptr("-07:00"), // }, // }, - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/MaintenanceConfigurationsCreate_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/MaintenanceConfigurationsCreate_Update.json func ExampleMaintenanceConfigurationsClient_CreateOrUpdate_createUpdateMaintenanceConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -300,7 +292,7 @@ func ExampleMaintenanceConfigurationsClient_CreateOrUpdate_createUpdateMaintenan // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json func ExampleMaintenanceConfigurationsClient_CreateOrUpdate_createUpdateMaintenanceConfigurationWithMaintenanceWindow() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -345,8 +337,7 @@ func ExampleMaintenanceConfigurationsClient_CreateOrUpdate_createUpdateMaintenan // 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.MaintenanceConfiguration = armcontainerservice.MaintenanceConfiguration{ // Name: to.Ptr("aksManagedAutoUpgradeSchedule"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/maintenanceConfigurations"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), + // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/aksManagedAutoUpgradeSchedule"), // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ // MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ // DurationHours: to.Ptr[int32](10), @@ -370,18 +361,10 @@ func ExampleMaintenanceConfigurationsClient_CreateOrUpdate_createUpdateMaintenan // UTCOffset: to.Ptr("+05:30"), // }, // }, - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/MaintenanceConfigurationsDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/MaintenanceConfigurationsDelete.json func ExampleMaintenanceConfigurationsClient_Delete_deleteMaintenanceConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -398,7 +381,7 @@ func ExampleMaintenanceConfigurationsClient_Delete_deleteMaintenanceConfiguratio } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json func ExampleMaintenanceConfigurationsClient_Delete_deleteMaintenanceConfigurationForNodeOsUpgrade() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go index 001ba9fc0463..53a7cf4d7108 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go @@ -17,7 +17,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" - "strconv" "strings" ) @@ -46,10 +45,10 @@ func NewManagedClustersClient(subscriptionID string, credential azcore.TokenCred // BeginAbortLatestOperation - Aborts the currently running operation on the managed cluster. The Managed Cluster will be // moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation -// completes before cancellation can take place, an error is returned. +// completes before cancellation can take place, a 409 error code is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginAbortLatestOperationOptions contains the optional parameters for the ManagedClustersClient.BeginAbortLatestOperation @@ -71,16 +70,12 @@ func (client *ManagedClustersClient) BeginAbortLatestOperation(ctx context.Conte // AbortLatestOperation - Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved // to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation -// completes before cancellation can take place, an error is returned. +// completes before cancellation can take place, a 409 error code is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *ManagedClustersClient) abortLatestOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginAbortLatestOperationOptions) (*http.Response, error) { var err error - const operationName = "ManagedClustersClient.BeginAbortLatestOperation" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.abortLatestOperationCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -116,7 +111,7 @@ func (client *ManagedClustersClient) abortLatestOperationCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -125,7 +120,7 @@ func (client *ManagedClustersClient) abortLatestOperationCreateRequest(ctx conte // BeginCreateOrUpdate - Creates or updates a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - The managed cluster to create or update. @@ -147,13 +142,9 @@ func (client *ManagedClustersClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Creates or updates a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *ManagedClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster, options *ManagedClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error - const operationName = "ManagedClustersClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return nil, err @@ -189,7 +180,7 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -201,7 +192,7 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deletes a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete @@ -222,13 +213,9 @@ func (client *ManagedClustersClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *ManagedClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginDeleteOptions) (*http.Response, error) { var err error - const operationName = "ManagedClustersClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -264,10 +251,7 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") - if options != nil && options.IgnorePodDisruptionBudget != nil { - reqQP.Set("ignore-pod-disruption-budget", strconv.FormatBool(*options.IgnorePodDisruptionBudget)) - } + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,16 +260,12 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re // Get - Gets a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientGetOptions contains the optional parameters for the ManagedClustersClient.Get method. func (client *ManagedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientGetOptions) (ManagedClustersClientGetResponse, error) { var err error - const operationName = "ManagedClustersClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ManagedClustersClientGetResponse{}, err @@ -322,7 +302,7 @@ func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +322,7 @@ func (client *ManagedClustersClient) getHandleResponse(resp *http.Response) (Man // [https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials] . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - roleName - The name of the role for managed cluster accessProfile resource. @@ -350,10 +330,6 @@ func (client *ManagedClustersClient) getHandleResponse(resp *http.Response) (Man // method. func (client *ManagedClustersClient) GetAccessProfile(ctx context.Context, resourceGroupName string, resourceName string, roleName string, options *ManagedClustersClientGetAccessProfileOptions) (ManagedClustersClientGetAccessProfileResponse, error) { var err error - const operationName = "ManagedClustersClient.GetAccessProfile" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.getAccessProfileCreateRequest(ctx, resourceGroupName, resourceName, roleName, options) if err != nil { return ManagedClustersClientGetAccessProfileResponse{}, err @@ -394,7 +370,7 @@ func (client *ManagedClustersClient) getAccessProfileCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -412,7 +388,7 @@ func (client *ManagedClustersClient) getAccessProfileHandleResponse(resp *http.R // GetCommandResult - Gets the results of a command which has been run on the Managed Cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - commandID - Id of the command. @@ -420,10 +396,6 @@ func (client *ManagedClustersClient) getAccessProfileHandleResponse(resp *http.R // method. func (client *ManagedClustersClient) GetCommandResult(ctx context.Context, resourceGroupName string, resourceName string, commandID string, options *ManagedClustersClientGetCommandResultOptions) (ManagedClustersClientGetCommandResultResponse, error) { var err error - const operationName = "ManagedClustersClient.GetCommandResult" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.getCommandResultCreateRequest(ctx, resourceGroupName, resourceName, commandID, options) if err != nil { return ManagedClustersClientGetCommandResultResponse{}, err @@ -464,7 +436,7 @@ func (client *ManagedClustersClient) getCommandResultCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -485,16 +457,12 @@ func (client *ManagedClustersClient) getCommandResultHandleResponse(resp *http.R // GetOSOptions - Gets supported OS options in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - location - The name of Azure region. // - options - ManagedClustersClientGetOSOptionsOptions contains the optional parameters for the ManagedClustersClient.GetOSOptions // method. func (client *ManagedClustersClient) GetOSOptions(ctx context.Context, location string, options *ManagedClustersClientGetOSOptionsOptions) (ManagedClustersClientGetOSOptionsResponse, error) { var err error - const operationName = "ManagedClustersClient.GetOSOptions" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.getOSOptionsCreateRequest(ctx, location, options) if err != nil { return ManagedClustersClientGetOSOptionsResponse{}, err @@ -527,7 +495,7 @@ func (client *ManagedClustersClient) getOSOptionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.ResourceType != nil { reqQP.Set("resource-type", *options.ResourceType) } @@ -548,17 +516,13 @@ func (client *ManagedClustersClient) getOSOptionsHandleResponse(resp *http.Respo // GetUpgradeProfile - Gets the upgrade profile of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientGetUpgradeProfileOptions contains the optional parameters for the ManagedClustersClient.GetUpgradeProfile // method. func (client *ManagedClustersClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientGetUpgradeProfileOptions) (ManagedClustersClientGetUpgradeProfileResponse, error) { var err error - const operationName = "ManagedClustersClient.GetUpgradeProfile" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.getUpgradeProfileCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ManagedClustersClientGetUpgradeProfileResponse{}, err @@ -595,7 +559,7 @@ func (client *ManagedClustersClient) getUpgradeProfileCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -612,7 +576,7 @@ func (client *ManagedClustersClient) getUpgradeProfileHandleResponse(resp *http. // NewListPager - Gets a list of managed clusters in the specified subscription. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - options - ManagedClustersClientListOptions contains the optional parameters for the ManagedClustersClient.NewListPager // method. func (client *ManagedClustersClient) NewListPager(options *ManagedClustersClientListOptions) *runtime.Pager[ManagedClustersClientListResponse] { @@ -621,7 +585,6 @@ func (client *ManagedClustersClient) NewListPager(options *ManagedClustersClient return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ManagedClustersClientListResponse) (ManagedClustersClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClustersClient.NewListPager") var req *policy.Request var err error if page == nil { @@ -641,7 +604,6 @@ func (client *ManagedClustersClient) NewListPager(options *ManagedClustersClient } return client.listHandleResponse(resp) }, - Tracer: client.internal.Tracer(), }) } @@ -657,7 +619,7 @@ func (client *ManagedClustersClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -674,7 +636,7 @@ func (client *ManagedClustersClient) listHandleResponse(resp *http.Response) (Ma // NewListByResourceGroupPager - Lists managed clusters in the specified subscription and resource group. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ManagedClustersClientListByResourceGroupOptions contains the optional parameters for the ManagedClustersClient.NewListByResourceGroupPager // method. @@ -684,7 +646,6 @@ func (client *ManagedClustersClient) NewListByResourceGroupPager(resourceGroupNa return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ManagedClustersClientListByResourceGroupResponse) (ManagedClustersClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClustersClient.NewListByResourceGroupPager") var req *policy.Request var err error if page == nil { @@ -704,7 +665,6 @@ func (client *ManagedClustersClient) NewListByResourceGroupPager(resourceGroupNa } return client.listByResourceGroupHandleResponse(resp) }, - Tracer: client.internal.Tracer(), }) } @@ -724,7 +684,7 @@ func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -742,17 +702,13 @@ func (client *ManagedClustersClient) listByResourceGroupHandleResponse(resp *htt // ListClusterAdminCredentials - Lists the admin credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListClusterAdminCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterAdminCredentials // method. func (client *ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientListClusterAdminCredentialsOptions) (ManagedClustersClientListClusterAdminCredentialsResponse, error) { var err error - const operationName = "ManagedClustersClient.ListClusterAdminCredentials" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.listClusterAdminCredentialsCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ManagedClustersClientListClusterAdminCredentialsResponse{}, err @@ -789,7 +745,7 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -810,17 +766,13 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsHandleResponse(r // ListClusterMonitoringUserCredentials - Lists the cluster monitoring user credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListClusterMonitoringUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterMonitoringUserCredentials // method. func (client *ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientListClusterMonitoringUserCredentialsOptions) (ManagedClustersClientListClusterMonitoringUserCredentialsResponse, error) { var err error - const operationName = "ManagedClustersClient.ListClusterMonitoringUserCredentials" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.listClusterMonitoringUserCredentialsCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ManagedClustersClientListClusterMonitoringUserCredentialsResponse{}, err @@ -857,7 +809,7 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -878,17 +830,13 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsHandleR // ListClusterUserCredentials - Lists the user credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListClusterUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterUserCredentials // method. func (client *ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientListClusterUserCredentialsOptions) (ManagedClustersClientListClusterUserCredentialsResponse, error) { var err error - const operationName = "ManagedClustersClient.ListClusterUserCredentials" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.listClusterUserCredentialsCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ManagedClustersClientListClusterUserCredentialsResponse{}, err @@ -925,7 +873,7 @@ func (client *ManagedClustersClient) listClusterUserCredentialsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -950,16 +898,12 @@ func (client *ManagedClustersClient) listClusterUserCredentialsHandleResponse(re // upgrades, and details on preview status of the version // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - location - The name of Azure region. // - options - ManagedClustersClientListKubernetesVersionsOptions contains the optional parameters for the ManagedClustersClient.ListKubernetesVersions // method. func (client *ManagedClustersClient) ListKubernetesVersions(ctx context.Context, location string, options *ManagedClustersClientListKubernetesVersionsOptions) (ManagedClustersClientListKubernetesVersionsResponse, error) { var err error - const operationName = "ManagedClustersClient.ListKubernetesVersions" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.listKubernetesVersionsCreateRequest(ctx, location, options) if err != nil { return ManagedClustersClientListKubernetesVersionsResponse{}, err @@ -992,7 +936,7 @@ func (client *ManagedClustersClient) listKubernetesVersionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1010,7 +954,7 @@ func (client *ManagedClustersClient) listKubernetesVersionsHandleResponse(resp * // NewListOutboundNetworkDependenciesEndpointsPager - Gets a list of egress endpoints (network endpoints of all outbound dependencies) // in the specified managed cluster. The operation returns properties of each egress endpoint. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the @@ -1021,7 +965,6 @@ func (client *ManagedClustersClient) NewListOutboundNetworkDependenciesEndpoints return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse) (ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClustersClient.NewListOutboundNetworkDependenciesEndpointsPager") var req *policy.Request var err error if page == nil { @@ -1041,7 +984,6 @@ func (client *ManagedClustersClient) NewListOutboundNetworkDependenciesEndpoints } return client.listOutboundNetworkDependenciesEndpointsHandleResponse(resp) }, - Tracer: client.internal.Tracer(), }) } @@ -1065,7 +1007,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1084,7 +1026,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsHan // [https://aka.ms/aks-managed-aad] to update your cluster with AKS-managed Azure AD. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - The AAD profile to set on the Managed Cluster @@ -1109,13 +1051,9 @@ func (client *ManagedClustersClient) BeginResetAADProfile(ctx context.Context, r // to update your cluster with AKS-managed Azure AD. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *ManagedClustersClient) resetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile, options *ManagedClustersClientBeginResetAADProfileOptions) (*http.Response, error) { var err error - const operationName = "ManagedClustersClient.BeginResetAADProfile" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.resetAADProfileCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return nil, err @@ -1151,7 +1089,7 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1163,7 +1101,7 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co // BeginResetServicePrincipalProfile - This action cannot be performed on a cluster that is not using a service principal // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - The service principal profile to set on the managed cluster. @@ -1187,13 +1125,9 @@ func (client *ManagedClustersClient) BeginResetServicePrincipalProfile(ctx conte // ResetServicePrincipalProfile - This action cannot be performed on a cluster that is not using a service principal // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *ManagedClustersClient) resetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile, options *ManagedClustersClientBeginResetServicePrincipalProfileOptions) (*http.Response, error) { var err error - const operationName = "ManagedClustersClient.BeginResetServicePrincipalProfile" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.resetServicePrincipalProfileCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return nil, err @@ -1229,7 +1163,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1242,7 +1176,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c // more details about rotating managed cluster certificates. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginRotateClusterCertificatesOptions contains the optional parameters for the ManagedClustersClient.BeginRotateClusterCertificates @@ -1266,13 +1200,9 @@ func (client *ManagedClustersClient) BeginRotateClusterCertificates(ctx context. // details about rotating managed cluster certificates. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *ManagedClustersClient) rotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateClusterCertificatesOptions) (*http.Response, error) { var err error - const operationName = "ManagedClustersClient.BeginRotateClusterCertificates" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.rotateClusterCertificatesCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -1308,7 +1238,7 @@ func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1317,7 +1247,7 @@ func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx // BeginRotateServiceAccountSigningKeys - Rotates the service account signing keys of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions contains the optional parameters for the ManagedClustersClient.BeginRotateServiceAccountSigningKeys @@ -1340,13 +1270,9 @@ func (client *ManagedClustersClient) BeginRotateServiceAccountSigningKeys(ctx co // RotateServiceAccountSigningKeys - Rotates the service account signing keys of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *ManagedClustersClient) rotateServiceAccountSigningKeys(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*http.Response, error) { var err error - const operationName = "ManagedClustersClient.BeginRotateServiceAccountSigningKeys" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.rotateServiceAccountSigningKeysCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -1382,7 +1308,7 @@ func (client *ManagedClustersClient) rotateServiceAccountSigningKeysCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1393,7 +1319,7 @@ func (client *ManagedClustersClient) rotateServiceAccountSigningKeysCreateReques // [https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - requestPayload - The run command request @@ -1419,13 +1345,9 @@ func (client *ManagedClustersClient) BeginRunCommand(ctx context.Context, resour // [https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *ManagedClustersClient) runCommand(ctx context.Context, resourceGroupName string, resourceName string, requestPayload RunCommandRequest, options *ManagedClustersClientBeginRunCommandOptions) (*http.Response, error) { var err error - const operationName = "ManagedClustersClient.BeginRunCommand" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.runCommandCreateRequest(ctx, resourceGroupName, resourceName, requestPayload, options) if err != nil { return nil, err @@ -1461,7 +1383,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestPayload); err != nil { @@ -1474,7 +1396,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context // a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginStartOptions contains the optional parameters for the ManagedClustersClient.BeginStart @@ -1498,13 +1420,9 @@ func (client *ManagedClustersClient) BeginStart(ctx context.Context, resourceGro // a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *ManagedClustersClient) start(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStartOptions) (*http.Response, error) { var err error - const operationName = "ManagedClustersClient.BeginStart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.startCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -1540,7 +1458,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1552,7 +1470,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res // for more details about stopping a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginStopOptions contains the optional parameters for the ManagedClustersClient.BeginStop @@ -1578,13 +1496,9 @@ func (client *ManagedClustersClient) BeginStop(ctx context.Context, resourceGrou // for more details about stopping a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *ManagedClustersClient) stop(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStopOptions) (*http.Response, error) { var err error - const operationName = "ManagedClustersClient.BeginStop" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.stopCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return nil, err @@ -1620,7 +1534,7 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1629,7 +1543,7 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso // BeginUpdateTags - Updates tags on a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - Parameters supplied to the Update Managed Cluster Tags operation. @@ -1651,13 +1565,9 @@ func (client *ManagedClustersClient) BeginUpdateTags(ctx context.Context, resour // UpdateTags - Updates tags on a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 func (client *ManagedClustersClient) updateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClustersClientBeginUpdateTagsOptions) (*http.Response, error) { var err error - const operationName = "ManagedClustersClient.BeginUpdateTags" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return nil, err @@ -1693,7 +1603,7 @@ func (client *ManagedClustersClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go index 9a3dcdef8140..19a31df15cea 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go @@ -13,14 +13,12 @@ import ( "context" "log" - "time" - "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/containerservice/armcontainerservice/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ContainerServiceGetOSOptions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ContainerServiceGetOSOptions.json func ExampleManagedClustersClient_GetOSOptions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,7 +54,7 @@ func ExampleManagedClustersClient_GetOSOptions() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/KubernetesVersions_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/KubernetesVersions_List.json func ExampleManagedClustersClient_ListKubernetesVersions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -150,7 +148,7 @@ func ExampleManagedClustersClient_ListKubernetesVersions() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersList.json func ExampleManagedClustersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -195,6 +193,7 @@ func ExampleManagedClustersClient_NewListPager() { // VMSize: to.Ptr("Standard_DS1_v2"), // Name: to.Ptr("nodepool1"), // }}, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnableRBAC: to.Ptr(false), @@ -227,7 +226,7 @@ func ExampleManagedClustersClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersListByResourceGroup.json func ExampleManagedClustersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -272,6 +271,7 @@ func ExampleManagedClustersClient_NewListByResourceGroupPager() { // VMSize: to.Ptr("Standard_DS1_v2"), // Name: to.Ptr("nodepool1"), // }}, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnableRBAC: to.Ptr(false), @@ -304,7 +304,7 @@ func ExampleManagedClustersClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersGetUpgradeProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersGetUpgradeProfile.json func ExampleManagedClustersClient_GetUpgradeProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -358,7 +358,7 @@ func ExampleManagedClustersClient_GetUpgradeProfile() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersGetAccessProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersGetAccessProfile.json func ExampleManagedClustersClient_GetAccessProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -387,7 +387,7 @@ func ExampleManagedClustersClient_GetAccessProfile() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersListClusterCredentialResult.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersListClusterAdminCredentials.json func ExampleManagedClustersClient_ListClusterAdminCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -414,7 +414,63 @@ func ExampleManagedClustersClient_ListClusterAdminCredentials() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersListClusterUserCredentials.json +func ExampleManagedClustersClient_ListClusterUserCredentials() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedClustersClient().ListClusterUserCredentials(ctx, "rg1", "clustername1", &armcontainerservice.ManagedClustersClientListClusterUserCredentialsOptions{ServerFqdn: nil, + Format: 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.CredentialResults = armcontainerservice.CredentialResults{ + // Kubeconfigs: []*armcontainerservice.CredentialResult{ + // { + // Name: to.Ptr("credentialName1"), + // Value: []byte("Y3JlZGVudGlhbFZhbHVlMQ=="), + // }}, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersListClusterMonitoringUserCredentials.json +func ExampleManagedClustersClient_ListClusterMonitoringUserCredentials() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedClustersClient().ListClusterMonitoringUserCredentials(ctx, "rg1", "clustername1", &armcontainerservice.ManagedClustersClientListClusterMonitoringUserCredentialsOptions{ServerFqdn: 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.CredentialResults = armcontainerservice.CredentialResults{ + // Kubeconfigs: []*armcontainerservice.CredentialResult{ + // { + // Name: to.Ptr("credentialName1"), + // Value: []byte("Y3JlZGVudGlhbFZhbHVlMQ=="), + // }}, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersGet.json func ExampleManagedClustersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -462,6 +518,7 @@ func ExampleManagedClustersClient_Get() { // Name: to.Ptr("nodepool1"), // }}, // AzurePortalFQDN: to.Ptr("dnsprefix1-abcd1234.portal.hcp.eastus.azmk8s.io"), + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnableRBAC: to.Ptr(false), @@ -516,327 +573,11 @@ func ExampleManagedClustersClient_Get() { // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ // ClientID: to.Ptr("clientid"), // }, - // UpgradeSettings: &armcontainerservice.ClusterUpgradeSettings{ - // OverrideSettings: &armcontainerservice.UpgradeOverrideSettings{ - // ControlPlaneOverrides: []*armcontainerservice.ControlPlaneUpgradeOverride{ - // to.Ptr(armcontainerservice.ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations)}, - // Until: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T13:00:00Z"); return t}()), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersAssociate_CRG.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_associateManagedClusterWithCapacityReservationGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{ - Location: to.Ptr("location1"), - Tags: map[string]*string{ - "archv2": to.Ptr(""), - "tier": to.Ptr("production"), - }, - Properties: &armcontainerservice.ManagedClusterProperties{ - AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, - AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - { - Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - CapacityReservationGroupID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1"), - Count: to.Ptr[int32](3), - EnableNodePublicIP: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(true), - EnableRBAC: to.Ptr(true), - KubernetesVersion: to.Ptr(""), - LinuxProfile: &armcontainerservice.LinuxProfile{ - AdminUsername: to.Ptr("azureuser"), - SSH: &armcontainerservice.SSHConfiguration{ - PublicKeys: []*armcontainerservice.SSHPublicKey{ - { - KeyData: to.Ptr("keydata"), - }}, - }, - }, - NetworkProfile: &armcontainerservice.NetworkProfile{ - LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - Count: to.Ptr[int32](2), - }, - }, - LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - }, - ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - ClientID: to.Ptr("clientid"), - Secret: to.Ptr("secret"), - }, - WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - AdminPassword: to.Ptr("replacePassword1234$"), - AdminUsername: to.Ptr("azureuser"), - }, - }, - SKU: &armcontainerservice.ManagedClusterSKU{ - Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), - Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), - }, - }, 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.ManagedCluster = armcontainerservice.ManagedCluster{ - // Name: to.Ptr("clustername1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), - // Location: to.Ptr("location1"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // Properties: &armcontainerservice.ManagedClusterProperties{ - // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - // { - // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - // CapacityReservationGroupID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1"), - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), - // EnableNodePublicIP: to.Ptr(true), - // MaxPods: to.Ptr[int32](110), - // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // VMSize: to.Ptr("Standard_DS2_v2"), - // Name: to.Ptr("nodepool1"), - // }}, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnablePodSecurityPolicy: to.Ptr(true), - // EnableRBAC: to.Ptr(true), - // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), - // KubernetesVersion: to.Ptr("1.9.6"), - // LinuxProfile: &armcontainerservice.LinuxProfile{ - // AdminUsername: to.Ptr("azureuser"), - // SSH: &armcontainerservice.SSHConfiguration{ - // PublicKeys: []*armcontainerservice.SSHPublicKey{ - // { - // KeyData: to.Ptr("keydata"), - // }}, - // }, - // }, - // MaxAgentPools: to.Ptr[int32](1), - // NetworkProfile: &armcontainerservice.NetworkProfile{ - // DNSServiceIP: to.Ptr("10.0.0.10"), - // IPFamilies: []*armcontainerservice.IPFamily{ - // to.Ptr(armcontainerservice.IPFamilyIPv4)}, - // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - // AllocatedOutboundPorts: to.Ptr[int32](2000), - // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - // Count: to.Ptr[int32](2), - // }, - // }, - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - // PodCidr: to.Ptr("10.244.0.0/16"), - // PodCidrs: []*string{ - // to.Ptr("10.244.0.0/16")}, - // ServiceCidr: to.Ptr("10.0.0.0/16"), - // ServiceCidrs: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - // ClientID: to.Ptr("clientid"), - // }, - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_MCSnapshot.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingAManagedClusterSnapshot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{ - Location: to.Ptr("location1"), - Tags: map[string]*string{ - "archv2": to.Ptr(""), - "tier": to.Ptr("production"), - }, - Properties: &armcontainerservice.ManagedClusterProperties{ - AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - { - Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - Count: to.Ptr[int32](3), - EnableFIPS: to.Ptr(true), - EnableNodePublicIP: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), - }}, - CreationData: &armcontainerservice.CreationData{ - SourceResourceID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), - }, - DNSPrefix: to.Ptr("dnsprefix1"), - KubernetesVersion: to.Ptr(""), - LinuxProfile: &armcontainerservice.LinuxProfile{ - AdminUsername: to.Ptr("azureuser"), - SSH: &armcontainerservice.SSHConfiguration{ - PublicKeys: []*armcontainerservice.SSHPublicKey{ - { - KeyData: to.Ptr("keydata"), - }}, - }, - }, - ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - ClientID: to.Ptr("clientid"), - Secret: to.Ptr("secret"), - }, - }, - SKU: &armcontainerservice.ManagedClusterSKU{ - Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), - Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), - }, - }, 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.ManagedCluster = armcontainerservice.ManagedCluster{ - // Name: to.Ptr("clustername1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), - // Location: to.Ptr("location1"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // Properties: &armcontainerservice.ManagedClusterProperties{ - // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - // { - // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - // Count: to.Ptr[int32](3), - // EnableFIPS: to.Ptr(true), - // EnableNodePublicIP: to.Ptr(true), - // MaxPods: to.Ptr[int32](110), - // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // VMSize: to.Ptr("Standard_DS2_v2"), - // Name: to.Ptr("nodepool1"), - // }}, - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), - // }, - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnableRBAC: to.Ptr(true), - // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), - // KubernetesVersion: to.Ptr("1.9.6"), - // LinuxProfile: &armcontainerservice.LinuxProfile{ - // AdminUsername: to.Ptr("azureuser"), - // SSH: &armcontainerservice.SSHConfiguration{ - // PublicKeys: []*armcontainerservice.SSHPublicKey{ - // { - // KeyData: to.Ptr("keydata"), - // }}, - // }, - // }, - // MaxAgentPools: to.Ptr[int32](1), - // NetworkProfile: &armcontainerservice.NetworkProfile{ - // DNSServiceIP: to.Ptr("10.0.0.10"), - // IPFamilies: []*armcontainerservice.IPFamily{ - // to.Ptr(armcontainerservice.IPFamilyIPv4)}, - // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - // AllocatedOutboundPorts: to.Ptr[int32](2000), - // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - // Count: to.Ptr[int32](2), - // }, - // }, - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - // PodCidr: to.Ptr("10.244.0.0/16"), - // PodCidrs: []*string{ - // to.Ptr("10.244.0.0/16")}, - // ServiceCidr: to.Ptr("10.0.0.0/16"), - // ServiceCidrs: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - // ClientID: to.Ptr("clientid"), // }, - // }, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_Snapshot.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_Snapshot.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingAnAgentPoolSnapshot() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -953,6 +694,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingA // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(false), @@ -1009,7 +751,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingA // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_ManagedNATGateway.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_ManagedNATGateway.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAksManagedNatGatewayAsOutboundType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1118,6 +860,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAk // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -1167,7 +910,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAk // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAzureKeyVaultSecretsProviderAddon() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1229,180 +972,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAz }, }, LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - }, - ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - ClientID: to.Ptr("clientid"), - Secret: to.Ptr("secret"), - }, - WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - AdminPassword: to.Ptr("replacePassword1234$"), - AdminUsername: to.Ptr("azureuser"), - }, - }, - SKU: &armcontainerservice.ManagedClusterSKU{ - Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), - Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), - }, - }, 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.ManagedCluster = armcontainerservice.ManagedCluster{ - // Name: to.Ptr("clustername1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), - // Location: to.Ptr("location1"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // Properties: &armcontainerservice.ManagedClusterProperties{ - // AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{ - // "azureKeyvaultSecretsProvider": &armcontainerservice.ManagedClusterAddonProfile{ - // Config: map[string]*string{ - // "enableSecretRotation": to.Ptr("true"), - // "rotationPollInterval": to.Ptr("2m"), - // }, - // Enabled: to.Ptr(true), - // }, - // }, - // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - // { - // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - // Count: to.Ptr[int32](3), - // EnableEncryptionAtHost: to.Ptr(true), - // EnableNodePublicIP: to.Ptr(true), - // MaxPods: to.Ptr[int32](110), - // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // VMSize: to.Ptr("Standard_DS2_v2"), - // Name: to.Ptr("nodepool1"), - // }}, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnablePodSecurityPolicy: to.Ptr(true), - // EnableRBAC: to.Ptr(true), - // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), - // KubernetesVersion: to.Ptr("1.9.6"), - // LinuxProfile: &armcontainerservice.LinuxProfile{ - // AdminUsername: to.Ptr("azureuser"), - // SSH: &armcontainerservice.SSHConfiguration{ - // PublicKeys: []*armcontainerservice.SSHPublicKey{ - // { - // KeyData: to.Ptr("keydata"), - // }}, - // }, - // }, - // MaxAgentPools: to.Ptr[int32](1), - // NetworkProfile: &armcontainerservice.NetworkProfile{ - // DNSServiceIP: to.Ptr("10.0.0.10"), - // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - // AllocatedOutboundPorts: to.Ptr[int32](2000), - // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - // Count: to.Ptr[int32](2), - // }, - // }, - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - // PodCidr: to.Ptr("10.244.0.0/16"), - // ServiceCidr: to.Ptr("10.0.0.0/16"), - // }, - // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - // ClientID: to.Ptr("clientid"), - // }, - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_EnableCustomCATrust.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCustomCaTrustCertificatesPopulatedAndCustomCaTrustEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{ - Location: to.Ptr("location1"), - Tags: map[string]*string{ - "archv2": to.Ptr(""), - "tier": to.Ptr("production"), - }, - Properties: &armcontainerservice.ManagedClusterProperties{ - AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, - AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - { - Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - Count: to.Ptr[int32](3), - EnableCustomCATrust: to.Ptr(true), - EnableNodePublicIP: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(true), - EnableRBAC: to.Ptr(true), - KubernetesVersion: to.Ptr(""), - LinuxProfile: &armcontainerservice.LinuxProfile{ - AdminUsername: to.Ptr("azureuser"), - SSH: &armcontainerservice.SSHConfiguration{ - PublicKeys: []*armcontainerservice.SSHPublicKey{ - { - KeyData: to.Ptr("keydata"), - }}, - }, - }, - NetworkProfile: &armcontainerservice.NetworkProfile{ - LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - Count: to.Ptr[int32](2), - }, - }, - LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - }, - SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{ - CustomCATrustCertificates: [][]byte{ - []byte("ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ=")}, + OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), }, ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ ClientID: to.Ptr("clientid"), @@ -1438,12 +1008,20 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCu // "tier": to.Ptr("production"), // }, // Properties: &armcontainerservice.ManagedClusterProperties{ + // AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{ + // "azureKeyvaultSecretsProvider": &armcontainerservice.ManagedClusterAddonProfile{ + // Config: map[string]*string{ + // "enableSecretRotation": to.Ptr("true"), + // "rotationPollInterval": to.Ptr("2m"), + // }, + // Enabled: to.Ptr(true), + // }, + // }, // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ // { // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), - // EnableCustomCATrust: to.Ptr(true), + // EnableEncryptionAtHost: to.Ptr(true), // EnableNodePublicIP: to.Ptr(true), // MaxPods: to.Ptr[int32](110), // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), @@ -1476,49 +1054,39 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCu // MaxAgentPools: to.Ptr[int32](1), // NetworkProfile: &armcontainerservice.NetworkProfile{ // DNSServiceIP: to.Ptr("10.0.0.10"), - // IPFamilies: []*armcontainerservice.IPFamily{ - // to.Ptr(armcontainerservice.IPFamilyIPv4)}, - // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - // AllocatedOutboundPorts: to.Ptr[int32](2000), - // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - // Count: to.Ptr[int32](2), + // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ + // AllocatedOutboundPorts: to.Ptr[int32](2000), + // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ + // { + // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, + // { + // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // }}, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ + // Count: to.Ptr[int32](2), // }, - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - // PodCidr: to.Ptr("10.244.0.0/16"), - // PodCidrs: []*string{ - // to.Ptr("10.244.0.0/16")}, - // ServiceCidr: to.Ptr("10.0.0.0/16"), - // ServiceCidrs: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{ - // CustomCATrustCertificates: [][]byte{ - // []byte("ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ=")}, - // }, - // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - // ClientID: to.Ptr("clientid"), - // }, - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), - // }, - // }, - // } + // }, + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + // PodCidr: to.Ptr("10.244.0.0/16"), + // ServiceCidr: to.Ptr("10.0.0.0/16"), + // }, + // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), + // ProvisioningState: to.Ptr("Succeeded"), + // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + // ClientID: to.Ptr("clientid"), + // }, + // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + // AdminUsername: to.Ptr("azureuser"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_DedicatedHostGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_DedicatedHostGroup.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDedicatedHostGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1612,7 +1180,6 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDe // { // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), // EnableNodePublicIP: to.Ptr(true), // HostGroupID: to.Ptr("/subscriptions/subid1/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"), // MaxPods: to.Ptr[int32](110), @@ -1683,7 +1250,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDe // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_EnableEncryptionAtHost.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEncryptionAtHostEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1794,6 +1361,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEn // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -1850,7 +1418,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEn // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_EnabledFIPS.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_EnabledFIPS.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFipsEnabledOs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1961,6 +1529,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFi // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(false), @@ -2017,7 +1586,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFi // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_GPUMIG.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_GPUMIG.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGpumig() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2136,6 +1705,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGp // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -2200,7 +1770,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGp // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_HTTPProxy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_HTTPProxy.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHttpProxyConfigured() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2317,6 +1887,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHt // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -2381,7 +1952,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHt // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_Premium.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_Premium.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithLongTermSupport() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2559,7 +2130,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithLo // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_NodePublicIPPrefix.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNodePublicIpPrefix() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2670,6 +2241,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNo // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -2726,7 +2298,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNo // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_OSSKU.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_OSSKU.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOssku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2845,6 +2417,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOs // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -2909,7 +2482,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOs // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_PPG.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_PPG.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPpg() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -3020,6 +2593,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPp // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -3076,7 +2650,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPp // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_PodIdentity.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_PodIdentity.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPodIdentityEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -3189,6 +2763,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPo // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -3249,7 +2824,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPo // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_DisableRunCommand.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_DisableRunCommand.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithRunCommandDisabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -3365,6 +2940,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithRu // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -3422,7 +2998,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithRu // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_SecurityProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_SecurityProfile.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSecurityProfileConfigured() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -3442,186 +3018,16 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSe Properties: &armcontainerservice.ManagedClusterProperties{ AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ { - Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - Count: to.Ptr[int32](3), - EnableNodePublicIP: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), - }}, - DNSPrefix: to.Ptr("dnsprefix1"), - KubernetesVersion: to.Ptr(""), - LinuxProfile: &armcontainerservice.LinuxProfile{ - AdminUsername: to.Ptr("azureuser"), - SSH: &armcontainerservice.SSHConfiguration{ - PublicKeys: []*armcontainerservice.SSHPublicKey{ - { - KeyData: to.Ptr("keydata"), - }}, - }, - }, - NetworkProfile: &armcontainerservice.NetworkProfile{ - LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - Count: to.Ptr[int32](2), - }, - }, - LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - }, - SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{ - Defender: &armcontainerservice.ManagedClusterSecurityProfileDefender{ - LogAnalyticsWorkspaceResourceID: to.Ptr("/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"), - SecurityMonitoring: &armcontainerservice.ManagedClusterSecurityProfileDefenderSecurityMonitoring{ - Enabled: to.Ptr(true), - }, - }, - }, - }, - SKU: &armcontainerservice.ManagedClusterSKU{ - Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), - Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), - }, - }, 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.ManagedCluster = armcontainerservice.ManagedCluster{ - // Name: to.Ptr("clustername1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), - // Location: to.Ptr("location1"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // Properties: &armcontainerservice.ManagedClusterProperties{ - // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - // { - // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), - // EnableNodePublicIP: to.Ptr(true), - // MaxPods: to.Ptr[int32](110), - // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // VMSize: to.Ptr("Standard_DS2_v2"), - // Name: to.Ptr("nodepool1"), - // }}, - // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnablePodSecurityPolicy: to.Ptr(true), - // EnableRBAC: to.Ptr(true), - // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), - // KubernetesVersion: to.Ptr("1.9.6"), - // LinuxProfile: &armcontainerservice.LinuxProfile{ - // AdminUsername: to.Ptr("azureuser"), - // SSH: &armcontainerservice.SSHConfiguration{ - // PublicKeys: []*armcontainerservice.SSHPublicKey{ - // { - // KeyData: to.Ptr("keydata"), - // }}, - // }, - // }, - // MaxAgentPools: to.Ptr[int32](1), - // NetworkProfile: &armcontainerservice.NetworkProfile{ - // DNSServiceIP: to.Ptr("10.0.0.10"), - // IPFamilies: []*armcontainerservice.IPFamily{ - // to.Ptr(armcontainerservice.IPFamilyIPv4)}, - // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - // AllocatedOutboundPorts: to.Ptr[int32](2000), - // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - // Count: to.Ptr[int32](2), - // }, - // }, - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - // PodCidr: to.Ptr("10.244.0.0/16"), - // PodCidrs: []*string{ - // to.Ptr("10.244.0.0/16")}, - // ServiceCidr: to.Ptr("10.0.0.0/16"), - // ServiceCidrs: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{ - // Defender: &armcontainerservice.ManagedClusterSecurityProfileDefender{ - // LogAnalyticsWorkspaceResourceID: to.Ptr("/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"), - // SecurityMonitoring: &armcontainerservice.ManagedClusterSecurityProfileDefenderSecurityMonitoring{ - // Enabled: to.Ptr(true), - // }, - // }, - // }, - // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - // ClientID: to.Ptr("clientid"), - // }, - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_EnableUltraSSD.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUltraSsdEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{ - Location: to.Ptr("location1"), - Tags: map[string]*string{ - "archv2": to.Ptr(""), - "tier": to.Ptr("production"), - }, - Properties: &armcontainerservice.ManagedClusterProperties{ - AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, - AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - { - Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - Count: to.Ptr[int32](3), - EnableNodePublicIP: to.Ptr(true), - EnableUltraSSD: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(true), - EnableRBAC: to.Ptr(true), - KubernetesVersion: to.Ptr(""), + Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + Count: to.Ptr[int32](3), + EnableNodePublicIP: to.Ptr(true), + Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS2_v2"), + Name: to.Ptr("nodepool1"), + }}, + DNSPrefix: to.Ptr("dnsprefix1"), + KubernetesVersion: to.Ptr(""), LinuxProfile: &armcontainerservice.LinuxProfile{ AdminUsername: to.Ptr("azureuser"), SSH: &armcontainerservice.SSHConfiguration{ @@ -3640,13 +3046,16 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUl LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), }, - ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - ClientID: to.Ptr("clientid"), - Secret: to.Ptr("secret"), - }, - WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - AdminPassword: to.Ptr("replacePassword1234$"), - AdminUsername: to.Ptr("azureuser"), + SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{ + Defender: &armcontainerservice.ManagedClusterSecurityProfileDefender{ + LogAnalyticsWorkspaceResourceID: to.Ptr("/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"), + SecurityMonitoring: &armcontainerservice.ManagedClusterSecurityProfileDefenderSecurityMonitoring{ + Enabled: to.Ptr(true), + }, + }, + WorkloadIdentity: &armcontainerservice.ManagedClusterSecurityProfileWorkloadIdentity{ + Enabled: to.Ptr(true), + }, }, }, SKU: &armcontainerservice.ManagedClusterSKU{ @@ -3680,7 +3089,6 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUl // Count: to.Ptr[int32](3), // CurrentOrchestratorVersion: to.Ptr("1.9.6"), // EnableNodePublicIP: to.Ptr(true), - // EnableUltraSSD: to.Ptr(true), // MaxPods: to.Ptr[int32](110), // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), @@ -3690,10 +3098,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUl // VMSize: to.Ptr("Standard_DS2_v2"), // Name: to.Ptr("nodepool1"), // }}, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -3740,6 +3145,17 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUl // }, // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), // ProvisioningState: to.Ptr("Succeeded"), + // SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{ + // Defender: &armcontainerservice.ManagedClusterSecurityProfileDefender{ + // LogAnalyticsWorkspaceResourceID: to.Ptr("/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"), + // SecurityMonitoring: &armcontainerservice.ManagedClusterSecurityProfileDefenderSecurityMonitoring{ + // Enabled: to.Ptr(true), + // }, + // }, + // WorkloadIdentity: &armcontainerservice.ManagedClusterSecurityProfileWorkloadIdentity{ + // Enabled: to.Ptr(true), + // }, + // }, // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ // ClientID: to.Ptr("clientid"), // }, @@ -3750,8 +3166,8 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUl // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithWebAppRoutingIngressProfileConfigured() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_EnableUltraSSD.json +func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUltraSsdEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -3768,24 +3184,27 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithWe "tier": to.Ptr("production"), }, Properties: &armcontainerservice.ManagedClusterProperties{ + AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ { Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), Count: to.Ptr[int32](3), EnableNodePublicIP: to.Ptr(true), + EnableUltraSSD: to.Ptr(true), Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), OSType: to.Ptr(armcontainerservice.OSTypeLinux), VMSize: to.Ptr("Standard_DS2_v2"), Name: to.Ptr("nodepool1"), }}, - DNSPrefix: to.Ptr("dnsprefix1"), - IngressProfile: &armcontainerservice.ManagedClusterIngressProfile{ - WebAppRouting: &armcontainerservice.ManagedClusterIngressProfileWebAppRouting{ - DNSZoneResourceID: to.Ptr("/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME"), - Enabled: to.Ptr(true), - }, + AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ + ScaleDownDelayAfterAdd: to.Ptr("15m"), + ScanInterval: to.Ptr("20s"), }, - KubernetesVersion: to.Ptr(""), + DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DNSPrefix: to.Ptr("dnsprefix1"), + EnablePodSecurityPolicy: to.Ptr(true), + EnableRBAC: to.Ptr(true), + KubernetesVersion: to.Ptr(""), LinuxProfile: &armcontainerservice.LinuxProfile{ AdminUsername: to.Ptr("azureuser"), SSH: &armcontainerservice.SSHConfiguration{ @@ -3804,6 +3223,14 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithWe LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), }, + ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + ClientID: to.Ptr("clientid"), + Secret: to.Ptr("secret"), + }, + WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + AdminPassword: to.Ptr("replacePassword1234$"), + AdminUsername: to.Ptr("azureuser"), + }, }, SKU: &armcontainerservice.ManagedClusterSKU{ Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), @@ -3834,7 +3261,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithWe // { // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), // Count: to.Ptr[int32](3), + // CurrentOrchestratorVersion: to.Ptr("1.9.6"), // EnableNodePublicIP: to.Ptr(true), + // EnableUltraSSD: to.Ptr(true), // MaxPods: to.Ptr[int32](110), // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), @@ -3844,17 +3273,16 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithWe // VMSize: to.Ptr("Standard_DS2_v2"), // Name: to.Ptr("nodepool1"), // }}, + // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ + // ScaleDownDelayAfterAdd: to.Ptr("15m"), + // ScanInterval: to.Ptr("20s"), + // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), - // IngressProfile: &armcontainerservice.ManagedClusterIngressProfile{ - // WebAppRouting: &armcontainerservice.ManagedClusterIngressProfileWebAppRouting{ - // DNSZoneResourceID: to.Ptr("/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME"), - // Enabled: to.Ptr(true), - // }, - // }, // KubernetesVersion: to.Ptr("1.9.6"), // LinuxProfile: &armcontainerservice.LinuxProfile{ // AdminUsername: to.Ptr("azureuser"), @@ -3906,7 +3334,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithWe // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_UserAssignedNATGateway.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUserAssignedNatGatewayAsOutboundType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -4010,6 +3438,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUs // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -4046,7 +3475,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUs // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateClusterWithPublicFqdnSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -4165,6 +3594,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -4221,7 +3651,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateClusterWithFqdnSubdomainSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -4339,6 +3769,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), // FqdnSubdomain: to.Ptr("domain1"), @@ -4394,7 +3825,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClusterWithEnableAzureRbac() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -4520,6 +3951,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClus // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -4576,7 +4008,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClus // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_Update.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -4652,13 +4084,6 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster ClientID: to.Ptr("clientid"), Secret: to.Ptr("secret"), }, - UpgradeSettings: &armcontainerservice.ClusterUpgradeSettings{ - OverrideSettings: &armcontainerservice.UpgradeOverrideSettings{ - ControlPlaneOverrides: []*armcontainerservice.ControlPlaneUpgradeOverride{ - to.Ptr(armcontainerservice.ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations)}, - Until: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T13:00:00Z"); return t }()), - }, - }, WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ AdminPassword: to.Ptr("replacePassword1234$"), AdminUsername: to.Ptr("azureuser"), @@ -4727,6 +4152,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // ScanInterval: to.Ptr("20s"), // SkipNodesWithSystemPods: to.Ptr("false"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -4776,21 +4202,14 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ // ClientID: to.Ptr("clientid"), // }, - // UpgradeSettings: &armcontainerservice.ClusterUpgradeSettings{ - // OverrideSettings: &armcontainerservice.UpgradeOverrideSettings{ - // ControlPlaneOverrides: []*armcontainerservice.ControlPlaneUpgradeOverride{ - // to.Ptr(armcontainerservice.ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations)}, - // Until: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T13:00:00Z"); return t}()), - // }, - // }, - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), - // }, + // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + // AdminUsername: to.Ptr("azureuser"), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_UpdateWithAHUB.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_UpdateWithAHUB.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithEnableAhub() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -4923,6 +4342,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -4980,182 +4400,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_UpdateWithEnableNamespaceResources.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithEnableNamespaceResources() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{ - Location: to.Ptr("location1"), - Tags: map[string]*string{ - "archv2": to.Ptr(""), - "tier": to.Ptr("production"), - }, - Properties: &armcontainerservice.ManagedClusterProperties{ - AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, - AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - { - Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - AvailabilityZones: []*string{ - to.Ptr("1"), - to.Ptr("2"), - to.Ptr("3")}, - Count: to.Ptr[int32](3), - EnableNodePublicIP: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS1_v2"), - Name: to.Ptr("nodepool1"), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnableNamespaceResources: to.Ptr(true), - EnablePodSecurityPolicy: to.Ptr(true), - EnableRBAC: to.Ptr(true), - KubernetesVersion: to.Ptr(""), - LinuxProfile: &armcontainerservice.LinuxProfile{ - AdminUsername: to.Ptr("azureuser"), - SSH: &armcontainerservice.SSHConfiguration{ - PublicKeys: []*armcontainerservice.SSHPublicKey{ - { - KeyData: to.Ptr("keydata"), - }}, - }, - }, - NetworkProfile: &armcontainerservice.NetworkProfile{ - LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - Count: to.Ptr[int32](2), - }, - }, - LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - }, - ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - ClientID: to.Ptr("clientid"), - Secret: to.Ptr("secret"), - }, - WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - AdminPassword: to.Ptr("replacePassword1234$"), - AdminUsername: to.Ptr("azureuser"), - }, - }, - SKU: &armcontainerservice.ManagedClusterSKU{ - Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), - Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), - }, - }, 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.ManagedCluster = armcontainerservice.ManagedCluster{ - // Name: to.Ptr("clustername1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), - // Location: to.Ptr("location1"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // Properties: &armcontainerservice.ManagedClusterProperties{ - // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - // { - // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), - // EnableNodePublicIP: to.Ptr(true), - // MaxPods: to.Ptr[int32](110), - // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // VMSize: to.Ptr("Standard_DS1_v2"), - // Name: to.Ptr("nodepool1"), - // }}, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnableNamespaceResources: to.Ptr(true), - // EnablePodSecurityPolicy: to.Ptr(true), - // EnableRBAC: to.Ptr(true), - // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), - // KubernetesVersion: to.Ptr("1.9.6"), - // LinuxProfile: &armcontainerservice.LinuxProfile{ - // AdminUsername: to.Ptr("azureuser"), - // SSH: &armcontainerservice.SSHConfiguration{ - // PublicKeys: []*armcontainerservice.SSHPublicKey{ - // { - // KeyData: to.Ptr("keydata"), - // }}, - // }, - // }, - // MaxAgentPools: to.Ptr[int32](1), - // NetworkProfile: &armcontainerservice.NetworkProfile{ - // DNSServiceIP: to.Ptr("10.0.0.10"), - // IPFamilies: []*armcontainerservice.IPFamily{ - // to.Ptr(armcontainerservice.IPFamilyIPv4)}, - // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - // AllocatedOutboundPorts: to.Ptr[int32](2000), - // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid1/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - // Count: to.Ptr[int32](2), - // }, - // }, - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - // PodCidr: to.Ptr("10.244.0.0/16"), - // PodCidrs: []*string{ - // to.Ptr("10.244.0.0/16")}, - // ServiceCidr: to.Ptr("10.0.0.0/16"), - // ServiceCidrs: []*string{ - // to.Ptr("10.0.0.0/16")}, - // }, - // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - // ClientID: to.Ptr("clientid"), - // }, - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_UpdateWindowsGmsa.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithWindowsGMsaEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5290,6 +4535,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, + // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), @@ -5349,7 +4595,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersCreate_DualStackNetworking.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersCreate_DualStackNetworking.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithDualStackNetworking() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5475,12 +4721,12 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // to.Ptr("2"), // to.Ptr("3")}, // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // CurrentOrchestratorVersion: to.Ptr("1.22.1"), // EnableNodePublicIP: to.Ptr(true), // MaxPods: to.Ptr[int32](110), // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), - // OrchestratorVersion: to.Ptr("1.9.6"), + // OrchestratorVersion: to.Ptr("1.22.1"), // OSType: to.Ptr(armcontainerservice.OSTypeLinux), // ProvisioningState: to.Ptr("Succeeded"), // ScaleDownMode: to.Ptr(armcontainerservice.ScaleDownModeDeallocate), @@ -5496,12 +4742,13 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // ScanInterval: to.Ptr("20s"), // SkipNodesWithSystemPods: to.Ptr("false"), // }, + // CurrentKubernetesVersion: to.Ptr("1.22.1"), // DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), - // KubernetesVersion: to.Ptr("1.9.6"), + // KubernetesVersion: to.Ptr("1.22.1"), // LinuxProfile: &armcontainerservice.LinuxProfile{ // AdminUsername: to.Ptr("azureuser"), // SSH: &armcontainerservice.SSHConfiguration{ @@ -5559,7 +4806,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersUpdateTags.json func ExampleManagedClustersClient_BeginUpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5636,7 +4883,7 @@ func ExampleManagedClustersClient_BeginUpdateTags() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersDelete.json func ExampleManagedClustersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5647,7 +4894,7 @@ func ExampleManagedClustersClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewManagedClustersClient().BeginDelete(ctx, "rg1", "clustername1", &armcontainerservice.ManagedClustersClientBeginDeleteOptions{IgnorePodDisruptionBudget: nil}) + poller, err := clientFactory.NewManagedClustersClient().BeginDelete(ctx, "rg1", "clustername1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -5657,7 +4904,7 @@ func ExampleManagedClustersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersResetServicePrincipalProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersResetServicePrincipalProfile.json func ExampleManagedClustersClient_BeginResetServicePrincipalProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5681,7 +4928,7 @@ func ExampleManagedClustersClient_BeginResetServicePrincipalProfile() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersResetAADProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersResetAADProfile.json func ExampleManagedClustersClient_BeginResetAADProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5707,8 +4954,8 @@ func ExampleManagedClustersClient_BeginResetAADProfile() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersAbortOperation.json -func ExampleManagedClustersClient_BeginAbortLatestOperation() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersRotateClusterCertificates.json +func ExampleManagedClustersClient_BeginRotateClusterCertificates() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -5718,7 +4965,7 @@ func ExampleManagedClustersClient_BeginAbortLatestOperation() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewManagedClustersClient().BeginAbortLatestOperation(ctx, "rg1", "clustername1", nil) + poller, err := clientFactory.NewManagedClustersClient().BeginRotateClusterCertificates(ctx, "rg1", "clustername1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -5728,8 +4975,8 @@ func ExampleManagedClustersClient_BeginAbortLatestOperation() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersRotateClusterCertificates.json -func ExampleManagedClustersClient_BeginRotateClusterCertificates() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersAbortOperation.json +func ExampleManagedClustersClient_BeginAbortLatestOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -5739,7 +4986,7 @@ func ExampleManagedClustersClient_BeginRotateClusterCertificates() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewManagedClustersClient().BeginRotateClusterCertificates(ctx, "rg1", "clustername1", nil) + poller, err := clientFactory.NewManagedClustersClient().BeginAbortLatestOperation(ctx, "rg1", "clustername1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -5749,7 +4996,7 @@ func ExampleManagedClustersClient_BeginRotateClusterCertificates() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersRotateServiceAccountSigningKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersRotateServiceAccountSigningKeys.json func ExampleManagedClustersClient_BeginRotateServiceAccountSigningKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5770,7 +5017,7 @@ func ExampleManagedClustersClient_BeginRotateServiceAccountSigningKeys() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersStop.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersStop.json func ExampleManagedClustersClient_BeginStop() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5791,7 +5038,7 @@ func ExampleManagedClustersClient_BeginStop() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClustersStart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/ManagedClustersStart.json func ExampleManagedClustersClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5812,7 +5059,7 @@ func ExampleManagedClustersClient_BeginStart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/RunCommandRequest.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/RunCommandRequest.json func ExampleManagedClustersClient_BeginRunCommand() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5850,7 +5097,7 @@ func ExampleManagedClustersClient_BeginRunCommand() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/RunCommandResultFailed.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/RunCommandResultFailed.json func ExampleManagedClustersClient_GetCommandResult_commandFailedResult() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5877,7 +5124,7 @@ func ExampleManagedClustersClient_GetCommandResult_commandFailedResult() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/RunCommandResultSucceed.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/RunCommandResultSucceed.json func ExampleManagedClustersClient_GetCommandResult_commandSucceedResult() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5907,7 +5154,7 @@ func ExampleManagedClustersClient_GetCommandResult_commandSucceedResult() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/OutboundNetworkDependenciesEndpointsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/OutboundNetworkDependenciesEndpointsList.json func ExampleManagedClustersClient_NewListOutboundNetworkDependenciesEndpointsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go deleted file mode 100644 index 1f00385c57a5..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go +++ /dev/null @@ -1,431 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice - -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" -) - -// ManagedClusterSnapshotsClient contains the methods for the ManagedClusterSnapshots group. -// Don't use this type directly, use NewManagedClusterSnapshotsClient() instead. -type ManagedClusterSnapshotsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewManagedClusterSnapshotsClient creates a new instance of ManagedClusterSnapshotsClient 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 NewManagedClusterSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error) { - cl, err := arm.NewClient(moduleName+".ManagedClusterSnapshotsClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ManagedClusterSnapshotsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a managed cluster snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - resourceName - The name of the managed cluster resource. -// - parameters - The managed cluster snapshot to create or update. -// - options - ManagedClusterSnapshotsClientCreateOrUpdateOptions contains the optional parameters for the ManagedClusterSnapshotsClient.CreateOrUpdate -// method. -func (client *ManagedClusterSnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterSnapshot, options *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "ManagedClusterSnapshotsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) - if err != nil { - return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagedClusterSnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterSnapshot, options *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" - 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 resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - 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-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ManagedClusterSnapshotsClient) createOrUpdateHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error) { - result := ManagedClusterSnapshotsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshot); err != nil { - return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Deletes a managed cluster snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - resourceName - The name of the managed cluster resource. -// - options - ManagedClusterSnapshotsClientDeleteOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Delete -// method. -func (client *ManagedClusterSnapshotsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error) { - var err error - const operationName = "ManagedClusterSnapshotsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) - if err != nil { - return ManagedClusterSnapshotsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ManagedClusterSnapshotsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return ManagedClusterSnapshotsClientDeleteResponse{}, err - } - return ManagedClusterSnapshotsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ManagedClusterSnapshotsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" - 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 resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - 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-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a managed cluster snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - resourceName - The name of the managed cluster resource. -// - options - ManagedClusterSnapshotsClientGetOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Get -// method. -func (client *ManagedClusterSnapshotsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error) { - var err error - const operationName = "ManagedClusterSnapshotsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) - if err != nil { - return ManagedClusterSnapshotsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ManagedClusterSnapshotsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ManagedClusterSnapshotsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ManagedClusterSnapshotsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" - 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 resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - 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-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ManagedClusterSnapshotsClient) getHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientGetResponse, error) { - result := ManagedClusterSnapshotsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshot); err != nil { - return ManagedClusterSnapshotsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of managed cluster snapshots in the specified subscription. -// -// Generated from API version 2023-05-02-preview -// - options - ManagedClusterSnapshotsClientListOptions contains the optional parameters for the ManagedClusterSnapshotsClient.NewListPager -// method. -func (client *ManagedClusterSnapshotsClient) NewListPager(options *ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ManagedClusterSnapshotsClientListResponse]{ - More: func(page ManagedClusterSnapshotsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ManagedClusterSnapshotsClientListResponse) (ManagedClusterSnapshotsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClusterSnapshotsClient.NewListPager") - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ManagedClusterSnapshotsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ManagedClusterSnapshotsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedClusterSnapshotsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ManagedClusterSnapshotsClient) listCreateRequest(ctx context.Context, options *ManagedClusterSnapshotsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots" - 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", "2023-05-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ManagedClusterSnapshotsClient) listHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientListResponse, error) { - result := ManagedClusterSnapshotsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshotListResult); err != nil { - return ManagedClusterSnapshotsClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists managed cluster snapshots in the specified subscription and resource group. -// -// Generated from API version 2023-05-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - options - ManagedClusterSnapshotsClientListByResourceGroupOptions contains the optional parameters for the ManagedClusterSnapshotsClient.NewListByResourceGroupPager -// method. -func (client *ManagedClusterSnapshotsClient) NewListByResourceGroupPager(resourceGroupName string, options *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ManagedClusterSnapshotsClientListByResourceGroupResponse]{ - More: func(page ManagedClusterSnapshotsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ManagedClusterSnapshotsClientListByResourceGroupResponse) (ManagedClusterSnapshotsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClusterSnapshotsClient.NewListByResourceGroupPager") - 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 ManagedClusterSnapshotsClientListByResourceGroupResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ManagedClusterSnapshotsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedClusterSnapshotsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots" - 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", "2023-05-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ManagedClusterSnapshotsClient) listByResourceGroupHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientListByResourceGroupResponse, error) { - result := ManagedClusterSnapshotsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshotListResult); err != nil { - return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// UpdateTags - Updates tags on a managed cluster snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - resourceName - The name of the managed cluster resource. -// - parameters - Parameters supplied to the Update managed cluster snapshot Tags operation. -// - options - ManagedClusterSnapshotsClientUpdateTagsOptions contains the optional parameters for the ManagedClusterSnapshotsClient.UpdateTags -// method. -func (client *ManagedClusterSnapshotsClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error) { - var err error - const operationName = "ManagedClusterSnapshotsClient.UpdateTags" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) - if err != nil { - return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err - } - resp, err := client.updateTagsHandleResponse(httpResp) - return resp, err -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *ManagedClusterSnapshotsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClusterSnapshotsClientUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" - 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 resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - 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-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *ManagedClusterSnapshotsClient) updateTagsHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientUpdateTagsResponse, error) { - result := ManagedClusterSnapshotsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshot); err != nil { - return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client_example_test.go deleted file mode 100644 index 9e4c7aeead11..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client_example_test.go +++ /dev/null @@ -1,343 +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 armcontainerservice_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/containerservice/armcontainerservice/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClusterSnapshotsList.json -func ExampleManagedClusterSnapshotsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedClusterSnapshotsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedClusterSnapshotListResult = armcontainerservice.ManagedClusterSnapshotListResult{ - // Value: []*armcontainerservice.ManagedClusterSnapshot{ - // { - // Name: to.Ptr("snapshot1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusterSnapshots"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298420761Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // "key2": to.Ptr("val2"), - // }, - // Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), - // }, - // ManagedClusterPropertiesReadOnly: &armcontainerservice.ManagedClusterPropertiesForSnapshot{ - // EnableRbac: to.Ptr(true), - // KubernetesVersion: to.Ptr("1.20.5"), - // NetworkProfile: &armcontainerservice.NetworkProfileForSnapshot{ - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - // NetworkMode: to.Ptr(armcontainerservice.NetworkModeBridge), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // NetworkPolicy: to.Ptr(armcontainerservice.NetworkPolicyCalico), - // }, - // SKU: &armcontainerservice.ManagedClusterSKU{ - // Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), - // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), - // }, - // }, - // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeManagedCluster), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClusterSnapshotsListByResourceGroup.json -func ExampleManagedClusterSnapshotsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedClusterSnapshotsClient().NewListByResourceGroupPager("rg1", 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.ManagedClusterSnapshotListResult = armcontainerservice.ManagedClusterSnapshotListResult{ - // Value: []*armcontainerservice.ManagedClusterSnapshot{ - // { - // Name: to.Ptr("snapshot1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusterSnapshots"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298420761Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // "key2": to.Ptr("val2"), - // }, - // Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), - // }, - // ManagedClusterPropertiesReadOnly: &armcontainerservice.ManagedClusterPropertiesForSnapshot{ - // EnableRbac: to.Ptr(true), - // KubernetesVersion: to.Ptr("1.20.5"), - // NetworkProfile: &armcontainerservice.NetworkProfileForSnapshot{ - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - // NetworkMode: to.Ptr(armcontainerservice.NetworkModeBridge), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // NetworkPolicy: to.Ptr(armcontainerservice.NetworkPolicyCalico), - // }, - // SKU: &armcontainerservice.ManagedClusterSKU{ - // Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), - // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), - // }, - // }, - // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeManagedCluster), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClusterSnapshotsGet.json -func ExampleManagedClusterSnapshotsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedClusterSnapshotsClient().Get(ctx, "rg1", "snapshot1", 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.ManagedClusterSnapshot = armcontainerservice.ManagedClusterSnapshot{ - // Name: to.Ptr("snapshot1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusterSnapshots"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298420761Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // "key2": to.Ptr("val2"), - // }, - // Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), - // }, - // ManagedClusterPropertiesReadOnly: &armcontainerservice.ManagedClusterPropertiesForSnapshot{ - // EnableRbac: to.Ptr(true), - // KubernetesVersion: to.Ptr("1.20.5"), - // NetworkProfile: &armcontainerservice.NetworkProfileForSnapshot{ - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - // NetworkMode: to.Ptr(armcontainerservice.NetworkModeBridge), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // NetworkPolicy: to.Ptr(armcontainerservice.NetworkPolicyCalico), - // }, - // SKU: &armcontainerservice.ManagedClusterSKU{ - // Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), - // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), - // }, - // }, - // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeManagedCluster), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClusterSnapshotsCreate.json -func ExampleManagedClusterSnapshotsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedClusterSnapshotsClient().CreateOrUpdate(ctx, "rg1", "snapshot1", armcontainerservice.ManagedClusterSnapshot{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - "key2": to.Ptr("val2"), - }, - Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ - CreationData: &armcontainerservice.CreationData{ - SourceResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedClusterSnapshot = armcontainerservice.ManagedClusterSnapshot{ - // Name: to.Ptr("snapshot1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusterSnapshots"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298420761Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // "key2": to.Ptr("val2"), - // }, - // Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), - // }, - // ManagedClusterPropertiesReadOnly: &armcontainerservice.ManagedClusterPropertiesForSnapshot{ - // EnableRbac: to.Ptr(true), - // KubernetesVersion: to.Ptr("1.20.5"), - // NetworkProfile: &armcontainerservice.NetworkProfileForSnapshot{ - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - // NetworkMode: to.Ptr(armcontainerservice.NetworkModeBridge), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // NetworkPolicy: to.Ptr(armcontainerservice.NetworkPolicyCalico), - // }, - // SKU: &armcontainerservice.ManagedClusterSKU{ - // Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), - // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), - // }, - // }, - // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeManagedCluster), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClusterSnapshotsUpdateTags.json -func ExampleManagedClusterSnapshotsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedClusterSnapshotsClient().UpdateTags(ctx, "rg1", "snapshot1", armcontainerservice.TagsObject{ - Tags: map[string]*string{ - "key2": to.Ptr("new-val2"), - "key3": to.Ptr("val3"), - }, - }, 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.ManagedClusterSnapshot = armcontainerservice.ManagedClusterSnapshot{ - // Name: to.Ptr("snapshot1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusterSnapshots"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298420761Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // "key2": to.Ptr("val2"), - // }, - // Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), - // }, - // ManagedClusterPropertiesReadOnly: &armcontainerservice.ManagedClusterPropertiesForSnapshot{ - // EnableRbac: to.Ptr(true), - // KubernetesVersion: to.Ptr("1.20.5"), - // NetworkProfile: &armcontainerservice.NetworkProfileForSnapshot{ - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - // NetworkMode: to.Ptr(armcontainerservice.NetworkModeBridge), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // NetworkPolicy: to.Ptr(armcontainerservice.NetworkPolicyCalico), - // }, - // SKU: &armcontainerservice.ManagedClusterSKU{ - // Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), - // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), - // }, - // }, - // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeManagedCluster), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/ManagedClusterSnapshotsDelete.json -func ExampleManagedClusterSnapshotsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagedClusterSnapshotsClient().Delete(ctx, "rg1", "snapshot1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/models.go b/sdk/resourcemanager/containerservice/armcontainerservice/models.go index 2f0719842666..0f23c291df88 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/models.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/models.go @@ -81,18 +81,6 @@ type AgentPoolListResult struct { NextLink *string } -// AgentPoolNetworkProfile - Network settings of an agent pool. -type AgentPoolNetworkProfile struct { - // The port ranges that are allowed to access. The specified ranges are allowed to overlap. - AllowedHostPorts []*PortRange - - // The IDs of the application security groups which agent pool will associate when created. - ApplicationSecurityGroups []*string - - // IPTags of instance-level public IPs. - NodePublicIPTags []*IPTag -} - // AgentPoolUpgradeProfile - The list of available upgrades for an agent pool. type AgentPoolUpgradeProfile struct { // REQUIRED; The properties of the agent pool upgrade profile. @@ -141,13 +129,6 @@ type AgentPoolUpgradeSettings struct { MaxSurge *string } -// AgentPoolWindowsProfile - The Windows agent pool's specific profile. -type AgentPoolWindowsProfile struct { - // The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows - // agent pool does not have node public IP enabled. - DisableOutboundNat *bool -} - // AgentPoolsClientBeginAbortLatestOperationOptions contains the optional parameters for the AgentPoolsClient.BeginAbortLatestOperation // method. type AgentPoolsClientBeginAbortLatestOperationOptions struct { @@ -164,8 +145,6 @@ type AgentPoolsClientBeginCreateOrUpdateOptions struct { // AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method. type AgentPoolsClientBeginDeleteOptions struct { - // ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget - IgnorePodDisruptionBudget *bool // Resumes the LRO from the provided token. ResumeToken string } @@ -219,12 +198,6 @@ type AzureKeyVaultKms struct { KeyVaultResourceID *string } -// ClusterUpgradeSettings - Settings for upgrading a cluster. -type ClusterUpgradeSettings struct { - // Settings for overrides. - OverrideSettings *UpgradeOverrideSettings -} - // CommandResultProperties - The results of a run command type CommandResultProperties struct { // READ-ONLY; The exit code of the command @@ -315,54 +288,6 @@ type ExtendedLocation struct { Type *ExtendedLocationTypes } -// GuardrailsProfile - The Guardrails profile. -type GuardrailsProfile struct { - // REQUIRED; The guardrails level to be used. By default, Guardrails is enabled for all namespaces except those that AKS excludes - // via systemExcludedNamespaces - Level *Level - - // REQUIRED; The version of constraints to use - Version *string - - // List of namespaces excluded from guardrails checks - ExcludedNamespaces []*string - - // READ-ONLY; List of namespaces specified by AKS to be excluded from Guardrails - SystemExcludedNamespaces []*string -} - -// IPTag - Contains the IPTag associated with the object. -type IPTag struct { - // The IP tag type. Example: RoutingPreference. - IPTagType *string - - // The value of the IP tag associated with the public IP. Example: Internet. - Tag *string -} - -// IstioComponents - Istio components configuration. -type IstioComponents struct { - // Istio ingress gateways. - IngressGateways []*IstioIngressGateway -} - -// IstioIngressGateway - Istio ingress gateway configuration. For now, we support up to one external ingress gateway named -// aks-istio-ingressgateway-external and one internal ingress gateway named -// aks-istio-ingressgateway-internal. -type IstioIngressGateway struct { - // REQUIRED; Whether to enable the ingress gateway. - Enabled *bool - - // REQUIRED; Mode of an ingress gateway. - Mode *IstioIngressGatewayMode -} - -// IstioServiceMesh - Istio service mesh configuration. -type IstioServiceMesh struct { - // Istio components configuration. - Components *IstioComponents -} - // KubeletConfig - See AKS custom node configuration [https://docs.microsoft.com/azure/aks/custom-node-configuration] for // more details. type KubeletConfig struct { @@ -630,16 +555,9 @@ type ManagedClusterAPIServerAccessProfile struct { // Whether to create additional public FQDN for private cluster or not. EnablePrivateClusterPublicFQDN *bool - // Whether to enable apiserver vnet integration for the cluster or not. - EnableVnetIntegration *bool - // The default is System. For more details see configure private DNS zone [https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone]. // Allowed values are 'system' and 'none'. PrivateDNSZone *string - - // It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet - // integration. - SubnetID *string } // ManagedClusterAccessProfile - Managed cluster Access Profile. @@ -698,9 +616,6 @@ type ManagedClusterAgentPoolProfile struct { // The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. AvailabilityZones []*string - // AKS will associate the specified agent pool with the Capacity Reservation Group. - CapacityReservationGroupID *string - // Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user // pools and in the range of 1 to 1000 (inclusive) for system pools. The default // value is 1. @@ -712,11 +627,6 @@ type ManagedClusterAgentPoolProfile struct { // Whether to enable auto-scaler EnableAutoScaling *bool - // When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with - // host services to sync custom certificate authorities from user-provided list of - // base64 encoded certificates into node trust stores. Defaults to false. - EnableCustomCATrust *bool - // This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption EnableEncryptionAtHost *bool @@ -757,11 +667,6 @@ type ManagedClusterAgentPoolProfile struct { // The maximum number of pods that can run on a node. MaxPods *int32 - // A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of - // the day for Linux nodes. It must not be specified for Windows nodes. It must be a - // static string (i.e., will be printed raw and not be executed as a script). - MessageOfTheDay *string - // The minimum number of nodes for auto-scaling MinCount *int32 @@ -769,9 +674,6 @@ type ManagedClusterAgentPoolProfile struct { // and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools Mode *AgentPoolMode - // Network-related settings of an agent pool. - NetworkProfile *AgentPoolNetworkProfile - // The node labels to be persisted across all nodes in agent pool. NodeLabels map[string]*string @@ -790,21 +692,20 @@ type ManagedClusterAgentPoolProfile struct { // see Ephemeral OS [https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os]. OSDiskType *OSDiskType - // Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if - // OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 - // after Windows2019 is deprecated. + // Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when + // Kubernetes = 1.25 if OSType is Windows. OSSKU *OSSKU // The operating system type. The default is Linux. OSType *OSType - // Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating - // the agent pool with the same once it has been created will not trigger an - // upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster - // to the same Kubernetes version. The node pool version must have the same - // major version as the control plane. The node pool minor version must be within two minor versions of the control plane - // version. The node pool version cannot be greater than the control plane version. - // For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. + // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version + // is chosen automatically. Updating the cluster with the same once it has been + // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, + // you should upgrade all node pools in an AKS cluster to the same Kubernetes + // version. The node pool version must have the same major version as the control plane. The node pool minor version must + // be within two minor versions of the control plane version. The node pool version + // cannot be greater than the control plane version. For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. OrchestratorVersion *string // If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: @@ -852,14 +753,11 @@ type ManagedClusterAgentPoolProfile struct { // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} VnetSubnetID *string - // The Windows agent pool's specific profile. - WindowsProfile *AgentPoolWindowsProfile - // Determines the type of workload a node can run. WorkloadRuntime *WorkloadRuntime - // READ-ONLY; If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion - // was , this field will contain the full version being used. + // READ-ONLY; If orchestratorVersion is a fully specified version , this field will be exactly equal to it. If orchestratorVersion + // is , this field will contain the full version being used. CurrentOrchestratorVersion *string // READ-ONLY; The version of node image @@ -874,9 +772,6 @@ type ManagedClusterAgentPoolProfileProperties struct { // The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. AvailabilityZones []*string - // AKS will associate the specified agent pool with the Capacity Reservation Group. - CapacityReservationGroupID *string - // Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user // pools and in the range of 1 to 1000 (inclusive) for system pools. The default // value is 1. @@ -888,11 +783,6 @@ type ManagedClusterAgentPoolProfileProperties struct { // Whether to enable auto-scaler EnableAutoScaling *bool - // When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with - // host services to sync custom certificate authorities from user-provided list of - // base64 encoded certificates into node trust stores. Defaults to false. - EnableCustomCATrust *bool - // This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption EnableEncryptionAtHost *bool @@ -933,11 +823,6 @@ type ManagedClusterAgentPoolProfileProperties struct { // The maximum number of pods that can run on a node. MaxPods *int32 - // A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of - // the day for Linux nodes. It must not be specified for Windows nodes. It must be a - // static string (i.e., will be printed raw and not be executed as a script). - MessageOfTheDay *string - // The minimum number of nodes for auto-scaling MinCount *int32 @@ -945,9 +830,6 @@ type ManagedClusterAgentPoolProfileProperties struct { // and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools Mode *AgentPoolMode - // Network-related settings of an agent pool. - NetworkProfile *AgentPoolNetworkProfile - // The node labels to be persisted across all nodes in agent pool. NodeLabels map[string]*string @@ -966,21 +848,20 @@ type ManagedClusterAgentPoolProfileProperties struct { // see Ephemeral OS [https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os]. OSDiskType *OSDiskType - // Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if - // OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 - // after Windows2019 is deprecated. + // Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when + // Kubernetes = 1.25 if OSType is Windows. OSSKU *OSSKU // The operating system type. The default is Linux. OSType *OSType - // Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating - // the agent pool with the same once it has been created will not trigger an - // upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster - // to the same Kubernetes version. The node pool version must have the same - // major version as the control plane. The node pool minor version must be within two minor versions of the control plane - // version. The node pool version cannot be greater than the control plane version. - // For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. + // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version + // is chosen automatically. Updating the cluster with the same once it has been + // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, + // you should upgrade all node pools in an AKS cluster to the same Kubernetes + // version. The node pool version must have the same major version as the control plane. The node pool minor version must + // be within two minor versions of the control plane version. The node pool version + // cannot be greater than the control plane version. For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. OrchestratorVersion *string // If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: @@ -1028,14 +909,11 @@ type ManagedClusterAgentPoolProfileProperties struct { // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} VnetSubnetID *string - // The Windows agent pool's specific profile. - WindowsProfile *AgentPoolWindowsProfile - // Determines the type of workload a node can run. WorkloadRuntime *WorkloadRuntime - // READ-ONLY; If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion - // was , this field will contain the full version being used. + // READ-ONLY; If orchestratorVersion is a fully specified version , this field will be exactly equal to it. If orchestratorVersion + // is , this field will contain the full version being used. CurrentOrchestratorVersion *string // READ-ONLY; The version of node image @@ -1047,35 +925,44 @@ type ManagedClusterAgentPoolProfileProperties struct { // ManagedClusterAutoUpgradeProfile - Auto upgrade profile for a managed cluster. type ManagedClusterAutoUpgradeProfile struct { - // The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. - NodeOSUpgradeChannel *NodeOSUpgradeChannel - // For more information see setting the AKS cluster auto-upgrade channel [https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel]. UpgradeChannel *UpgradeChannel } -// ManagedClusterAzureMonitorProfile - Prometheus addon profile for the container service cluster +// ManagedClusterAzureMonitorProfile - Azure Monitor addon profiles for monitoring the managed cluster. type ManagedClusterAzureMonitorProfile struct { - // Metrics profile for the prometheus service addon + // Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect out-of-the-box Kubernetes infrastructure + // metrics to send to an Azure Monitor Workspace and configure additional + // scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. Metrics *ManagedClusterAzureMonitorProfileMetrics } -// ManagedClusterAzureMonitorProfileKubeStateMetrics - Kube State Metrics for prometheus addon profile for the container service -// cluster +// ManagedClusterAzureMonitorProfileKubeStateMetrics - Kube State Metrics profile for the Azure Managed Prometheus addon. +// These optional settings are for the kube-state-metrics pod that is deployed with the addon. See +// aka.ms/AzureManagedPrometheus-optional-parameters for details. type ManagedClusterAzureMonitorProfileKubeStateMetrics struct { - // Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + // Comma-separated list of Kubernetes annotation keys that will be used in the resource's labels metric (Example: 'namespaces=[kubernetes.io/team,…],pods=[kubernetes.io/team],…'). + // By default the metric + // contains only resource name and namespace labels. MetricAnnotationsAllowList *string - // Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + // Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric (Example: 'namespaces=[k8s-label-1,k8s-label-n,…],pods=[app],…'). + // By default the metric + // contains only resource name and namespace labels. MetricLabelsAllowlist *string } -// ManagedClusterAzureMonitorProfileMetrics - Metrics profile for the prometheus service addon +// ManagedClusterAzureMonitorProfileMetrics - Metrics profile for the Azure Monitor managed service for Prometheus addon. +// Collect out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and configure additional +// scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. type ManagedClusterAzureMonitorProfileMetrics struct { - // REQUIRED; Whether to enable the Prometheus collector + // REQUIRED; Whether to enable or disable the Azure Managed Prometheus addon for Prometheus monitoring. See aka.ms/AzureManagedPrometheus-aks-enable + // for details on enabling and disabling. Enabled *bool - // Kube State Metrics for prometheus addon profile for the container service cluster + // Kube State Metrics profile for the Azure Managed Prometheus addon. These optional settings are for the kube-state-metrics + // pod that is deployed with the addon. See + // aka.ms/AzureManagedPrometheus-optional-parameters for details. KubeStateMetrics *ManagedClusterAzureMonitorProfileKubeStateMetrics } @@ -1092,10 +979,6 @@ type ManagedClusterHTTPProxyConfig struct { // Alternative CA cert to use for connecting to proxy servers. TrustedCa *string - - // READ-ONLY; A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset - // of noProxy and values injected by AKS. - EffectiveNoProxy []*string } // ManagedClusterIdentity - Identity for the managed cluster. @@ -1113,27 +996,6 @@ type ManagedClusterIdentity struct { TenantID *string } -// ManagedClusterIngressProfile - Ingress profile for the container service cluster. -type ManagedClusterIngressProfile struct { - // Web App Routing settings for the ingress profile. - WebAppRouting *ManagedClusterIngressProfileWebAppRouting -} - -// ManagedClusterIngressProfileWebAppRouting - Web App Routing settings for the ingress profile. -type ManagedClusterIngressProfileWebAppRouting struct { - // Resource ID of the DNS Zone to be associated with the web app. Used only when Web App Routing is enabled. - DNSZoneResourceID *string - - // Whether to enable Web App Routing. - Enabled *bool - - // READ-ONLY; Managed identity of the Web Application Routing add-on. This is the identity that should be granted permissions, - // for example, to manage the associated Azure DNS resource and get certificates from - // Azure Key Vault. See this overview of the add-on [https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm] - // for more instructions. - Identity *UserAssignedIdentity -} - // ManagedClusterListResult - The response from the List Managed Clusters operation. type ManagedClusterListResult struct { // The list of managed clusters. @@ -1149,9 +1011,6 @@ type ManagedClusterLoadBalancerProfile struct { // value is 0 which results in Azure dynamically allocating ports. AllocatedOutboundPorts *int32 - // The type of the managed inbound Load Balancer BackendPool. - BackendPoolType *BackendPoolType - // The effective outbound IP resources of the cluster load balancer. EffectiveOutboundIPs []*ResourceReference @@ -1216,12 +1075,6 @@ type ManagedClusterNATGatewayProfile struct { ManagedOutboundIPProfile *ManagedClusterManagedOutboundIPProfile } -// ManagedClusterNodeResourceGroupProfile - Node resource group lockdown profile for a managed cluster. -type ManagedClusterNodeResourceGroupProfile struct { - // The restriction level applied to the cluster's node resource group - RestrictionLevel *RestrictionLevel -} - // ManagedClusterOIDCIssuerProfile - The OIDC issuer profile of the Managed Cluster. type ManagedClusterOIDCIssuerProfile struct { // Whether the OIDC issuer is enabled. @@ -1353,12 +1206,9 @@ type ManagedClusterProperties struct { // The auto upgrade configuration. AutoUpgradeProfile *ManagedClusterAutoUpgradeProfile - // Prometheus addon profile for the container service cluster + // Azure Monitor addon profiles for monitoring the managed cluster. AzureMonitorProfile *ManagedClusterAzureMonitorProfile - // CreationData to be used to specify the source Snapshot ID if the cluster will be created/upgraded using a snapshot. - CreationData *CreationData - // This cannot be updated once the Managed Cluster has been created. DNSPrefix *string @@ -1370,11 +1220,6 @@ type ManagedClusterProperties struct { // This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' DiskEncryptionSetID *string - // The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See https://aka.ms/NamespaceARMResource - // [https://aka.ms/NamespaceARMResource] for more details - // on Namespace as a ARM Resource. - EnableNamespaceResources *bool - // (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes // v1.21, and removed from Kubernetes in v1.25. Learn more at // https://aka.ms/k8s/psp and https://aka.ms/aks/psp. @@ -1386,22 +1231,19 @@ type ManagedClusterProperties struct { // This cannot be updated once the Managed Cluster has been created. FqdnSubdomain *string - // The guardrails profile holds all the guardrails information for a given cluster - GuardrailsProfile *GuardrailsProfile - // Configurations for provisioning the cluster with HTTP proxy servers. HTTPProxyConfig *ManagedClusterHTTPProxyConfig // Identities associated with the cluster. IdentityProfile map[string]*UserAssignedIdentity - // Ingress profile for the managed cluster. - IngressProfile *ManagedClusterIngressProfile - - // When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially - // by major version number. For example, upgrades between 1.14.x -> - // 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See upgrading an AKS cluster [https://docs.microsoft.com/azure/aks/upgrade-cluster] - // for more details. + // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version + // is chosen automatically. Updating the cluster with the same once it has been + // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade + // a supported AKS cluster, Kubernetes minor versions cannot be skipped. All + // upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x + // -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See upgrading + // an AKS cluster [https://docs.microsoft.com/azure/aks/upgrade-cluster] for more details. KubernetesVersion *string // The profile for Linux VMs in the Managed Cluster. @@ -1413,9 +1255,6 @@ type ManagedClusterProperties struct { // The name of the resource group containing agent pool nodes. NodeResourceGroup *string - // The node resource group configuration profile. - NodeResourceGroupProfile *ManagedClusterNodeResourceGroupProfile - // The OIDC issuer profile of the Managed Cluster. OidcIssuerProfile *ManagedClusterOIDCIssuerProfile @@ -1432,9 +1271,6 @@ type ManagedClusterProperties struct { // Security profile for the managed cluster. SecurityProfile *ManagedClusterSecurityProfile - // Service mesh profile for a managed cluster. - ServiceMeshProfile *ServiceMeshProfile - // Information about a service principal identity for the cluster to use for manipulating Azure APIs. ServicePrincipalProfile *ManagedClusterServicePrincipalProfile @@ -1444,9 +1280,6 @@ type ManagedClusterProperties struct { // The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. SupportPlan *KubernetesSupportPlan - // Settings for upgrading a cluster. - UpgradeSettings *ClusterUpgradeSettings - // The profile for Windows VMs in the Managed Cluster. WindowsProfile *ManagedClusterWindowsProfile @@ -1458,7 +1291,8 @@ type ManagedClusterProperties struct { // allowing the Azure Portal to function properly. AzurePortalFQDN *string - // READ-ONLY; The version of Kubernetes the Managed Cluster is running. + // READ-ONLY; If kubernetesVersion was a fully specified version , this field will be exactly equal to it. If kubernetesVersion + // was , this field will contain the full version being used. CurrentKubernetesVersion *string // READ-ONLY; The FQDN of the master pool. @@ -1536,21 +1370,6 @@ type ManagedClusterPropertiesAutoScalerProfile struct { SkipNodesWithSystemPods *string } -// ManagedClusterPropertiesForSnapshot - managed cluster properties for snapshot, these properties are read only. -type ManagedClusterPropertiesForSnapshot struct { - // Whether the cluster has enabled Kubernetes Role-Based Access Control or not. - EnableRbac *bool - - // The current kubernetes version. - KubernetesVersion *string - - // The current managed cluster sku. - SKU *ManagedClusterSKU - - // READ-ONLY; The current network profile. - NetworkProfile *NetworkProfileForSnapshot -} - // ManagedClusterSKU - The SKU of a Managed Cluster. type ManagedClusterSKU struct { // The name of a managed cluster SKU. @@ -1567,21 +1386,12 @@ type ManagedClusterSecurityProfile struct { // the security profile. AzureKeyVaultKms *AzureKeyVaultKms - // A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature enabled. - // For more information see Custom CA Trust Certificates - // [https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority] - CustomCATrustCertificates [][]byte - // Microsoft Defender settings for the security profile. Defender *ManagedClusterSecurityProfileDefender // Image Cleaner settings for the security profile. ImageCleaner *ManagedClusterSecurityProfileImageCleaner - // Node Restriction [https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#noderestriction] settings - // for the security profile. - NodeRestriction *ManagedClusterSecurityProfileNodeRestriction - // Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure // cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more // details. @@ -1615,12 +1425,6 @@ type ManagedClusterSecurityProfileImageCleaner struct { IntervalHours *int32 } -// ManagedClusterSecurityProfileNodeRestriction - Node Restriction settings for the security profile. -type ManagedClusterSecurityProfileNodeRestriction struct { - // Whether to enable Node Restriction - Enabled *bool -} - // ManagedClusterSecurityProfileWorkloadIdentity - Workload identity settings for the security profile. type ManagedClusterSecurityProfileWorkloadIdentity struct { // Whether to enable workload identity. @@ -1637,86 +1441,6 @@ type ManagedClusterServicePrincipalProfile struct { Secret *string } -// ManagedClusterSnapshot - A managed cluster snapshot resource. -type ManagedClusterSnapshot struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Properties of a managed cluster snapshot. - Properties *ManagedClusterSnapshotProperties - - // 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 -} - -// ManagedClusterSnapshotListResult - The response from the List Managed Cluster Snapshots operation. -type ManagedClusterSnapshotListResult struct { - // The list of managed cluster snapshots. - Value []*ManagedClusterSnapshot - - // READ-ONLY; The URL to get the next set of managed cluster snapshot results. - NextLink *string -} - -// ManagedClusterSnapshotProperties - Properties for a managed cluster snapshot. -type ManagedClusterSnapshotProperties struct { - // CreationData to be used to specify the source resource ID to create this snapshot. - CreationData *CreationData - - // The type of a snapshot. The default is NodePool. - SnapshotType *SnapshotType - - // READ-ONLY; What the properties will be showed when getting managed cluster snapshot. Those properties are read-only. - ManagedClusterPropertiesReadOnly *ManagedClusterPropertiesForSnapshot -} - -// ManagedClusterSnapshotsClientCreateOrUpdateOptions contains the optional parameters for the ManagedClusterSnapshotsClient.CreateOrUpdate -// method. -type ManagedClusterSnapshotsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ManagedClusterSnapshotsClientDeleteOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Delete -// method. -type ManagedClusterSnapshotsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ManagedClusterSnapshotsClientGetOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Get method. -type ManagedClusterSnapshotsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedClusterSnapshotsClientListByResourceGroupOptions contains the optional parameters for the ManagedClusterSnapshotsClient.NewListByResourceGroupPager -// method. -type ManagedClusterSnapshotsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ManagedClusterSnapshotsClientListOptions contains the optional parameters for the ManagedClusterSnapshotsClient.NewListPager -// method. -type ManagedClusterSnapshotsClientListOptions struct { - // placeholder for future optional parameters -} - -// ManagedClusterSnapshotsClientUpdateTagsOptions contains the optional parameters for the ManagedClusterSnapshotsClient.UpdateTags -// method. -type ManagedClusterSnapshotsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - // ManagedClusterStorageProfile - Storage profile for the container service cluster. type ManagedClusterStorageProfile struct { // AzureBlob CSI Driver settings for the storage profile. @@ -1742,9 +1466,6 @@ type ManagedClusterStorageProfileBlobCSIDriver struct { type ManagedClusterStorageProfileDiskCSIDriver struct { // Whether to enable AzureDisk CSI Driver. The default value is true. Enabled *bool - - // The version of AzureDisk CSI Driver. The default value is v1. - Version *string } // ManagedClusterStorageProfileFileCSIDriver - AzureFile CSI Driver settings for the storage profile. @@ -1820,8 +1541,7 @@ type ManagedClusterWindowsProfile struct { // ManagedClusterWorkloadAutoScalerProfile - Workload Auto-scaler profile for the managed cluster. type ManagedClusterWorkloadAutoScalerProfile struct { // KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. - Keda *ManagedClusterWorkloadAutoScalerProfileKeda - VerticalPodAutoscaler *ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + Keda *ManagedClusterWorkloadAutoScalerProfileKeda } // ManagedClusterWorkloadAutoScalerProfileKeda - KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler @@ -1831,19 +1551,6 @@ type ManagedClusterWorkloadAutoScalerProfileKeda struct { Enabled *bool } -type ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler struct { - // REQUIRED; Controls which resource value autoscaler will change. Default value is RequestsAndLimits. - ControlledValues *ControlledValues - - // REQUIRED; Whether to enable VPA. Default value is false. - Enabled *bool - - // REQUIRED; Each update mode level is a superset of the lower levels. Off 0 }, Fetcher: func(ctx context.Context, page *SnapshotsClientListResponse) (SnapshotsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SnapshotsClient.NewListPager") var req *policy.Request var err error if page == nil { @@ -260,7 +247,6 @@ func (client *SnapshotsClient) NewListPager(options *SnapshotsClientListOptions) } return client.listHandleResponse(resp) }, - Tracer: client.internal.Tracer(), }) } @@ -276,7 +262,7 @@ func (client *SnapshotsClient) listCreateRequest(ctx context.Context, options *S return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -293,7 +279,7 @@ func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (Snapshot // NewListByResourceGroupPager - Lists snapshots in the specified subscription and resource group. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager // method. @@ -303,7 +289,6 @@ func (client *SnapshotsClient) NewListByResourceGroupPager(resourceGroupName str return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *SnapshotsClientListByResourceGroupResponse) (SnapshotsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SnapshotsClient.NewListByResourceGroupPager") var req *policy.Request var err error if page == nil { @@ -323,7 +308,6 @@ func (client *SnapshotsClient) NewListByResourceGroupPager(resourceGroupName str } return client.listByResourceGroupHandleResponse(resp) }, - Tracer: client.internal.Tracer(), }) } @@ -343,7 +327,7 @@ func (client *SnapshotsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -361,17 +345,13 @@ func (client *SnapshotsClient) listByResourceGroupHandleResponse(resp *http.Resp // UpdateTags - Updates tags on a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-02-preview +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - Parameters supplied to the Update snapshot Tags operation. // - options - SnapshotsClientUpdateTagsOptions contains the optional parameters for the SnapshotsClient.UpdateTags method. func (client *SnapshotsClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *SnapshotsClientUpdateTagsOptions) (SnapshotsClientUpdateTagsResponse, error) { var err error - const operationName = "SnapshotsClient.UpdateTags" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { return SnapshotsClientUpdateTagsResponse{}, err @@ -408,7 +388,7 @@ func (client *SnapshotsClient) updateTagsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-02-preview") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client_example_test.go index 81b1c1e2e4a3..25fdc8c1e7e7 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/SnapshotsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/SnapshotsList.json func ExampleSnapshotsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -73,7 +73,7 @@ func ExampleSnapshotsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/SnapshotsListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/SnapshotsListByResourceGroup.json func ExampleSnapshotsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleSnapshotsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/SnapshotsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/SnapshotsGet.json func ExampleSnapshotsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +175,7 @@ func ExampleSnapshotsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/SnapshotsCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/SnapshotsCreate.json func ExampleSnapshotsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -233,7 +233,7 @@ func ExampleSnapshotsClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/SnapshotsUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/SnapshotsUpdateTags.json func ExampleSnapshotsClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -285,7 +285,7 @@ func ExampleSnapshotsClient_UpdateTags() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/SnapshotsDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2023-05-01/examples/SnapshotsDelete.json func ExampleSnapshotsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client.go deleted file mode 100644 index 43b840d157f9..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client.go +++ /dev/null @@ -1,320 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice - -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" -) - -// TrustedAccessRoleBindingsClient contains the methods for the TrustedAccessRoleBindings group. -// Don't use this type directly, use NewTrustedAccessRoleBindingsClient() instead. -type TrustedAccessRoleBindingsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewTrustedAccessRoleBindingsClient creates a new instance of TrustedAccessRoleBindingsClient 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 NewTrustedAccessRoleBindingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TrustedAccessRoleBindingsClient, error) { - cl, err := arm.NewClient(moduleName+".TrustedAccessRoleBindingsClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &TrustedAccessRoleBindingsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Create or update a trusted access role binding -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - resourceName - The name of the managed cluster resource. -// - trustedAccessRoleBindingName - The name of trusted access role binding. -// - trustedAccessRoleBinding - A trusted access role binding -// - options - TrustedAccessRoleBindingsClientCreateOrUpdateOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.CreateOrUpdate -// method. -func (client *TrustedAccessRoleBindingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, trustedAccessRoleBinding TrustedAccessRoleBinding, options *TrustedAccessRoleBindingsClientCreateOrUpdateOptions) (TrustedAccessRoleBindingsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "TrustedAccessRoleBindingsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, trustedAccessRoleBindingName, trustedAccessRoleBinding, options) - if err != nil { - return TrustedAccessRoleBindingsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TrustedAccessRoleBindingsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return TrustedAccessRoleBindingsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *TrustedAccessRoleBindingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, trustedAccessRoleBinding TrustedAccessRoleBinding, options *TrustedAccessRoleBindingsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" - 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 resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if trustedAccessRoleBindingName == "" { - return nil, errors.New("parameter trustedAccessRoleBindingName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{trustedAccessRoleBindingName}", url.PathEscape(trustedAccessRoleBindingName)) - 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-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, trustedAccessRoleBinding); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *TrustedAccessRoleBindingsClient) createOrUpdateHandleResponse(resp *http.Response) (TrustedAccessRoleBindingsClientCreateOrUpdateResponse, error) { - result := TrustedAccessRoleBindingsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleBinding); err != nil { - return TrustedAccessRoleBindingsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete a trusted access role binding. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - resourceName - The name of the managed cluster resource. -// - trustedAccessRoleBindingName - The name of trusted access role binding. -// - options - TrustedAccessRoleBindingsClientDeleteOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.Delete -// method. -func (client *TrustedAccessRoleBindingsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientDeleteOptions) (TrustedAccessRoleBindingsClientDeleteResponse, error) { - var err error - const operationName = "TrustedAccessRoleBindingsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, trustedAccessRoleBindingName, options) - if err != nil { - return TrustedAccessRoleBindingsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TrustedAccessRoleBindingsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return TrustedAccessRoleBindingsClientDeleteResponse{}, err - } - return TrustedAccessRoleBindingsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *TrustedAccessRoleBindingsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" - 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 resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if trustedAccessRoleBindingName == "" { - return nil, errors.New("parameter trustedAccessRoleBindingName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{trustedAccessRoleBindingName}", url.PathEscape(trustedAccessRoleBindingName)) - 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-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a trusted access role binding. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - resourceName - The name of the managed cluster resource. -// - trustedAccessRoleBindingName - The name of trusted access role binding. -// - options - TrustedAccessRoleBindingsClientGetOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.Get -// method. -func (client *TrustedAccessRoleBindingsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientGetOptions) (TrustedAccessRoleBindingsClientGetResponse, error) { - var err error - const operationName = "TrustedAccessRoleBindingsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, trustedAccessRoleBindingName, options) - if err != nil { - return TrustedAccessRoleBindingsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TrustedAccessRoleBindingsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return TrustedAccessRoleBindingsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *TrustedAccessRoleBindingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" - 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 resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if trustedAccessRoleBindingName == "" { - return nil, errors.New("parameter trustedAccessRoleBindingName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{trustedAccessRoleBindingName}", url.PathEscape(trustedAccessRoleBindingName)) - 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-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *TrustedAccessRoleBindingsClient) getHandleResponse(resp *http.Response) (TrustedAccessRoleBindingsClientGetResponse, error) { - result := TrustedAccessRoleBindingsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleBinding); err != nil { - return TrustedAccessRoleBindingsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List trusted access role bindings. -// -// Generated from API version 2023-05-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - resourceName - The name of the managed cluster resource. -// - options - TrustedAccessRoleBindingsClientListOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.NewListPager -// method. -func (client *TrustedAccessRoleBindingsClient) NewListPager(resourceGroupName string, resourceName string, options *TrustedAccessRoleBindingsClientListOptions) *runtime.Pager[TrustedAccessRoleBindingsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[TrustedAccessRoleBindingsClientListResponse]{ - More: func(page TrustedAccessRoleBindingsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *TrustedAccessRoleBindingsClientListResponse) (TrustedAccessRoleBindingsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TrustedAccessRoleBindingsClient.NewListPager") - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, resourceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return TrustedAccessRoleBindingsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TrustedAccessRoleBindingsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TrustedAccessRoleBindingsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *TrustedAccessRoleBindingsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *TrustedAccessRoleBindingsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings" - 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 resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - 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-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *TrustedAccessRoleBindingsClient) listHandleResponse(resp *http.Response) (TrustedAccessRoleBindingsClientListResponse, error) { - result := TrustedAccessRoleBindingsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleBindingListResult); err != nil { - return TrustedAccessRoleBindingsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client_example_test.go deleted file mode 100644 index 25e323120e74..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client_example_test.go +++ /dev/null @@ -1,144 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcontainerservice_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/containerservice/armcontainerservice/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/TrustedAccessRoleBindings_List.json -func ExampleTrustedAccessRoleBindingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTrustedAccessRoleBindingsClient().NewListPager("rg1", "clustername1", 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.TrustedAccessRoleBindingListResult = armcontainerservice.TrustedAccessRoleBindingListResult{ - // Value: []*armcontainerservice.TrustedAccessRoleBinding{ - // { - // Name: to.Ptr("binding1"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/trustedAccessRoleBindings"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/trustedAccessRoleBindings/binding1"), - // Properties: &armcontainerservice.TrustedAccessRoleBindingProperties{ - // Roles: []*string{ - // to.Ptr("Microsoft.MachineLearningServices/workspaces/reader"), - // to.Ptr("Microsoft.MachineLearningServices/workspaces/writer")}, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/b/providers/Microsoft.MachineLearningServices/workspaces/c"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/TrustedAccessRoleBindings_Get.json -func ExampleTrustedAccessRoleBindingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTrustedAccessRoleBindingsClient().Get(ctx, "rg1", "clustername1", "binding1", 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.TrustedAccessRoleBinding = armcontainerservice.TrustedAccessRoleBinding{ - // Name: to.Ptr("binding1"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/trustedAccessRoleBindings"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/trustedAccessRoleBindings/binding1"), - // Properties: &armcontainerservice.TrustedAccessRoleBindingProperties{ - // Roles: []*string{ - // to.Ptr("Microsoft.MachineLearningServices/workspaces/reader"), - // to.Ptr("Microsoft.MachineLearningServices/workspaces/writer")}, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/b/providers/Microsoft.MachineLearningServices/workspaces/c"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/TrustedAccessRoleBindings_CreateOrUpdate.json -func ExampleTrustedAccessRoleBindingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTrustedAccessRoleBindingsClient().CreateOrUpdate(ctx, "rg1", "clustername1", "binding1", armcontainerservice.TrustedAccessRoleBinding{ - Properties: &armcontainerservice.TrustedAccessRoleBindingProperties{ - Roles: []*string{ - to.Ptr("Microsoft.MachineLearningServices/workspaces/reader"), - to.Ptr("Microsoft.MachineLearningServices/workspaces/writer")}, - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/b/providers/Microsoft.MachineLearningServices/workspaces/c"), - }, - }, 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.TrustedAccessRoleBinding = armcontainerservice.TrustedAccessRoleBinding{ - // Name: to.Ptr("binding1"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/trustedAccessRoleBindings"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/trustedAccessRoleBindings/binding1"), - // Properties: &armcontainerservice.TrustedAccessRoleBindingProperties{ - // Roles: []*string{ - // to.Ptr("Microsoft.MachineLearningServices/workspaces/reader"), - // to.Ptr("Microsoft.MachineLearningServices/workspaces/writer")}, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/b/providers/Microsoft.MachineLearningServices/workspaces/c"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/TrustedAccessRoleBindings_Delete.json -func ExampleTrustedAccessRoleBindingsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewTrustedAccessRoleBindingsClient().Delete(ctx, "rg1", "clustername1", "binding1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go deleted file mode 100644 index 8d9a0a45a715..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go +++ /dev/null @@ -1,111 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice - -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" -) - -// TrustedAccessRolesClient contains the methods for the TrustedAccessRoles group. -// Don't use this type directly, use NewTrustedAccessRolesClient() instead. -type TrustedAccessRolesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewTrustedAccessRolesClient creates a new instance of TrustedAccessRolesClient 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 NewTrustedAccessRolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TrustedAccessRolesClient, error) { - cl, err := arm.NewClient(moduleName+".TrustedAccessRolesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &TrustedAccessRolesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - List supported trusted access roles. -// -// Generated from API version 2023-05-02-preview -// - location - The name of Azure region. -// - options - TrustedAccessRolesClientListOptions contains the optional parameters for the TrustedAccessRolesClient.NewListPager -// method. -func (client *TrustedAccessRolesClient) NewListPager(location string, options *TrustedAccessRolesClientListOptions) *runtime.Pager[TrustedAccessRolesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[TrustedAccessRolesClientListResponse]{ - More: func(page TrustedAccessRolesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *TrustedAccessRolesClientListResponse) (TrustedAccessRolesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TrustedAccessRolesClient.NewListPager") - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return TrustedAccessRolesClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TrustedAccessRolesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TrustedAccessRolesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *TrustedAccessRolesClient) listCreateRequest(ctx context.Context, location string, options *TrustedAccessRolesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - 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-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *TrustedAccessRolesClient) listHandleResponse(resp *http.Response) (TrustedAccessRolesClientListResponse, error) { - result := TrustedAccessRolesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleListResult); err != nil { - return TrustedAccessRolesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client_example_test.go deleted file mode 100644 index 27f28cc000d1..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client_example_test.go +++ /dev/null @@ -1,63 +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 armcontainerservice_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f36175f4c54eeec5b6d409406e131dadb540546a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2023-05-02-preview/examples/TrustedAccessRoles_List.json -func ExampleTrustedAccessRolesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTrustedAccessRolesClient().NewListPager("westus2", 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.TrustedAccessRoleListResult = armcontainerservice.TrustedAccessRoleListResult{ - // Value: []*armcontainerservice.TrustedAccessRole{ - // { - // Name: to.Ptr("reader"), - // Rules: []*armcontainerservice.TrustedAccessRoleRule{ - // { - // APIGroups: []*string{ - // to.Ptr("")}, - // NonResourceURLs: []*string{ - // }, - // ResourceNames: []*string{ - // }, - // Resources: []*string{ - // to.Ptr("pods")}, - // Verbs: []*string{ - // to.Ptr("get")}, - // }}, - // SourceResourceType: to.Ptr("Microsoft.MachineLearningServices/workspaces"), - // }}, - // } - } -} From db9f7b956d25b41dd3903c4d9291c71b0db95c75 Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Mon, 17 Jul 2023 15:24:18 +0800 Subject: [PATCH 2/3] gomod and update assets --- .../containerservice/armcontainerservice/assets.json | 2 +- .../containerservice/armcontainerservice/go.mod | 2 +- .../containerservice/armcontainerservice/go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/assets.json b/sdk/resourcemanager/containerservice/armcontainerservice/assets.json index 62c8d3e996cc..925468f1e86f 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/assets.json +++ b/sdk/resourcemanager/containerservice/armcontainerservice/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/resourcemanager/containerservice/armcontainerservice", - "Tag": "go/resourcemanager/containerservice/armcontainerservice_e448cde0d7" + "Tag": "go/resourcemanager/containerservice/armcontainerservice_f41aae29cc" } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/go.mod b/sdk/resourcemanager/containerservice/armcontainerservice/go.mod index c750710e15c8..3e5a0e940a93 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/go.mod +++ b/sdk/resourcemanager/containerservice/armcontainerservice/go.mod @@ -3,7 +3,7 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/ar go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0-beta.2 + 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/resourcemanager/internal v1.1.2 github.com/stretchr/testify v1.7.0 diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/go.sum b/sdk/resourcemanager/containerservice/armcontainerservice/go.sum index 4ab9e273d0e2..54f05f393a7e 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/go.sum +++ b/sdk/resourcemanager/containerservice/armcontainerservice/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0-beta.2 h1:C3zKsGguxcLd8a2uEytB8+TFtBGd75bXRxEs0QBwsv0= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0-beta.2/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +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.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= From 0b56972db62565736019270485946b8c27cd4c8f Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Mon, 24 Jul 2023 14:28:39 +0800 Subject: [PATCH 3/3] update --- .../armcontainerservice/client_factory.go | 16 +- .../armcontainerservice/go.mod | 2 +- .../armcontainerservice/go.sum | 4 +- .../armcontainerservice/models.go | 295 ------------------ .../armcontainerservice/options.go | 70 ----- .../armcontainerservice/response_types.go | 38 +++ 6 files changed, 49 insertions(+), 376 deletions(-) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go b/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go index dbfbd3b638bc..fdfb61072aca 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go @@ -37,23 +37,23 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewAgentPoolsClient() *AgentPoolsClient { + subClient, _ := NewAgentPoolsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewManagedClustersClient() *ManagedClustersClient { - subClient, _ := NewManagedClustersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewMaintenanceConfigurationsClient() *MaintenanceConfigurationsClient { + subClient, _ := NewMaintenanceConfigurationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewMaintenanceConfigurationsClient() *MaintenanceConfigurationsClient { - subClient, _ := NewMaintenanceConfigurationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewManagedClustersClient() *ManagedClustersClient { + subClient, _ := NewManagedClustersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAgentPoolsClient() *AgentPoolsClient { - subClient, _ := NewAgentPoolsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/go.mod b/sdk/resourcemanager/containerservice/armcontainerservice/go.mod index 3e5a0e940a93..12eda3df16e5 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/go.mod +++ b/sdk/resourcemanager/containerservice/armcontainerservice/go.mod @@ -3,7 +3,7 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/ar go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/stretchr/testify v1.7.0 diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/go.sum b/sdk/resourcemanager/containerservice/armcontainerservice/go.sum index 54f05f393a7e..93fdfc2850cd 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/go.sum +++ b/sdk/resourcemanager/containerservice/armcontainerservice/go.sum @@ -1,5 +1,5 @@ -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/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= 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.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/models.go b/sdk/resourcemanager/containerservice/armcontainerservice/models.go index 0f23c291df88..433fc9fa86ae 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/models.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/models.go @@ -129,54 +129,6 @@ type AgentPoolUpgradeSettings struct { MaxSurge *string } -// AgentPoolsClientBeginAbortLatestOperationOptions contains the optional parameters for the AgentPoolsClient.BeginAbortLatestOperation -// method. -type AgentPoolsClientBeginAbortLatestOperationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken 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 -} - -// AgentPoolsClientBeginUpgradeNodeImageVersionOptions contains the optional parameters for the AgentPoolsClient.BeginUpgradeNodeImageVersion -// method. -type AgentPoolsClientBeginUpgradeNodeImageVersionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AgentPoolsClientGetAvailableAgentPoolVersionsOptions contains the optional parameters for the AgentPoolsClient.GetAvailableAgentPoolVersions -// method. -type AgentPoolsClientGetAvailableAgentPoolVersionsOptions struct { - // placeholder for future optional parameters -} - -// AgentPoolsClientGetOptions contains the optional parameters for the AgentPoolsClient.Get method. -type AgentPoolsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AgentPoolsClientGetUpgradeProfileOptions contains the optional parameters for the AgentPoolsClient.GetUpgradeProfile method. -type AgentPoolsClientGetUpgradeProfileOptions struct { - // placeholder for future optional parameters -} - -// AgentPoolsClientListOptions contains the optional parameters for the AgentPoolsClient.NewListPager method. -type AgentPoolsClientListOptions struct { - // placeholder for future optional parameters -} - // AzureKeyVaultKms - Azure Key Vault key management service settings for the security profile. type AzureKeyVaultKms struct { // Whether to enable Azure Key Vault key management service. The default is false. @@ -431,30 +383,6 @@ type MaintenanceConfigurationProperties struct { TimeInWeek []*TimeInWeek } -// MaintenanceConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the MaintenanceConfigurationsClient.CreateOrUpdate -// method. -type MaintenanceConfigurationsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// MaintenanceConfigurationsClientDeleteOptions contains the optional parameters for the MaintenanceConfigurationsClient.Delete -// method. -type MaintenanceConfigurationsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// MaintenanceConfigurationsClientGetOptions contains the optional parameters for the MaintenanceConfigurationsClient.Get -// method. -type MaintenanceConfigurationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// MaintenanceConfigurationsClientListByManagedClusterOptions contains the optional parameters for the MaintenanceConfigurationsClient.NewListByManagedClusterPager -// method. -type MaintenanceConfigurationsClientListByManagedClusterOptions struct { - // placeholder for future optional parameters -} - // MaintenanceWindow - Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. type MaintenanceWindow struct { // REQUIRED; Length of maintenance window range from 4 to 24 hours. @@ -1551,157 +1479,6 @@ type ManagedClusterWorkloadAutoScalerProfileKeda struct { Enabled *bool } -// ManagedClustersClientBeginAbortLatestOperationOptions contains the optional parameters for the ManagedClustersClient.BeginAbortLatestOperation -// method. -type ManagedClustersClientBeginAbortLatestOperationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedClustersClient.BeginCreateOrUpdate -// method. -type ManagedClustersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete method. -type ManagedClustersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedClustersClientBeginResetAADProfileOptions contains the optional parameters for the ManagedClustersClient.BeginResetAADProfile -// method. -type ManagedClustersClientBeginResetAADProfileOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedClustersClientBeginResetServicePrincipalProfileOptions contains the optional parameters for the ManagedClustersClient.BeginResetServicePrincipalProfile -// method. -type ManagedClustersClientBeginResetServicePrincipalProfileOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedClustersClientBeginRotateClusterCertificatesOptions contains the optional parameters for the ManagedClustersClient.BeginRotateClusterCertificates -// method. -type ManagedClustersClientBeginRotateClusterCertificatesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions contains the optional parameters for the ManagedClustersClient.BeginRotateServiceAccountSigningKeys -// method. -type ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedClustersClientBeginRunCommandOptions contains the optional parameters for the ManagedClustersClient.BeginRunCommand -// method. -type ManagedClustersClientBeginRunCommandOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedClustersClientBeginStartOptions contains the optional parameters for the ManagedClustersClient.BeginStart method. -type ManagedClustersClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedClustersClientBeginStopOptions contains the optional parameters for the ManagedClustersClient.BeginStop method. -type ManagedClustersClientBeginStopOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedClustersClientBeginUpdateTagsOptions contains the optional parameters for the ManagedClustersClient.BeginUpdateTags -// method. -type ManagedClustersClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedClustersClientGetAccessProfileOptions contains the optional parameters for the ManagedClustersClient.GetAccessProfile -// method. -type ManagedClustersClientGetAccessProfileOptions struct { - // placeholder for future optional parameters -} - -// ManagedClustersClientGetCommandResultOptions contains the optional parameters for the ManagedClustersClient.GetCommandResult -// method. -type ManagedClustersClientGetCommandResultOptions struct { - // placeholder for future optional parameters -} - -// ManagedClustersClientGetOSOptionsOptions contains the optional parameters for the ManagedClustersClient.GetOSOptions method. -type ManagedClustersClientGetOSOptionsOptions struct { - // The resource type for which the OS options needs to be returned - ResourceType *string -} - -// ManagedClustersClientGetOptions contains the optional parameters for the ManagedClustersClient.Get method. -type ManagedClustersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedClustersClientGetUpgradeProfileOptions contains the optional parameters for the ManagedClustersClient.GetUpgradeProfile -// method. -type ManagedClustersClientGetUpgradeProfileOptions struct { - // placeholder for future optional parameters -} - -// ManagedClustersClientListByResourceGroupOptions contains the optional parameters for the ManagedClustersClient.NewListByResourceGroupPager -// method. -type ManagedClustersClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ManagedClustersClientListClusterAdminCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterAdminCredentials -// method. -type ManagedClustersClientListClusterAdminCredentialsOptions struct { - // server fqdn type for credentials to be returned - ServerFqdn *string -} - -// ManagedClustersClientListClusterMonitoringUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterMonitoringUserCredentials -// method. -type ManagedClustersClientListClusterMonitoringUserCredentialsOptions struct { - // server fqdn type for credentials to be returned - ServerFqdn *string -} - -// ManagedClustersClientListClusterUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterUserCredentials -// method. -type ManagedClustersClientListClusterUserCredentialsOptions struct { - // Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider - // kubeconfig; format 'exec' will return exec format kubeconfig, which requires - // kubelogin binary in the path. - Format *Format - // server fqdn type for credentials to be returned - ServerFqdn *string -} - -// ManagedClustersClientListKubernetesVersionsOptions contains the optional parameters for the ManagedClustersClient.ListKubernetesVersions -// method. -type ManagedClustersClientListKubernetesVersionsOptions struct { - // placeholder for future optional parameters -} - -// ManagedClustersClientListOptions contains the optional parameters for the ManagedClustersClient.NewListPager method. -type ManagedClustersClientListOptions struct { - // placeholder for future optional parameters -} - -// ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the ManagedClustersClient.NewListOutboundNetworkDependenciesEndpointsPager -// method. -type ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions struct { - // placeholder for future optional parameters -} - type ManagedServiceIdentityUserAssignedIdentitiesValue struct { // READ-ONLY; The client id of user assigned identity. ClientID *string @@ -1827,11 +1604,6 @@ type OperationValueDisplay struct { Resource *string } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // OutboundEnvironmentEndpoint - Egress endpoints which AKS agent nodes connect to for common purpose. type OutboundEnvironmentEndpoint struct { // The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. @@ -1895,31 +1667,6 @@ type PrivateEndpointConnectionProperties struct { ProvisioningState *PrivateEndpointConnectionProvisioningState } -// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete -// method. -type PrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. -type PrivateEndpointConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List -// method. -type PrivateEndpointConnectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Update -// method. -type PrivateEndpointConnectionsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // PrivateLinkResource - A private link resource type PrivateLinkResource struct { // The group ID of the resource. @@ -1941,11 +1688,6 @@ type PrivateLinkResource struct { PrivateLinkServiceID *string } -// PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List method. -type PrivateLinkResourcesClientListOptions struct { - // placeholder for future optional parameters -} - // PrivateLinkResourcesListResult - A list of private link resources type PrivateLinkResourcesListResult struct { // The collection value. @@ -1974,12 +1716,6 @@ type RelativeMonthlySchedule struct { WeekIndex *Type } -// ResolvePrivateLinkServiceIDClientPOSTOptions contains the optional parameters for the ResolvePrivateLinkServiceIDClient.POST -// method. -type ResolvePrivateLinkServiceIDClientPOSTOptions struct { - // placeholder for future optional parameters -} - // ResourceReference - A reference to an Azure resource. type ResourceReference struct { // The fully qualified Azure resource id. @@ -2097,37 +1833,6 @@ type SnapshotProperties struct { VMSize *string } -// SnapshotsClientCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.CreateOrUpdate method. -type SnapshotsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientDeleteOptions contains the optional parameters for the SnapshotsClient.Delete method. -type SnapshotsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. -type SnapshotsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager -// method. -type SnapshotsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. -type SnapshotsClientListOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientUpdateTagsOptions contains the optional parameters for the SnapshotsClient.UpdateTags method. -type SnapshotsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - // SysctlConfig - Sysctl settings for Linux agent nodes. type SysctlConfig struct { // Sysctl setting fs.aio-max-nr. diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/options.go b/sdk/resourcemanager/containerservice/armcontainerservice/options.go index ccbc19c2081b..83203afcc4d0 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/options.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/options.go @@ -24,9 +24,6 @@ type AgentPoolsClientBeginCreateOrUpdateOptions struct { // AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method. type AgentPoolsClientBeginDeleteOptions struct { - // ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget - IgnorePodDisruptionBudget *bool - // Resumes the LRO from the provided token. ResumeToken string } @@ -83,41 +80,6 @@ type MaintenanceConfigurationsClientListByManagedClusterOptions struct { // placeholder for future optional parameters } -// ManagedClusterSnapshotsClientCreateOrUpdateOptions contains the optional parameters for the ManagedClusterSnapshotsClient.CreateOrUpdate -// method. -type ManagedClusterSnapshotsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ManagedClusterSnapshotsClientDeleteOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Delete -// method. -type ManagedClusterSnapshotsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ManagedClusterSnapshotsClientGetOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Get method. -type ManagedClusterSnapshotsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedClusterSnapshotsClientListByResourceGroupOptions contains the optional parameters for the ManagedClusterSnapshotsClient.NewListByResourceGroupPager -// method. -type ManagedClusterSnapshotsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ManagedClusterSnapshotsClientListOptions contains the optional parameters for the ManagedClusterSnapshotsClient.NewListPager -// method. -type ManagedClusterSnapshotsClientListOptions struct { - // placeholder for future optional parameters -} - -// ManagedClusterSnapshotsClientUpdateTagsOptions contains the optional parameters for the ManagedClusterSnapshotsClient.UpdateTags -// method. -type ManagedClusterSnapshotsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - // ManagedClustersClientBeginAbortLatestOperationOptions contains the optional parameters for the ManagedClustersClient.BeginAbortLatestOperation // method. type ManagedClustersClientBeginAbortLatestOperationOptions struct { @@ -134,9 +96,6 @@ type ManagedClustersClientBeginCreateOrUpdateOptions struct { // ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete method. type ManagedClustersClientBeginDeleteOptions struct { - // ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget - IgnorePodDisruptionBudget *bool - // Resumes the LRO from the provided token. ResumeToken string } @@ -344,32 +303,3 @@ type SnapshotsClientListOptions struct { type SnapshotsClientUpdateTagsOptions struct { // placeholder for future optional parameters } - -// TrustedAccessRoleBindingsClientCreateOrUpdateOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.CreateOrUpdate -// method. -type TrustedAccessRoleBindingsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// TrustedAccessRoleBindingsClientDeleteOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.Delete -// method. -type TrustedAccessRoleBindingsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// TrustedAccessRoleBindingsClientGetOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.Get -// method. -type TrustedAccessRoleBindingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// TrustedAccessRoleBindingsClientListOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.NewListPager -// method. -type TrustedAccessRoleBindingsClientListOptions struct { - // placeholder for future optional parameters -} - -// TrustedAccessRolesClientListOptions contains the optional parameters for the TrustedAccessRolesClient.NewListPager method. -type TrustedAccessRolesClientListOptions struct { - // placeholder for future optional parameters -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/response_types.go b/sdk/resourcemanager/containerservice/armcontainerservice/response_types.go index 2fbabacfdbb5..cdf20508551a 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/response_types.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/response_types.go @@ -15,6 +15,7 @@ type AgentPoolsClientAbortLatestOperationResponse struct { // AgentPoolsClientCreateOrUpdateResponse contains the response from method AgentPoolsClient.BeginCreateOrUpdate. type AgentPoolsClientCreateOrUpdateResponse struct { + // Agent Pool. AgentPool } @@ -25,31 +26,38 @@ type AgentPoolsClientDeleteResponse struct { // AgentPoolsClientGetAvailableAgentPoolVersionsResponse contains the response from method AgentPoolsClient.GetAvailableAgentPoolVersions. type AgentPoolsClientGetAvailableAgentPoolVersionsResponse struct { + // The list of available versions for an agent pool. AgentPoolAvailableVersions } // AgentPoolsClientGetResponse contains the response from method AgentPoolsClient.Get. type AgentPoolsClientGetResponse struct { + // Agent Pool. AgentPool } // AgentPoolsClientGetUpgradeProfileResponse contains the response from method AgentPoolsClient.GetUpgradeProfile. type AgentPoolsClientGetUpgradeProfileResponse struct { + // The list of available upgrades for an agent pool. AgentPoolUpgradeProfile } // AgentPoolsClientListResponse contains the response from method AgentPoolsClient.NewListPager. type AgentPoolsClientListResponse struct { + // The response from the List Agent Pools operation. AgentPoolListResult } // AgentPoolsClientUpgradeNodeImageVersionResponse contains the response from method AgentPoolsClient.BeginUpgradeNodeImageVersion. type AgentPoolsClientUpgradeNodeImageVersionResponse struct { + // Agent Pool. AgentPool } // MaintenanceConfigurationsClientCreateOrUpdateResponse contains the response from method MaintenanceConfigurationsClient.CreateOrUpdate. type MaintenanceConfigurationsClientCreateOrUpdateResponse struct { + // See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned + // maintenance. MaintenanceConfiguration } @@ -60,11 +68,14 @@ type MaintenanceConfigurationsClientDeleteResponse struct { // MaintenanceConfigurationsClientGetResponse contains the response from method MaintenanceConfigurationsClient.Get. type MaintenanceConfigurationsClientGetResponse struct { + // See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned + // maintenance. MaintenanceConfiguration } // MaintenanceConfigurationsClientListByManagedClusterResponse contains the response from method MaintenanceConfigurationsClient.NewListByManagedClusterPager. type MaintenanceConfigurationsClientListByManagedClusterResponse struct { + // The response from the List maintenance configurations operation. MaintenanceConfigurationListResult } @@ -75,6 +86,7 @@ type ManagedClustersClientAbortLatestOperationResponse struct { // ManagedClustersClientCreateOrUpdateResponse contains the response from method ManagedClustersClient.BeginCreateOrUpdate. type ManagedClustersClientCreateOrUpdateResponse struct { + // Managed cluster. ManagedCluster } @@ -85,63 +97,76 @@ type ManagedClustersClientDeleteResponse struct { // ManagedClustersClientGetAccessProfileResponse contains the response from method ManagedClustersClient.GetAccessProfile. type ManagedClustersClientGetAccessProfileResponse struct { + // Managed cluster Access Profile. ManagedClusterAccessProfile } // ManagedClustersClientGetCommandResultResponse contains the response from method ManagedClustersClient.GetCommandResult. type ManagedClustersClientGetCommandResultResponse struct { + // run command result. RunCommandResult + // Location contains the information returned from the Location header response. Location *string } // ManagedClustersClientGetOSOptionsResponse contains the response from method ManagedClustersClient.GetOSOptions. type ManagedClustersClientGetOSOptionsResponse struct { + // The OS option profile. OSOptionProfile } // ManagedClustersClientGetResponse contains the response from method ManagedClustersClient.Get. type ManagedClustersClientGetResponse struct { + // Managed cluster. ManagedCluster } // ManagedClustersClientGetUpgradeProfileResponse contains the response from method ManagedClustersClient.GetUpgradeProfile. type ManagedClustersClientGetUpgradeProfileResponse struct { + // The list of available upgrades for compute pools. ManagedClusterUpgradeProfile } // ManagedClustersClientListByResourceGroupResponse contains the response from method ManagedClustersClient.NewListByResourceGroupPager. type ManagedClustersClientListByResourceGroupResponse struct { + // The response from the List Managed Clusters operation. ManagedClusterListResult } // ManagedClustersClientListClusterAdminCredentialsResponse contains the response from method ManagedClustersClient.ListClusterAdminCredentials. type ManagedClustersClientListClusterAdminCredentialsResponse struct { + // The list credential result response. CredentialResults } // ManagedClustersClientListClusterMonitoringUserCredentialsResponse contains the response from method ManagedClustersClient.ListClusterMonitoringUserCredentials. type ManagedClustersClientListClusterMonitoringUserCredentialsResponse struct { + // The list credential result response. CredentialResults } // ManagedClustersClientListClusterUserCredentialsResponse contains the response from method ManagedClustersClient.ListClusterUserCredentials. type ManagedClustersClientListClusterUserCredentialsResponse struct { + // The list credential result response. CredentialResults } // ManagedClustersClientListKubernetesVersionsResponse contains the response from method ManagedClustersClient.ListKubernetesVersions. type ManagedClustersClientListKubernetesVersionsResponse struct { + // Hold values properties, which is array of KubernetesVersion KubernetesVersionListResult } // ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse contains the response from method ManagedClustersClient.NewListOutboundNetworkDependenciesEndpointsPager. type ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse struct { + // Collection of OutboundEnvironmentEndpoint OutboundEnvironmentEndpointCollection } // ManagedClustersClientListResponse contains the response from method ManagedClustersClient.NewListPager. type ManagedClustersClientListResponse struct { + // The response from the List Managed Clusters operation. ManagedClusterListResult } @@ -167,6 +192,7 @@ type ManagedClustersClientRotateServiceAccountSigningKeysResponse struct { // ManagedClustersClientRunCommandResponse contains the response from method ManagedClustersClient.BeginRunCommand. type ManagedClustersClientRunCommandResponse struct { + // run command result. RunCommandResult } @@ -182,11 +208,13 @@ type ManagedClustersClientStopResponse struct { // ManagedClustersClientUpdateTagsResponse contains the response from method ManagedClustersClient.BeginUpdateTags. type ManagedClustersClientUpdateTagsResponse struct { + // Managed cluster. ManagedCluster } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // The List Operation response. OperationListResult } @@ -197,31 +225,37 @@ type PrivateEndpointConnectionsClientDeleteResponse struct { // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { + // A private endpoint connection PrivateEndpointConnection } // PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.List. type PrivateEndpointConnectionsClientListResponse struct { + // A list of private endpoint connections PrivateEndpointConnectionListResult } // PrivateEndpointConnectionsClientUpdateResponse contains the response from method PrivateEndpointConnectionsClient.Update. type PrivateEndpointConnectionsClientUpdateResponse struct { + // A private endpoint connection PrivateEndpointConnection } // PrivateLinkResourcesClientListResponse contains the response from method PrivateLinkResourcesClient.List. type PrivateLinkResourcesClientListResponse struct { + // A list of private link resources PrivateLinkResourcesListResult } // ResolvePrivateLinkServiceIDClientPOSTResponse contains the response from method ResolvePrivateLinkServiceIDClient.POST. type ResolvePrivateLinkServiceIDClientPOSTResponse struct { + // A private link resource PrivateLinkResource } // SnapshotsClientCreateOrUpdateResponse contains the response from method SnapshotsClient.CreateOrUpdate. type SnapshotsClientCreateOrUpdateResponse struct { + // A node pool snapshot resource. Snapshot } @@ -232,20 +266,24 @@ type SnapshotsClientDeleteResponse struct { // SnapshotsClientGetResponse contains the response from method SnapshotsClient.Get. type SnapshotsClientGetResponse struct { + // A node pool snapshot resource. Snapshot } // SnapshotsClientListByResourceGroupResponse contains the response from method SnapshotsClient.NewListByResourceGroupPager. type SnapshotsClientListByResourceGroupResponse struct { + // The response from the List Snapshots operation. SnapshotListResult } // SnapshotsClientListResponse contains the response from method SnapshotsClient.NewListPager. type SnapshotsClientListResponse struct { + // The response from the List Snapshots operation. SnapshotListResult } // SnapshotsClientUpdateTagsResponse contains the response from method SnapshotsClient.UpdateTags. type SnapshotsClientUpdateTagsResponse struct { + // A node pool snapshot resource. Snapshot }