diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md index 74c060d78cf8..517635af6133 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md +++ b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md @@ -1,5 +1,46 @@ # Release History +## 5.1.0-beta.2 (2024-05-30) +### Features Added + +- New value `ManagedClusterSKUNameAutomatic` added to enum type `ManagedClusterSKUName` +- New value `OutboundTypeNone` added to enum type `OutboundType` +- New enum type `Operator` with values `OperatorDoesNotExist`, `OperatorExists`, `OperatorIn`, `OperatorNotIn` +- New enum type `PodLinkLocalAccess` with values `PodLinkLocalAccessIMDS`, `PodLinkLocalAccessNone` +- New enum type `UndrainableNodeBehavior` with values `UndrainableNodeBehaviorCordon`, `UndrainableNodeBehaviorSchedule` +- New function `*ClientFactory.NewLoadBalancersClient() *LoadBalancersClient` +- New function `NewLoadBalancersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LoadBalancersClient, error)` +- New function `*LoadBalancersClient.CreateOrUpdate(context.Context, string, string, string, LoadBalancer, *LoadBalancersClientCreateOrUpdateOptions) (LoadBalancersClientCreateOrUpdateResponse, error)` +- New function `*LoadBalancersClient.BeginDelete(context.Context, string, string, string, *LoadBalancersClientBeginDeleteOptions) (*runtime.Poller[LoadBalancersClientDeleteResponse], error)` +- New function `*LoadBalancersClient.Get(context.Context, string, string, string, *LoadBalancersClientGetOptions) (LoadBalancersClientGetResponse, error)` +- New function `*LoadBalancersClient.NewListByManagedClusterPager(string, string, *LoadBalancersClientListByManagedClusterOptions) *runtime.Pager[LoadBalancersClientListByManagedClusterResponse]` +- New function `*ManagedClustersClient.BeginRebalanceLoadBalancers(context.Context, string, string, RebalanceLoadBalancersRequestBody, *ManagedClustersClientBeginRebalanceLoadBalancersOptions) (*runtime.Poller[ManagedClustersClientRebalanceLoadBalancersResponse], error)` +- New struct `AdvancedNetworking` +- New struct `AdvancedNetworkingObservability` +- New struct `AutoScaleProfile` +- New struct `Component` +- New struct `ComponentsByReleases` +- New struct `LabelSelector` +- New struct `LabelSelectorRequirement` +- New struct `LoadBalancer` +- New struct `LoadBalancerListResult` +- New struct `LoadBalancerProperties` +- New struct `RebalanceLoadBalancersRequestBody` +- New field `ComponentsByReleases` in struct `AgentPoolUpgradeProfileProperties` +- New field `UndrainableNodeBehavior` in struct `AgentPoolUpgradeSettings` +- New field `IfMatch`, `IfNoneMatch` in struct `AgentPoolsClientBeginCreateOrUpdateOptions` +- New field `IfMatch` in struct `AgentPoolsClientBeginDeleteOptions` +- New field `ETag` in struct `ManagedCluster` +- New field `ETag` in struct `ManagedClusterAgentPoolProfile` +- New field `ETag` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `ComponentsByReleases` in struct `ManagedClusterPoolUpgradeProfile` +- New field `IfMatch`, `IfNoneMatch` in struct `ManagedClustersClientBeginCreateOrUpdateOptions` +- New field `IfMatch` in struct `ManagedClustersClientBeginDeleteOptions` +- New field `IfMatch` in struct `ManagedClustersClientBeginUpdateTagsOptions` +- New field `AdvancedNetworking`, `PodLinkLocalAccess` in struct `NetworkProfile` +- New field `Autoscale` in struct `ScaleProfile` + + ## 5.1.0-beta.1 (2024-04-26) ### Features Added diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go index 4ca4c3d00ddb..a35a8c967fd6 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go @@ -49,7 +49,7 @@ func NewAgentPoolsClient(subscriptionID string, credential azcore.TokenCredentia // before cancellation can take place, an error is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -78,7 +78,7 @@ func (client *AgentPoolsClient) BeginAbortLatestOperation(ctx context.Context, r // before cancellation can take place, an error is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview 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" @@ -124,7 +124,7 @@ func (client *AgentPoolsClient) abortLatestOperationCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -133,7 +133,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -160,7 +160,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview 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" @@ -206,9 +206,15 @@ func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + if options != nil && options.IfNoneMatch != nil { + req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} + } if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -218,7 +224,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -243,7 +249,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview 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" @@ -289,19 +295,22 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") if options != nil && options.IgnorePodDisruptionBudget != nil { reqQP.Set("ignore-pod-disruption-budget", strconv.FormatBool(*options.IgnorePodDisruptionBudget)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } return req, nil } // BeginDeleteMachines - Deletes specific machines in an agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -328,7 +337,7 @@ func (client *AgentPoolsClient) BeginDeleteMachines(ctx context.Context, resourc // DeleteMachines - Deletes specific machines in an agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview func (client *AgentPoolsClient) deleteMachines(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, machines AgentPoolDeleteMachinesParameter, options *AgentPoolsClientBeginDeleteMachinesOptions) (*http.Response, error) { var err error const operationName = "AgentPoolsClient.BeginDeleteMachines" @@ -374,7 +383,7 @@ func (client *AgentPoolsClient) deleteMachinesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, machines); err != nil { @@ -386,7 +395,7 @@ func (client *AgentPoolsClient) deleteMachinesCreateRequest(ctx context.Context, // Get - Gets the specified managed cluster agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -437,7 +446,7 @@ func (client *AgentPoolsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -456,7 +465,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -503,7 +512,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -521,7 +530,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -573,7 +582,7 @@ func (client *AgentPoolsClient) getUpgradeProfileCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -590,7 +599,7 @@ func (client *AgentPoolsClient) getUpgradeProfileHandleResponse(resp *http.Respo // NewListPager - Gets a list of agent pools in the specified managed cluster. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -637,7 +646,7 @@ func (client *AgentPoolsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -657,7 +666,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -686,7 +695,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview 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" @@ -732,7 +741,7 @@ func (client *AgentPoolsClient) upgradeNodeImageVersionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") 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 deleted file mode 100644 index 739e10a8092b..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go +++ /dev/null @@ -1,1561 +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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsAbortOperation.json -func ExampleAgentPoolsClient_BeginAbortLatestOperation() { - 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().BeginAbortLatestOperation(ctx, "rg1", "clustername1", "agentpool1", 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsList.json -func ExampleAgentPoolsClient_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.NewAgentPoolsClient().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.AgentPoolListResult = armcontainerservice.AgentPoolListResult{ - // Value: []*armcontainerservice.AgentPool{ - // { - // Name: to.Ptr("agentpool1"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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), - // 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsGet.json -func ExampleAgentPoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAgentPoolsClient().Get(ctx, "rg1", "clustername1", "agentpool1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AgentPool = armcontainerservice.AgentPool{ - // Name: to.Ptr("agentpool1"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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), - // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // UpgradeSettings: &armcontainerservice.AgentPoolUpgradeSettings{ - // MaxSurge: to.Ptr("33%"), - // }, - // VMSize: to.Ptr("Standard_DS1_v2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_Snapshot.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolUsingAnAgentPoolSnapshot() { - 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), - CreationData: &armcontainerservice.CreationData{ - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), - }, - EnableFIPS: 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), - // }, - // CurrentOrchestratorVersion: to.Ptr("1.19.6"), - // EnableFIPS: 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_DedicatedHostGroup.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithDedicatedHostGroup() { - 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), - HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"), - 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"), - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_EnableEncryptionAtHost.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEncryptionAtHostEnabled() { - 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), - EnableEncryptionAtHost: 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.17.13"), - // EnableEncryptionAtHost: to.Ptr(true), - // MaxPods: to.Ptr[int32](110), - // OrchestratorVersion: to.Ptr("1.17.13"), - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_Ephemeral.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEphemeralOsDisk() { - 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), - OrchestratorVersion: to.Ptr(""), - OSDiskSizeGB: to.Ptr[int32](64), - OSDiskType: to.Ptr(armcontainerservice.OSDiskTypeEphemeral), - 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/00000000-0000-0000-0000-000000000000/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), - // OrchestratorVersion: to.Ptr("1.17.8"), - // OSDiskSizeGB: to.Ptr[int32](64), - // OSDiskType: to.Ptr(armcontainerservice.OSDiskTypeEphemeral), - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_EnableFIPS.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithFipsEnabledOs() { - 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), - EnableFIPS: 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.19.6"), - // EnableFIPS: 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_GPUMIG.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithGpumig() { - 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), - GpuInstanceProfile: to.Ptr(armcontainerservice.GPUInstanceProfileMIG2G), - KubeletConfig: &armcontainerservice.KubeletConfig{ - AllowedUnsafeSysctls: []*string{ - to.Ptr("kernel.msg*"), - to.Ptr("net.core.somaxconn")}, - CPUCfsQuota: to.Ptr(true), - CPUCfsQuotaPeriod: to.Ptr("200ms"), - CPUManagerPolicy: to.Ptr("static"), - FailSwapOn: to.Ptr(false), - ImageGcHighThreshold: to.Ptr[int32](90), - ImageGcLowThreshold: to.Ptr[int32](70), - TopologyManagerPolicy: to.Ptr("best-effort"), - }, - LinuxOSConfig: &armcontainerservice.LinuxOSConfig{ - SwapFileSizeMB: to.Ptr[int32](1500), - Sysctls: &armcontainerservice.SysctlConfig{ - KernelThreadsMax: to.Ptr[int32](99999), - NetCoreWmemDefault: to.Ptr[int32](12345), - NetIPv4IPLocalPortRange: to.Ptr("20000 60000"), - NetIPv4TCPTwReuse: to.Ptr(true), - }, - TransparentHugePageDefrag: to.Ptr("madvise"), - TransparentHugePageEnabled: to.Ptr("always"), - }, - OrchestratorVersion: to.Ptr(""), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_ND96asr_v4"), - }, - }, 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.17.8"), - // GpuInstanceProfile: to.Ptr(armcontainerservice.GPUInstanceProfileMIG2G), - // KubeletConfig: &armcontainerservice.KubeletConfig{ - // AllowedUnsafeSysctls: []*string{ - // to.Ptr("kernel.msg*"), - // to.Ptr("net.core.somaxconn")}, - // CPUCfsQuota: to.Ptr(true), - // CPUCfsQuotaPeriod: to.Ptr("200ms"), - // CPUManagerPolicy: to.Ptr("static"), - // FailSwapOn: to.Ptr(false), - // ImageGcHighThreshold: to.Ptr[int32](90), - // ImageGcLowThreshold: to.Ptr[int32](70), - // TopologyManagerPolicy: to.Ptr("best-effort"), - // }, - // LinuxOSConfig: &armcontainerservice.LinuxOSConfig{ - // SwapFileSizeMB: to.Ptr[int32](1500), - // Sysctls: &armcontainerservice.SysctlConfig{ - // KernelThreadsMax: to.Ptr[int32](99999), - // NetCoreWmemDefault: to.Ptr[int32](12345), - // NetIPv4IPLocalPortRange: to.Ptr("20000 60000"), - // NetIPv4TCPTwReuse: to.Ptr(true), - // }, - // TransparentHugePageDefrag: to.Ptr("madvise"), - // TransparentHugePageEnabled: to.Ptr("always"), - // }, - // MaxPods: to.Ptr[int32](110), - // OrchestratorVersion: to.Ptr("1.17.8"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // VMSize: to.Ptr("Standard_ND96asr_v4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_WasmWasi.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKrustletAndTheWasiRuntime() { - 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), - Mode: to.Ptr(armcontainerservice.AgentPoolModeUser), - OrchestratorVersion: to.Ptr(""), - OSDiskSizeGB: to.Ptr[int32](64), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - WorkloadRuntime: to.Ptr(armcontainerservice.WorkloadRuntimeWasmWasi), - }, - }, 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/00000000-0000-0000-0000-000000000000/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), - // 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"), - // WorkloadRuntime: to.Ptr(armcontainerservice.WorkloadRuntimeWasmWasi), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_CustomNodeConfig.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKubeletConfigAndLinuxOsConfig() { - 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), - KubeletConfig: &armcontainerservice.KubeletConfig{ - AllowedUnsafeSysctls: []*string{ - to.Ptr("kernel.msg*"), - to.Ptr("net.core.somaxconn")}, - CPUCfsQuota: to.Ptr(true), - CPUCfsQuotaPeriod: to.Ptr("200ms"), - CPUManagerPolicy: to.Ptr("static"), - FailSwapOn: to.Ptr(false), - ImageGcHighThreshold: to.Ptr[int32](90), - ImageGcLowThreshold: to.Ptr[int32](70), - TopologyManagerPolicy: to.Ptr("best-effort"), - }, - LinuxOSConfig: &armcontainerservice.LinuxOSConfig{ - SwapFileSizeMB: to.Ptr[int32](1500), - Sysctls: &armcontainerservice.SysctlConfig{ - KernelThreadsMax: to.Ptr[int32](99999), - NetCoreWmemDefault: to.Ptr[int32](12345), - NetIPv4IPLocalPortRange: to.Ptr("20000 60000"), - NetIPv4TCPTwReuse: to.Ptr(true), - }, - TransparentHugePageDefrag: to.Ptr("madvise"), - TransparentHugePageEnabled: to.Ptr("always"), - }, - 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.17.8"), - // KubeletConfig: &armcontainerservice.KubeletConfig{ - // AllowedUnsafeSysctls: []*string{ - // to.Ptr("kernel.msg*"), - // to.Ptr("net.core.somaxconn")}, - // CPUCfsQuota: to.Ptr(true), - // CPUCfsQuotaPeriod: to.Ptr("200ms"), - // CPUManagerPolicy: to.Ptr("static"), - // FailSwapOn: to.Ptr(false), - // ImageGcHighThreshold: to.Ptr[int32](90), - // ImageGcLowThreshold: to.Ptr[int32](70), - // TopologyManagerPolicy: to.Ptr("best-effort"), - // }, - // LinuxOSConfig: &armcontainerservice.LinuxOSConfig{ - // SwapFileSizeMB: to.Ptr[int32](1500), - // Sysctls: &armcontainerservice.SysctlConfig{ - // KernelThreadsMax: to.Ptr[int32](99999), - // NetCoreWmemDefault: to.Ptr[int32](12345), - // NetIPv4IPLocalPortRange: to.Ptr("20000 60000"), - // NetIPv4TCPTwReuse: to.Ptr(true), - // }, - // TransparentHugePageDefrag: to.Ptr("madvise"), - // TransparentHugePageEnabled: to.Ptr("always"), - // }, - // MaxPods: to.Ptr[int32](110), - // OrchestratorVersion: to.Ptr("1.17.8"), - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_OSSKU.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithOssku() { - 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), - KubeletConfig: &armcontainerservice.KubeletConfig{ - AllowedUnsafeSysctls: []*string{ - to.Ptr("kernel.msg*"), - to.Ptr("net.core.somaxconn")}, - CPUCfsQuota: to.Ptr(true), - CPUCfsQuotaPeriod: to.Ptr("200ms"), - CPUManagerPolicy: to.Ptr("static"), - FailSwapOn: to.Ptr(false), - ImageGcHighThreshold: to.Ptr[int32](90), - ImageGcLowThreshold: to.Ptr[int32](70), - TopologyManagerPolicy: to.Ptr("best-effort"), - }, - LinuxOSConfig: &armcontainerservice.LinuxOSConfig{ - SwapFileSizeMB: to.Ptr[int32](1500), - Sysctls: &armcontainerservice.SysctlConfig{ - KernelThreadsMax: to.Ptr[int32](99999), - NetCoreWmemDefault: to.Ptr[int32](12345), - NetIPv4IPLocalPortRange: to.Ptr("20000 60000"), - NetIPv4TCPTwReuse: to.Ptr(true), - }, - TransparentHugePageDefrag: to.Ptr("madvise"), - TransparentHugePageEnabled: to.Ptr("always"), - }, - OrchestratorVersion: to.Ptr(""), - OSSKU: to.Ptr(armcontainerservice.OSSKUAzureLinux), - 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.17.8"), - // KubeletConfig: &armcontainerservice.KubeletConfig{ - // AllowedUnsafeSysctls: []*string{ - // to.Ptr("kernel.msg*"), - // to.Ptr("net.core.somaxconn")}, - // CPUCfsQuota: to.Ptr(true), - // CPUCfsQuotaPeriod: to.Ptr("200ms"), - // CPUManagerPolicy: to.Ptr("static"), - // FailSwapOn: to.Ptr(false), - // ImageGcHighThreshold: to.Ptr[int32](90), - // ImageGcLowThreshold: to.Ptr[int32](70), - // TopologyManagerPolicy: to.Ptr("best-effort"), - // }, - // LinuxOSConfig: &armcontainerservice.LinuxOSConfig{ - // SwapFileSizeMB: to.Ptr[int32](1500), - // Sysctls: &armcontainerservice.SysctlConfig{ - // KernelThreadsMax: to.Ptr[int32](99999), - // NetCoreWmemDefault: to.Ptr[int32](12345), - // NetIPv4IPLocalPortRange: to.Ptr("20000 60000"), - // NetIPv4TCPTwReuse: to.Ptr(true), - // }, - // TransparentHugePageDefrag: to.Ptr("madvise"), - // TransparentHugePageEnabled: to.Ptr("always"), - // }, - // MaxPods: to.Ptr[int32](110), - // OrchestratorVersion: to.Ptr("1.17.8"), - // OSSKU: to.Ptr(armcontainerservice.OSSKUAzureLinux), - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_PPG.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithPpg() { - 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), - OrchestratorVersion: to.Ptr(""), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - ProximityPlacementGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), - 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/00000000-0000-0000-0000-000000000000/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), - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), - // VMSize: to.Ptr("Standard_DS2_v2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_EnableUltraSSD.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithUltraSsdEnabled() { - 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), - EnableUltraSSD: 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.17.13"), - // EnableUltraSSD: to.Ptr(true), - // MaxPods: to.Ptr[int32](110), - // OrchestratorVersion: to.Ptr("1.17.13"), - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_TypeVirtualMachines.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithVirtualMachinesPoolType() { - 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{ - Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachines), - NodeLabels: map[string]*string{ - "key1": to.Ptr("val1"), - }, - NodeTaints: []*string{ - to.Ptr("Key1=Value1:NoSchedule")}, - OrchestratorVersion: to.Ptr("1.9.6"), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - Tags: map[string]*string{ - "name1": to.Ptr("val1"), - }, - VirtualMachinesProfile: &armcontainerservice.VirtualMachinesProfile{ - Scale: &armcontainerservice.ScaleProfile{ - Manual: []*armcontainerservice.ManualScaleProfile{ - { - Count: to.Ptr[int32](5), - Sizes: []*string{ - to.Ptr("Standard_D2_v2"), - to.Ptr("Standard_D2_v3")}, - }}, - }, - }, - }, - }, 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachines), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), - // MaxPods: to.Ptr[int32](110), - // NodeImageVersion: to.Ptr("AKSUbuntu-1804gen2containerd-2021.09.11"), - // NodeLabels: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // NodeTaints: []*string{ - // to.Ptr("Key1=Value1:NoSchedule")}, - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // Tags: map[string]*string{ - // "name1": to.Ptr("val1"), - // }, - // VirtualMachineNodesStatus: []*armcontainerservice.VirtualMachineNodes{ - // { - // Count: to.Ptr[int32](3), - // Size: to.Ptr("Standard_D2_v2"), - // }, - // { - // Count: to.Ptr[int32](2), - // Size: to.Ptr("Standard_D2_v3"), - // }}, - // VirtualMachinesProfile: &armcontainerservice.VirtualMachinesProfile{ - // Scale: &armcontainerservice.ScaleProfile{ - // Manual: []*armcontainerservice.ManualScaleProfile{ - // { - // Count: to.Ptr[int32](5), - // Sizes: []*string{ - // to.Ptr("Standard_D2_v2"), - // to.Ptr("Standard_D2_v3")}, - // }}, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_WindowsOSSKU.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithWindowsOssku() { - 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.3"), - OSSKU: to.Ptr(armcontainerservice.OSSKUWindows2022), - OSType: to.Ptr(armcontainerservice.OSTypeWindows), - VMSize: to.Ptr("Standard_D4s_v3"), - }, - }, 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/wnp2"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.23.3"), - // MaxPods: to.Ptr[int32](110), - // OrchestratorVersion: to.Ptr("1.23.3"), - // OSSKU: to.Ptr(armcontainerservice.OSSKUWindows2022), - // OSType: to.Ptr(armcontainerservice.OSTypeWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // VMSize: to.Ptr("Standard_D4s_v3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_Spot.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createSpotAgentPool() { - 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), - NodeLabels: map[string]*string{ - "key1": to.Ptr("val1"), - }, - NodeTaints: []*string{ - to.Ptr("Key1=Value1:NoSchedule")}, - OrchestratorVersion: to.Ptr(""), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete), - ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot), - Tags: map[string]*string{ - "name1": to.Ptr("val1"), - }, - VMSize: to.Ptr("Standard_DS1_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/00000000-0000-0000-0000-000000000000/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), - // NodeLabels: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // NodeTaints: []*string{ - // to.Ptr("Key1=Value1:NoSchedule")}, - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete), - // ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot), - // SpotMaxPrice: to.Ptr[float32](-1), - // Tags: map[string]*string{ - // "name1": to.Ptr("val1"), - // }, - // VMSize: to.Ptr("Standard_DS1_v2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsCreate_Update.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createUpdateAgentPool() { - 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), - Mode: to.Ptr(armcontainerservice.AgentPoolModeUser), - NodeLabels: map[string]*string{ - "key1": to.Ptr("val1"), - }, - NodeTaints: []*string{ - to.Ptr("Key1=Value1:NoSchedule")}, - OrchestratorVersion: to.Ptr(""), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete), - ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot), - Tags: map[string]*string{ - "name1": to.Ptr("val1"), - }, - VMSize: to.Ptr("Standard_DS1_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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // MaxPods: to.Ptr[int32](110), - // Mode: to.Ptr(armcontainerservice.AgentPoolModeUser), - // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), - // NodeLabels: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // NodeTaints: []*string{ - // to.Ptr("Key1=Value1:NoSchedule")}, - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete), - // ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot), - // Tags: map[string]*string{ - // "name1": to.Ptr("val1"), - // }, - // VMSize: to.Ptr("Standard_DS1_v2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPools_Start.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_startAgentPool() { - 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{ - PowerState: &armcontainerservice.PowerState{ - Code: to.Ptr(armcontainerservice.CodeRunning), - }, - }, - }, 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](50), - // EnableAutoScaling: to.Ptr(true), - // MaxCount: to.Ptr[int32](55), - // MinCount: to.Ptr[int32](3), - // PowerState: &armcontainerservice.PowerState{ - // Code: to.Ptr(armcontainerservice.CodeRunning), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPools_Stop.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_stopAgentPool() { - 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{ - PowerState: &armcontainerservice.PowerState{ - Code: to.Ptr(armcontainerservice.CodeStopped), - }, - }, - }, 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](0), - // EnableAutoScaling: to.Ptr(false), - // PowerState: &armcontainerservice.PowerState{ - // Code: to.Ptr(armcontainerservice.CodeStopped), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPools_Update.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_updateAgentPool() { - 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), - EnableAutoScaling: to.Ptr(true), - MaxCount: to.Ptr[int32](2), - MinCount: to.Ptr[int32](2), - NodeTaints: []*string{ - to.Ptr("Key1=Value1:NoSchedule")}, - OrchestratorVersion: to.Ptr(""), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete), - ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot), - VMSize: to.Ptr("Standard_DS1_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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), - // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), - // EnableAutoScaling: to.Ptr(true), - // MaxCount: to.Ptr[int32](2), - // MaxPods: to.Ptr[int32](110), - // MinCount: to.Ptr[int32](2), - // NodeTaints: []*string{ - // to.Ptr("Key1=Value1:NoSchedule")}, - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // ScaleSetEvictionPolicy: to.Ptr(armcontainerservice.ScaleSetEvictionPolicyDelete), - // ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot), - // VMSize: to.Ptr("Standard_DS1_v2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsDelete_IgnorePodDisruptionBudget.json -func ExampleAgentPoolsClient_BeginDelete_deleteAgentPoolByIgnoringPodDisruptionBudget() { - 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsGetUpgradeProfile.json -func ExampleAgentPoolsClient_GetUpgradeProfile() { - 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.NewAgentPoolsClient().GetUpgradeProfile(ctx, "rg1", "clustername1", "agentpool1", 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.AgentPoolUpgradeProfile = armcontainerservice.AgentPoolUpgradeProfile{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools/upgradeProfiles"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1/upgradeprofiles/default"), - // Properties: &armcontainerservice.AgentPoolUpgradeProfileProperties{ - // KubernetesVersion: to.Ptr("1.12.8"), - // LatestNodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // Upgrades: []*armcontainerservice.AgentPoolUpgradeProfilePropertiesUpgradesItem{ - // { - // KubernetesVersion: to.Ptr("1.13.5"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsDeleteMachines.json -func ExampleAgentPoolsClient_BeginDeleteMachines() { - 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().BeginDeleteMachines(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPoolDeleteMachinesParameter{ - MachineNames: []*string{ - to.Ptr("aks-nodepool1-42263519-vmss00000a"), - to.Ptr("aks-nodepool1-42263519-vmss00000b")}, - }, 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json -func ExampleAgentPoolsClient_GetAvailableAgentPoolVersions() { - 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.NewAgentPoolsClient().GetAvailableAgentPoolVersions(ctx, "rg1", "clustername1", 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.AgentPoolAvailableVersions = armcontainerservice.AgentPoolAvailableVersions{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/availableAgentpoolVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/availableagentpoolversions"), - // Properties: &armcontainerservice.AgentPoolAvailableVersionsProperties{ - // AgentPoolVersions: []*armcontainerservice.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem{ - // { - // KubernetesVersion: to.Ptr("1.12.7"), - // }, - // { - // KubernetesVersion: to.Ptr("1.12.8"), - // }, - // { - // Default: to.Ptr(true), - // IsPreview: to.Ptr(true), - // KubernetesVersion: to.Ptr("1.13.5"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json -func ExampleAgentPoolsClient_BeginUpgradeNodeImageVersion() { - 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().BeginUpgradeNodeImageVersion(ctx, "rg1", "clustername1", "agentpool1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md b/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md index 308173319641..37472c62964b 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md +++ b/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 5.1.0-beta.1 -tag: package-preview-2024-02 +module-version: 5.1.0-beta.2 ``` diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go b/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go index a53dc8828f4f..e0587c7689ac 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go @@ -44,6 +44,14 @@ func (c *ClientFactory) NewAgentPoolsClient() *AgentPoolsClient { } } +// NewLoadBalancersClient creates a new instance of LoadBalancersClient. +func (c *ClientFactory) NewLoadBalancersClient() *LoadBalancersClient { + return &LoadBalancersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewMachinesClient creates a new instance of MachinesClient. func (c *ClientFactory) NewMachinesClient() *MachinesClient { return &MachinesClient{ diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/constants.go b/sdk/resourcemanager/containerservice/armcontainerservice/constants.go index fc161cddf769..291b1da01f81 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/constants.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/constants.go @@ -10,7 +10,7 @@ package armcontainerservice const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice" - moduleVersion = "v5.1.0-beta.1" + moduleVersion = "v5.1.0-beta.2" ) // AddonAutoscaling - Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. @@ -508,6 +508,10 @@ func PossibleManagedClusterPodIdentityProvisioningStateValues() []ManagedCluster type ManagedClusterSKUName string const ( + // ManagedClusterSKUNameAutomatic - Automatic clusters are optimized to run most production workloads with configuration that + // follows AKS best practices and recommendations for cluster and workload setup, scalability, and security. For more details + // about Automatic clusters see aka.ms/aks/automatic. + ManagedClusterSKUNameAutomatic ManagedClusterSKUName = "Automatic" // ManagedClusterSKUNameBase - Base option for the AKS control plane. ManagedClusterSKUNameBase ManagedClusterSKUName = "Base" ) @@ -515,6 +519,7 @@ const ( // PossibleManagedClusterSKUNameValues returns the possible values for the ManagedClusterSKUName const type. func PossibleManagedClusterSKUNameValues() []ManagedClusterSKUName { return []ManagedClusterSKUName{ + ManagedClusterSKUNameAutomatic, ManagedClusterSKUNameBase, } } @@ -803,6 +808,30 @@ func PossibleOSTypeValues() []OSType { } } +// Operator - operator represents a key's relationship to a set of values. Valid operators are In and NotIn +type Operator string + +const ( + // OperatorDoesNotExist - The value of the key should not exist. + OperatorDoesNotExist Operator = "DoesNotExist" + // OperatorExists - The value of the key should exist. + OperatorExists Operator = "Exists" + // OperatorIn - The value of the key should be in the given list. + OperatorIn Operator = "In" + // OperatorNotIn - The value of the key should not be in the given list. + OperatorNotIn Operator = "NotIn" +) + +// PossibleOperatorValues returns the possible values for the Operator const type. +func PossibleOperatorValues() []Operator { + return []Operator{ + OperatorDoesNotExist, + OperatorExists, + OperatorIn, + OperatorNotIn, + } +} + // OutboundType - This can only be set at cluster creation time and cannot be changed later. For more information see egress // outbound type [https://docs.microsoft.com/azure/aks/egress-outboundtype]. type OutboundType string @@ -813,6 +842,9 @@ const ( OutboundTypeLoadBalancer OutboundType = "loadBalancer" // OutboundTypeManagedNATGateway - The AKS-managed NAT gateway is used for egress. OutboundTypeManagedNATGateway OutboundType = "managedNATGateway" + // OutboundTypeNone - The AKS cluster is not set with any outbound-type. All AKS nodes follows Azure VM default outbound behavior. + // Please refer to https://azure.microsoft.com/en-us/updates/default-outbound-access-for-vms-in-azure-will-be-retired-transition-to-a-new-method-of-internet-access/ + OutboundTypeNone OutboundType = "none" // OutboundTypeUserAssignedNATGateway - The user-assigned NAT gateway associated to the cluster subnet is used for egress. // This is an advanced scenario and requires proper network configuration. OutboundTypeUserAssignedNATGateway OutboundType = "userAssignedNATGateway" @@ -826,6 +858,7 @@ func PossibleOutboundTypeValues() []OutboundType { return []OutboundType{ OutboundTypeLoadBalancer, OutboundTypeManagedNATGateway, + OutboundTypeNone, OutboundTypeUserAssignedNATGateway, OutboundTypeUserDefinedRouting, } @@ -855,6 +888,25 @@ func PossiblePodIPAllocationModeValues() []PodIPAllocationMode { } } +// PodLinkLocalAccess - Defines access to special link local addresses (Azure Instance Metadata Service, aka IMDS) for pods +// with hostNetwork=false. If not specified, the default is 'IMDS'. +type PodLinkLocalAccess string + +const ( + // PodLinkLocalAccessIMDS - Pods with hostNetwork=false can access Azure Instance Metadata Service (IMDS) without restriction. + PodLinkLocalAccessIMDS PodLinkLocalAccess = "IMDS" + // PodLinkLocalAccessNone - Pods with hostNetwork=false cannot access Azure Instance Metadata Service (IMDS). + PodLinkLocalAccessNone PodLinkLocalAccess = "None" +) + +// PossiblePodLinkLocalAccessValues returns the possible values for the PodLinkLocalAccess const type. +func PossiblePodLinkLocalAccessValues() []PodLinkLocalAccess { + return []PodLinkLocalAccess{ + PodLinkLocalAccessIMDS, + PodLinkLocalAccessNone, + } +} + // PrivateEndpointConnectionProvisioningState - The current provisioning state. type PrivateEndpointConnectionProvisioningState string @@ -1123,6 +1175,32 @@ func PossibleTypeValues() []Type { } } +// UndrainableNodeBehavior - Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable +// nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is +// exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. +type UndrainableNodeBehavior string + +const ( + // UndrainableNodeBehaviorCordon - AKS will cordon the blocked nodes and replace them with surge nodes during upgrade. The + // blocked nodes will be cordoned and replaced by surge nodes. The blocked nodes will have label 'kubernetes.azure.com/upgrade-status:Quarantined'. + // A surge node will be retained for each blocked node. A best-effort attempt will be made to delete all other surge nodes. + // If there are enough surge nodes to replace blocked nodes, then the upgrade operation and the managed cluster will be in + // failed state. Otherwise, the upgrade operation and the managed cluster will be in canceled state. + UndrainableNodeBehaviorCordon UndrainableNodeBehavior = "Cordon" + // UndrainableNodeBehaviorSchedule - AKS will mark the blocked nodes schedulable, but the blocked nodes are not upgraded. + // A best-effort attempt will be made to delete all surge nodes. The upgrade operation and the managed cluster will be in + // failed state if there are any blocked nodes. + UndrainableNodeBehaviorSchedule UndrainableNodeBehavior = "Schedule" +) + +// PossibleUndrainableNodeBehaviorValues returns the possible values for the UndrainableNodeBehavior const type. +func PossibleUndrainableNodeBehaviorValues() []UndrainableNodeBehavior { + return []UndrainableNodeBehavior{ + UndrainableNodeBehaviorCordon, + UndrainableNodeBehaviorSchedule, + } +} + // UpgradeChannel - For more information see setting the AKS cluster auto-upgrade channel [https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel]. type UpgradeChannel string diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/agentpools_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/agentpools_server.go index 9408c61c545a..5f6cd5e03e90 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/agentpools_server.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/agentpools_server.go @@ -206,7 +206,16 @@ func (a *AgentPoolsServerTransport) dispatchBeginCreateOrUpdate(req *http.Reques if err != nil { return nil, err } - respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, agentPoolNameParam, body, nil) + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + ifNoneMatchParam := getOptional(getHeaderValue(req.Header, "If-None-Match")) + var options *armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions + if ifMatchParam != nil || ifNoneMatchParam != nil { + options = &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{ + IfMatch: ifMatchParam, + IfNoneMatch: ifNoneMatchParam, + } + } + respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, agentPoolNameParam, body, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -263,10 +272,12 @@ func (a *AgentPoolsServerTransport) dispatchBeginDelete(req *http.Request) (*htt if err != nil { return nil, err } + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) var options *armcontainerservice.AgentPoolsClientBeginDeleteOptions - if ignorePodDisruptionBudgetParam != nil { + if ignorePodDisruptionBudgetParam != nil || ifMatchParam != nil { options = &armcontainerservice.AgentPoolsClientBeginDeleteOptions{ IgnorePodDisruptionBudget: ignorePodDisruptionBudgetParam, + IfMatch: ifMatchParam, } } respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, agentPoolNameParam, options) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/internal.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/internal.go index 7d2f89ba4bb2..c63abf57927c 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/internal.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/internal.go @@ -32,6 +32,14 @@ func contains[T comparable](s []T, v T) bool { return false } +func getHeaderValue(h http.Header, k string) string { + v := h[k] + if len(v) == 0 { + return "" + } + return v[0] +} + func getOptional[T any](v T) *T { if reflect.ValueOf(v).IsZero() { return nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/loadbalancers_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/loadbalancers_server.go new file mode 100644 index 000000000000..fe34fcc0a91a --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/loadbalancers_server.go @@ -0,0 +1,259 @@ +//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/v5" + "net/http" + "net/url" + "regexp" +) + +// LoadBalancersServer is a fake server for instances of the armcontainerservice.LoadBalancersClient type. +type LoadBalancersServer struct { + // CreateOrUpdate is the fake for method LoadBalancersClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, parameters armcontainerservice.LoadBalancer, options *armcontainerservice.LoadBalancersClientCreateOrUpdateOptions) (resp azfake.Responder[armcontainerservice.LoadBalancersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method LoadBalancersClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *armcontainerservice.LoadBalancersClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerservice.LoadBalancersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method LoadBalancersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *armcontainerservice.LoadBalancersClientGetOptions) (resp azfake.Responder[armcontainerservice.LoadBalancersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByManagedClusterPager is the fake for method LoadBalancersClient.NewListByManagedClusterPager + // HTTP status codes to indicate success: http.StatusOK + NewListByManagedClusterPager func(resourceGroupName string, resourceName string, options *armcontainerservice.LoadBalancersClientListByManagedClusterOptions) (resp azfake.PagerResponder[armcontainerservice.LoadBalancersClientListByManagedClusterResponse]) +} + +// NewLoadBalancersServerTransport creates a new instance of LoadBalancersServerTransport with the provided implementation. +// The returned LoadBalancersServerTransport instance is connected to an instance of armcontainerservice.LoadBalancersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewLoadBalancersServerTransport(srv *LoadBalancersServer) *LoadBalancersServerTransport { + return &LoadBalancersServerTransport{ + srv: srv, + beginDelete: newTracker[azfake.PollerResponder[armcontainerservice.LoadBalancersClientDeleteResponse]](), + newListByManagedClusterPager: newTracker[azfake.PagerResponder[armcontainerservice.LoadBalancersClientListByManagedClusterResponse]](), + } +} + +// LoadBalancersServerTransport connects instances of armcontainerservice.LoadBalancersClient to instances of LoadBalancersServer. +// Don't use this type directly, use NewLoadBalancersServerTransport instead. +type LoadBalancersServerTransport struct { + srv *LoadBalancersServer + beginDelete *tracker[azfake.PollerResponder[armcontainerservice.LoadBalancersClientDeleteResponse]] + newListByManagedClusterPager *tracker[azfake.PagerResponder[armcontainerservice.LoadBalancersClientListByManagedClusterResponse]] +} + +// Do implements the policy.Transporter interface for LoadBalancersServerTransport. +func (l *LoadBalancersServerTransport) 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 "LoadBalancersClient.CreateOrUpdate": + resp, err = l.dispatchCreateOrUpdate(req) + case "LoadBalancersClient.BeginDelete": + resp, err = l.dispatchBeginDelete(req) + case "LoadBalancersClient.Get": + resp, err = l.dispatchGet(req) + case "LoadBalancersClient.NewListByManagedClusterPager": + resp, err = l.dispatchNewListByManagedClusterPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (l *LoadBalancersServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if l.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~%@]+)/loadBalancers/(?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.LoadBalancer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + loadBalancerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("loadBalancerName")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, loadBalancerNameParam, 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).LoadBalancer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (l *LoadBalancersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if l.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := l.beginDelete.get(req) + if 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~%@]+)/loadBalancers/(?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) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + loadBalancerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("loadBalancerName")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, loadBalancerNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + l.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + l.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + l.beginDelete.remove(req) + } + + return resp, nil +} + +func (l *LoadBalancersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if l.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~%@]+)/loadBalancers/(?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) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + loadBalancerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("loadBalancerName")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, loadBalancerNameParam, 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).LoadBalancer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (l *LoadBalancersServerTransport) dispatchNewListByManagedClusterPager(req *http.Request) (*http.Response, error) { + if l.srv.NewListByManagedClusterPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByManagedClusterPager not implemented")} + } + newListByManagedClusterPager := l.newListByManagedClusterPager.get(req) + if 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~%@]+)/loadBalancers` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + resp := l.srv.NewListByManagedClusterPager(resourceGroupNameParam, resourceNameParam, nil) + newListByManagedClusterPager = &resp + l.newListByManagedClusterPager.add(req, newListByManagedClusterPager) + server.PagerResponderInjectNextLinks(newListByManagedClusterPager, req, func(page *armcontainerservice.LoadBalancersClientListByManagedClusterResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByManagedClusterPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + l.newListByManagedClusterPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByManagedClusterPager) { + l.newListByManagedClusterPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclusters_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclusters_server.go index 43dc13cbbbd2..05ab04824db3 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclusters_server.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclusters_server.go @@ -117,6 +117,10 @@ type ManagedClustersServer struct { // HTTP status codes to indicate success: http.StatusOK NewListSafeguardsVersionsPager func(location string, options *armcontainerservice.ManagedClustersClientListSafeguardsVersionsOptions) (resp azfake.PagerResponder[armcontainerservice.ManagedClustersClientListSafeguardsVersionsResponse]) + // BeginRebalanceLoadBalancers is the fake for method ManagedClustersClient.BeginRebalanceLoadBalancers + // HTTP status codes to indicate success: http.StatusAccepted + BeginRebalanceLoadBalancers func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.RebalanceLoadBalancersRequestBody, options *armcontainerservice.ManagedClustersClientBeginRebalanceLoadBalancersOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientRebalanceLoadBalancersResponse], errResp azfake.ErrorResponder) + // 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) @@ -166,6 +170,7 @@ func NewManagedClustersServerTransport(srv *ManagedClustersServer) *ManagedClust newListMeshUpgradeProfilesPager: newTracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListMeshUpgradeProfilesResponse]](), newListOutboundNetworkDependenciesEndpointsPager: newTracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse]](), newListSafeguardsVersionsPager: newTracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListSafeguardsVersionsResponse]](), + beginRebalanceLoadBalancers: newTracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientRebalanceLoadBalancersResponse]](), beginResetAADProfile: newTracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetAADProfileResponse]](), beginResetServicePrincipalProfile: newTracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetServicePrincipalProfileResponse]](), beginRotateClusterCertificates: newTracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientRotateClusterCertificatesResponse]](), @@ -191,6 +196,7 @@ type ManagedClustersServerTransport struct { newListMeshUpgradeProfilesPager *tracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListMeshUpgradeProfilesResponse]] newListOutboundNetworkDependenciesEndpointsPager *tracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse]] newListSafeguardsVersionsPager *tracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListSafeguardsVersionsResponse]] + beginRebalanceLoadBalancers *tracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientRebalanceLoadBalancersResponse]] beginResetAADProfile *tracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetAADProfileResponse]] beginResetServicePrincipalProfile *tracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetServicePrincipalProfileResponse]] beginRotateClusterCertificates *tracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientRotateClusterCertificatesResponse]] @@ -259,6 +265,8 @@ func (m *ManagedClustersServerTransport) Do(req *http.Request) (*http.Response, resp, err = m.dispatchNewListOutboundNetworkDependenciesEndpointsPager(req) case "ManagedClustersClient.NewListSafeguardsVersionsPager": resp, err = m.dispatchNewListSafeguardsVersionsPager(req) + case "ManagedClustersClient.BeginRebalanceLoadBalancers": + resp, err = m.dispatchBeginRebalanceLoadBalancers(req) case "ManagedClustersClient.BeginResetAADProfile": resp, err = m.dispatchBeginResetAADProfile(req) case "ManagedClustersClient.BeginResetServicePrincipalProfile": @@ -354,7 +362,16 @@ func (m *ManagedClustersServerTransport) dispatchBeginCreateOrUpdate(req *http.R if err != nil { return nil, err } - respr, errRespr := m.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, body, nil) + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + ifNoneMatchParam := getOptional(getHeaderValue(req.Header, "If-None-Match")) + var options *armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions + if ifMatchParam != nil || ifNoneMatchParam != nil { + options = &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{ + IfMatch: ifMatchParam, + IfNoneMatch: ifNoneMatchParam, + } + } + respr, errRespr := m.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, body, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -407,10 +424,12 @@ func (m *ManagedClustersServerTransport) dispatchBeginDelete(req *http.Request) if err != nil { return nil, err } + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) var options *armcontainerservice.ManagedClustersClientBeginDeleteOptions - if ignorePodDisruptionBudgetParam != nil { + if ignorePodDisruptionBudgetParam != nil || ifMatchParam != nil { options = &armcontainerservice.ManagedClustersClientBeginDeleteOptions{ IgnorePodDisruptionBudget: ignorePodDisruptionBudgetParam, + IfMatch: ifMatchParam, } } respr, errRespr := m.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, options) @@ -1190,6 +1209,54 @@ func (m *ManagedClustersServerTransport) dispatchNewListSafeguardsVersionsPager( return resp, nil } +func (m *ManagedClustersServerTransport) dispatchBeginRebalanceLoadBalancers(req *http.Request) (*http.Response, error) { + if m.srv.BeginRebalanceLoadBalancers == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginRebalanceLoadBalancers not implemented")} + } + beginRebalanceLoadBalancers := m.beginRebalanceLoadBalancers.get(req) + if beginRebalanceLoadBalancers == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rebalanceLoadBalancers` + 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.RebalanceLoadBalancersRequestBody](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginRebalanceLoadBalancers(req.Context(), resourceGroupNameParam, resourceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginRebalanceLoadBalancers = &respr + m.beginRebalanceLoadBalancers.add(req, beginRebalanceLoadBalancers) + } + + resp, err := server.PollerResponderNext(beginRebalanceLoadBalancers, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + m.beginRebalanceLoadBalancers.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginRebalanceLoadBalancers) { + m.beginRebalanceLoadBalancers.remove(req) + } + + 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")} @@ -1534,7 +1601,14 @@ func (m *ManagedClustersServerTransport) dispatchBeginUpdateTags(req *http.Reque if err != nil { return nil, err } - respr, errRespr := m.srv.BeginUpdateTags(req.Context(), resourceGroupNameParam, resourceNameParam, body, nil) + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + var options *armcontainerservice.ManagedClustersClientBeginUpdateTagsOptions + if ifMatchParam != nil { + options = &armcontainerservice.ManagedClustersClientBeginUpdateTagsOptions{ + IfMatch: ifMatchParam, + } + } + respr, errRespr := m.srv.BeginUpdateTags(req.Context(), resourceGroupNameParam, resourceNameParam, body, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/server_factory.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/server_factory.go index 526a1e4c5eaa..dfd3348a713a 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/server_factory.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/server_factory.go @@ -20,6 +20,7 @@ import ( // ServerFactory is a fake server for instances of the armcontainerservice.ClientFactory type. type ServerFactory struct { AgentPoolsServer AgentPoolsServer + LoadBalancersServer LoadBalancersServer MachinesServer MachinesServer MaintenanceConfigurationsServer MaintenanceConfigurationsServer ManagedClusterSnapshotsServer ManagedClusterSnapshotsServer @@ -49,6 +50,7 @@ type ServerFactoryTransport struct { srv *ServerFactory trMu sync.Mutex trAgentPoolsServer *AgentPoolsServerTransport + trLoadBalancersServer *LoadBalancersServerTransport trMachinesServer *MachinesServerTransport trMaintenanceConfigurationsServer *MaintenanceConfigurationsServerTransport trManagedClusterSnapshotsServer *ManagedClusterSnapshotsServerTransport @@ -79,6 +81,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "AgentPoolsClient": initServer(s, &s.trAgentPoolsServer, func() *AgentPoolsServerTransport { return NewAgentPoolsServerTransport(&s.srv.AgentPoolsServer) }) resp, err = s.trAgentPoolsServer.Do(req) + case "LoadBalancersClient": + initServer(s, &s.trLoadBalancersServer, func() *LoadBalancersServerTransport { + return NewLoadBalancersServerTransport(&s.srv.LoadBalancersServer) + }) + resp, err = s.trLoadBalancersServer.Do(req) case "MachinesClient": initServer(s, &s.trMachinesServer, func() *MachinesServerTransport { return NewMachinesServerTransport(&s.srv.MachinesServer) }) resp, err = s.trMachinesServer.Do(req) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/go.mod b/sdk/resourcemanager/containerservice/armcontainerservice/go.mod index 267e5bb1911a..582b1b47f838 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/go.mod +++ b/sdk/resourcemanager/containerservice/armcontainerservice/go.mod @@ -4,13 +4,13 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 github.com/stretchr/testify v1.9.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/loadbalancers_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/loadbalancers_client.go new file mode 100644 index 000000000000..bdc616d2edde --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/loadbalancers_client.go @@ -0,0 +1,333 @@ +//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" +) + +// LoadBalancersClient contains the methods for the LoadBalancers group. +// Don't use this type directly, use NewLoadBalancersClient() instead. +type LoadBalancersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLoadBalancersClient creates a new instance of LoadBalancersClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLoadBalancersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LoadBalancersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a load balancer in the specified managed cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - loadBalancerName - The name of the load balancer. +// - parameters - The load balancer to create or update. +// - options - LoadBalancersClientCreateOrUpdateOptions contains the optional parameters for the LoadBalancersClient.CreateOrUpdate +// method. +func (client *LoadBalancersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, parameters LoadBalancer, options *LoadBalancersClientCreateOrUpdateOptions) (LoadBalancersClientCreateOrUpdateResponse, error) { + var err error + const operationName = "LoadBalancersClient.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, loadBalancerName, parameters, options) + if err != nil { + return LoadBalancersClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancersClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return LoadBalancersClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *LoadBalancersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, parameters LoadBalancer, options *LoadBalancersClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + 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 loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2024-04-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 *LoadBalancersClient) createOrUpdateHandleResponse(resp *http.Response) (LoadBalancersClientCreateOrUpdateResponse, error) { + result := LoadBalancersClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancer); err != nil { + return LoadBalancersClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes a load balancer in the specified managed cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancersClientBeginDeleteOptions contains the optional parameters for the LoadBalancersClient.BeginDelete +// method. +func (client *LoadBalancersClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*runtime.Poller[LoadBalancersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, loadBalancerName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LoadBalancersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a load balancer in the specified managed cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-02-preview +func (client *LoadBalancersClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "LoadBalancersClient.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, loadBalancerName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *LoadBalancersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + 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 loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2024-04-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified load balancer. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancersClientGetOptions contains the optional parameters for the LoadBalancersClient.Get method. +func (client *LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *LoadBalancersClientGetOptions) (LoadBalancersClientGetResponse, error) { + var err error + const operationName = "LoadBalancersClient.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, loadBalancerName, options) + if err != nil { + return LoadBalancersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LoadBalancersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *LoadBalancersClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *LoadBalancersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + 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 loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + 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", "2024-04-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 *LoadBalancersClient) getHandleResponse(resp *http.Response) (LoadBalancersClientGetResponse, error) { + result := LoadBalancersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancer); err != nil { + return LoadBalancersClientGetResponse{}, err + } + return result, nil +} + +// NewListByManagedClusterPager - Gets a list of load balancers in the specified managed cluster. +// +// Generated from API version 2024-04-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - options - LoadBalancersClientListByManagedClusterOptions contains the optional parameters for the LoadBalancersClient.NewListByManagedClusterPager +// method. +func (client *LoadBalancersClient) NewListByManagedClusterPager(resourceGroupName string, resourceName string, options *LoadBalancersClientListByManagedClusterOptions) *runtime.Pager[LoadBalancersClientListByManagedClusterResponse] { + return runtime.NewPager(runtime.PagingHandler[LoadBalancersClientListByManagedClusterResponse]{ + More: func(page LoadBalancersClientListByManagedClusterResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LoadBalancersClientListByManagedClusterResponse) (LoadBalancersClientListByManagedClusterResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LoadBalancersClient.NewListByManagedClusterPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByManagedClusterCreateRequest(ctx, resourceGroupName, resourceName, options) + }, nil) + if err != nil { + return LoadBalancersClientListByManagedClusterResponse{}, err + } + return client.listByManagedClusterHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByManagedClusterCreateRequest creates the ListByManagedCluster request. +func (client *LoadBalancersClient) listByManagedClusterCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *LoadBalancersClientListByManagedClusterOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers" + 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", "2024-04-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByManagedClusterHandleResponse handles the ListByManagedCluster response. +func (client *LoadBalancersClient) listByManagedClusterHandleResponse(resp *http.Response) (LoadBalancersClientListByManagedClusterResponse, error) { + result := LoadBalancersClientListByManagedClusterResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerListResult); err != nil { + return LoadBalancersClientListByManagedClusterResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/machines_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/machines_client.go index 9862e6fc5459..616ac6932f48 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/machines_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/machines_client.go @@ -46,7 +46,7 @@ func NewMachinesClient(subscriptionID string, credential azcore.TokenCredential, // Get - Get a specific machine in the specified agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -102,7 +102,7 @@ func (client *MachinesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +119,7 @@ func (client *MachinesClient) getHandleResponse(resp *http.Response) (MachinesCl // NewListPager - Gets a list of machines in the specified agent pool. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -171,7 +171,7 @@ func (client *MachinesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/machines_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/machines_client_example_test.go deleted file mode 100644 index d7c2d61ef95a..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/machines_client_example_test.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. -// 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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/MachineList.json -func ExampleMachinesClient_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.NewMachinesClient().NewListPager("rg1", "clustername1", "agentpool1", 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.MachineListResult = armcontainerservice.MachineListResult{ - // Value: []*armcontainerservice.Machine{ - // { - // Name: to.Ptr("aks-nodepool1-25481572-vmss000000"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools/machines"), - // ID: to.Ptr("/subscriptions/26fe00f8-9173-4872-9134-bb1d2e00343a/resourceGroups/dummyRG/providers/Microsoft.ContainerService/managedClusters/round/agentPools/nodepool1/machines/aks-nodepool1-25481572-vmss000000"), - // Properties: &armcontainerservice.MachineProperties{ - // Network: &armcontainerservice.MachineNetworkProperties{ - // IPAddresses: []*armcontainerservice.MachineIPAddress{ - // { - // Family: to.Ptr(armcontainerservice.IPFamilyIPv4), - // IP: to.Ptr("172.20.2.4"), - // }, - // { - // Family: to.Ptr(armcontainerservice.IPFamilyIPv4), - // IP: to.Ptr("10.0.0.1"), - // }}, - // }, - // ResourceID: to.Ptr("/subscriptions/26fe00f8-9173-4872-9134-bb1d2e00343a/resourceGroups/dummyRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-nodepool1-25481572-vmss/virtualMachines/0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/MachineGet.json -func ExampleMachinesClient_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.NewMachinesClient().Get(ctx, "rg1", "clustername1", "agentpool1", "aks-nodepool1-42263519-vmss00000t", 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.Machine = armcontainerservice.Machine{ - // Name: to.Ptr("aks-nodepool1-25481572-vmss000000"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools/machines"), - // ID: to.Ptr("/subscriptions/26fe00f8-9173-4872-9134-bb1d2e00343a/resourceGroups/dummyRG/providers/Microsoft.ContainerService/managedClusters/round/agentPools/nodepool1/machines/aks-nodepool1-25481572-vmss000000"), - // Properties: &armcontainerservice.MachineProperties{ - // Network: &armcontainerservice.MachineNetworkProperties{ - // IPAddresses: []*armcontainerservice.MachineIPAddress{ - // { - // Family: to.Ptr(armcontainerservice.IPFamilyIPv4), - // IP: to.Ptr("172.20.2.4"), - // }, - // { - // Family: to.Ptr(armcontainerservice.IPFamilyIPv4), - // IP: to.Ptr("10.0.0.1"), - // }}, - // }, - // ResourceID: to.Ptr("/subscriptions/26fe00f8-9173-4872-9134-bb1d2e00343a/resourceGroups/dummyRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-nodepool1-25481572-vmss/virtualMachines/0"), - // }, - // } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go index d4158c3affc1..e56beb706bfa 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -99,7 +99,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +120,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -171,7 +171,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -232,7 +232,7 @@ func (client *MaintenanceConfigurationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *MaintenanceConfigurationsClient) getHandleResponse(resp *http.Resp // NewListByManagedClusterPager - Gets a list of maintenance configurations in the specified managed cluster. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -297,7 +297,7 @@ func (client *MaintenanceConfigurationsClient) listByManagedClusterCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") 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 deleted file mode 100644 index c2b4f7cf43b4..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go +++ /dev/null @@ -1,416 +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" - - "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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/MaintenanceConfigurationsList.json -func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMaintenanceConfigurationsByManagedCluster() { - 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.NewMaintenanceConfigurationsClient().NewListByManagedClusterPager("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.MaintenanceConfigurationListResult = armcontainerservice.MaintenanceConfigurationListResult{ - // Value: []*armcontainerservice.MaintenanceConfiguration{ - // { - // Name: to.Ptr("default"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), - // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ - // NotAllowedTime: []*armcontainerservice.TimeSpan{ - // { - // End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-30T12:00:00.000Z"); return t}()), - // Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-26T03:00:00.000Z"); return t}()), - // }}, - // TimeInWeek: []*armcontainerservice.TimeInWeek{ - // { - // Day: to.Ptr(armcontainerservice.WeekDayMonday), - // HourSlots: []*int32{ - // to.Ptr[int32](1), - // to.Ptr[int32](2)}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/MaintenanceConfigurationsList_MaintenanceWindow.json -func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMaintenanceConfigurationsConfiguredWithMaintenanceWindowByManagedCluster() { - 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.NewMaintenanceConfigurationsClient().NewListByManagedClusterPager("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.MaintenanceConfigurationListResult = armcontainerservice.MaintenanceConfigurationListResult{ - // Value: []*armcontainerservice.MaintenanceConfiguration{ - // { - // Name: to.Ptr("aksManagedNodeOSUpgradeSchedule"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), - // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ - // MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ - // DurationHours: to.Ptr[int32](10), - // Schedule: &armcontainerservice.Schedule{ - // Daily: &armcontainerservice.DailySchedule{ - // IntervalDays: to.Ptr[int32](5), - // }, - // }, - // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-01"); return t}()), - // StartTime: to.Ptr("13:30"), - // UTCOffset: to.Ptr("-07:00"), - // }, - // }, - // }, - // { - // Name: to.Ptr("aksManagedAutoUpgradeSchedule"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), - // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ - // MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ - // DurationHours: to.Ptr[int32](5), - // NotAllowedDates: []*armcontainerservice.DateSpan{ - // { - // End: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-02-25"); return t}()), - // Start: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-02-18"); return t}()), - // }, - // { - // End: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-01-05"); return t}()), - // Start: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-12-23"); return t}()), - // }}, - // Schedule: &armcontainerservice.Schedule{ - // AbsoluteMonthly: &armcontainerservice.AbsoluteMonthlySchedule{ - // DayOfMonth: to.Ptr[int32](15), - // IntervalMonths: to.Ptr[int32](3), - // }, - // }, - // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-01"); return t}()), - // StartTime: to.Ptr("08:30"), - // UTCOffset: to.Ptr("+00:00"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/MaintenanceConfigurationsGet.json -func ExampleMaintenanceConfigurationsClient_Get_getMaintenanceConfiguration() { - 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.NewMaintenanceConfigurationsClient().Get(ctx, "rg1", "clustername1", "default", 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.MaintenanceConfiguration = armcontainerservice.MaintenanceConfiguration{ - // Name: to.Ptr("default"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), - // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ - // NotAllowedTime: []*armcontainerservice.TimeSpan{ - // { - // End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-30T12:00:00.000Z"); return t}()), - // Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-26T03:00:00.000Z"); return t}()), - // }}, - // TimeInWeek: []*armcontainerservice.TimeInWeek{ - // { - // Day: to.Ptr(armcontainerservice.WeekDayMonday), - // HourSlots: []*int32{ - // to.Ptr[int32](1), - // to.Ptr[int32](2)}, - // }}, - // }, - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); 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.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json -func ExampleMaintenanceConfigurationsClient_Get_getMaintenanceConfigurationConfiguredWithMaintenanceWindow() { - 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.NewMaintenanceConfigurationsClient().Get(ctx, "rg1", "clustername1", "aksManagedNodeOSUpgradeSchedule", 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.MaintenanceConfiguration = armcontainerservice.MaintenanceConfiguration{ - // Name: to.Ptr("aksManagedNodeOSUpgradeSchedule"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), - // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ - // MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ - // DurationHours: to.Ptr[int32](4), - // NotAllowedDates: []*armcontainerservice.DateSpan{ - // { - // End: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-02-25"); return t}()), - // Start: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-02-18"); return t}()), - // }, - // { - // End: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-01-05"); return t}()), - // Start: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-12-23"); return t}()), - // }}, - // Schedule: &armcontainerservice.Schedule{ - // Daily: &armcontainerservice.DailySchedule{ - // IntervalDays: to.Ptr[int32](3), - // }, - // }, - // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-01"); return t}()), - // StartTime: to.Ptr("09:30"), - // UTCOffset: to.Ptr("-07:00"), - // }, - // }, - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); 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.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/MaintenanceConfigurationsCreate_Update.json -func ExampleMaintenanceConfigurationsClient_CreateOrUpdate_createUpdateMaintenanceConfiguration() { - 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.NewMaintenanceConfigurationsClient().CreateOrUpdate(ctx, "rg1", "clustername1", "default", armcontainerservice.MaintenanceConfiguration{ - Properties: &armcontainerservice.MaintenanceConfigurationProperties{ - NotAllowedTime: []*armcontainerservice.TimeSpan{ - { - End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-30T12:00:00.000Z"); return t }()), - Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-26T03:00:00.000Z"); return t }()), - }}, - TimeInWeek: []*armcontainerservice.TimeInWeek{ - { - Day: to.Ptr(armcontainerservice.WeekDayMonday), - HourSlots: []*int32{ - to.Ptr[int32](1), - to.Ptr[int32](2)}, - }}, - }, - }, 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.MaintenanceConfiguration = armcontainerservice.MaintenanceConfiguration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/maintenanceConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), - // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ - // NotAllowedTime: []*armcontainerservice.TimeSpan{ - // { - // End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-30T12:00:00.000Z"); return t}()), - // Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-26T03:00:00.000Z"); return t}()), - // }}, - // TimeInWeek: []*armcontainerservice.TimeInWeek{ - // { - // Day: to.Ptr(armcontainerservice.WeekDayMonday), - // HourSlots: []*int32{ - // to.Ptr[int32](1), - // to.Ptr[int32](2)}, - // }}, - // }, - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); 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.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json -func ExampleMaintenanceConfigurationsClient_CreateOrUpdate_createUpdateMaintenanceConfigurationWithMaintenanceWindow() { - 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.NewMaintenanceConfigurationsClient().CreateOrUpdate(ctx, "rg1", "clustername1", "aksManagedAutoUpgradeSchedule", armcontainerservice.MaintenanceConfiguration{ - Properties: &armcontainerservice.MaintenanceConfigurationProperties{ - MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ - DurationHours: to.Ptr[int32](10), - NotAllowedDates: []*armcontainerservice.DateSpan{ - { - End: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-02-25"); return t }()), - Start: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-02-18"); return t }()), - }, - { - End: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-01-05"); return t }()), - Start: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-12-23"); return t }()), - }}, - Schedule: &armcontainerservice.Schedule{ - RelativeMonthly: &armcontainerservice.RelativeMonthlySchedule{ - DayOfWeek: to.Ptr(armcontainerservice.WeekDayMonday), - IntervalMonths: to.Ptr[int32](3), - WeekIndex: to.Ptr(armcontainerservice.TypeFirst), - }, - }, - StartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-01"); return t }()), - StartTime: to.Ptr("08:30"), - UTCOffset: to.Ptr("+05:30"), - }, - }, - }, 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.MaintenanceConfiguration = armcontainerservice.MaintenanceConfiguration{ - // Name: to.Ptr("aksManagedAutoUpgradeSchedule"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/maintenanceConfigurations"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), - // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ - // MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ - // DurationHours: to.Ptr[int32](10), - // NotAllowedDates: []*armcontainerservice.DateSpan{ - // { - // End: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-02-25"); return t}()), - // Start: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-02-18"); return t}()), - // }, - // { - // End: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2024-01-05"); return t}()), - // Start: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-12-23"); return t}()), - // }}, - // Schedule: &armcontainerservice.Schedule{ - // Weekly: &armcontainerservice.WeeklySchedule{ - // DayOfWeek: to.Ptr(armcontainerservice.WeekDayMonday), - // IntervalWeeks: to.Ptr[int32](3), - // }, - // }, - // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2023-01-01"); return t}()), - // StartTime: to.Ptr("08:30"), - // UTCOffset: to.Ptr("+05:30"), - // }, - // }, - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); 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.123Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/MaintenanceConfigurationsDelete.json -func ExampleMaintenanceConfigurationsClient_Delete_deleteMaintenanceConfiguration() { - 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.NewMaintenanceConfigurationsClient().Delete(ctx, "rg1", "clustername1", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json -func ExampleMaintenanceConfigurationsClient_Delete_deleteMaintenanceConfigurationForNodeOsUpgrade() { - 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.NewMaintenanceConfigurationsClient().Delete(ctx, "rg1", "clustername1", "aksManagedNodeOSUpgradeSchedule", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go index 3f4733e677e7..031877521a43 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go @@ -49,7 +49,7 @@ func NewManagedClustersClient(subscriptionID string, credential azcore.TokenCred // completes before cancellation can take place, an error is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -77,7 +77,7 @@ func (client *ManagedClustersClient) BeginAbortLatestOperation(ctx context.Conte // completes before cancellation can take place, an error is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview func (client *ManagedClustersClient) abortLatestOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginAbortLatestOperationOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginAbortLatestOperation" @@ -119,7 +119,7 @@ func (client *ManagedClustersClient) abortLatestOperationCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -128,7 +128,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 2024-02-02-preview +// Generated from API version 2024-04-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 to create or update. @@ -154,7 +154,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview 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" @@ -196,9 +196,15 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + if options != nil && options.IfNoneMatch != nil { + req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} + } if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -208,7 +214,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -233,7 +239,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview func (client *ManagedClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginDelete" @@ -275,19 +281,22 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") if options != nil && options.IgnorePodDisruptionBudget != nil { reqQP.Set("ignore-pod-disruption-budget", strconv.FormatBool(*options.IgnorePodDisruptionBudget)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } return req, nil } // Get - Gets a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -333,7 +342,7 @@ func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,7 +362,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -405,7 +414,7 @@ func (client *ManagedClustersClient) getAccessProfileCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -423,7 +432,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -475,7 +484,7 @@ func (client *ManagedClustersClient) getCommandResultCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -496,7 +505,7 @@ func (client *ManagedClustersClient) getCommandResultHandleResponse(resp *http.R // GetGuardrailsVersions - Contains Guardrails version along with its support info and whether it is a default version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - location - The name of the Azure region. // - version - Safeguards version // - options - ManagedClustersClientGetGuardrailsVersionsOptions contains the optional parameters for the ManagedClustersClient.GetGuardrailsVersions @@ -543,7 +552,7 @@ func (client *ManagedClustersClient) getGuardrailsVersionsCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -562,7 +571,7 @@ func (client *ManagedClustersClient) getGuardrailsVersionsHandleResponse(resp *h // and available upgrades // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - location - The name of the Azure region. // - mode - The mode of the mesh. // - options - ManagedClustersClientGetMeshRevisionProfileOptions contains the optional parameters for the ManagedClustersClient.GetMeshRevisionProfile @@ -609,7 +618,7 @@ func (client *ManagedClustersClient) getMeshRevisionProfileCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -627,7 +636,7 @@ func (client *ManagedClustersClient) getMeshRevisionProfileHandleResponse(resp * // GetMeshUpgradeProfile - Gets available upgrades for a service mesh in a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - mode - The mode of the mesh. @@ -679,7 +688,7 @@ func (client *ManagedClustersClient) getMeshUpgradeProfileCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -697,7 +706,7 @@ func (client *ManagedClustersClient) getMeshUpgradeProfileHandleResponse(resp *h // GetOSOptions - Gets supported OS options in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - location - The name of the Azure region. // - options - ManagedClustersClientGetOSOptionsOptions contains the optional parameters for the ManagedClustersClient.GetOSOptions // method. @@ -739,7 +748,7 @@ func (client *ManagedClustersClient) getOSOptionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") if options != nil && options.ResourceType != nil { reqQP.Set("resource-type", *options.ResourceType) } @@ -760,7 +769,7 @@ func (client *ManagedClustersClient) getOSOptionsHandleResponse(resp *http.Respo // GetSafeguardsVersions - Contains Safeguards version along with its support info and whether it is a default version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - location - The name of the Azure region. // - version - Safeguards version // - options - ManagedClustersClientGetSafeguardsVersionsOptions contains the optional parameters for the ManagedClustersClient.GetSafeguardsVersions @@ -807,7 +816,7 @@ func (client *ManagedClustersClient) getSafeguardsVersionsCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -825,7 +834,7 @@ func (client *ManagedClustersClient) getSafeguardsVersionsHandleResponse(resp *h // GetUpgradeProfile - Gets the upgrade profile of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -872,7 +881,7 @@ func (client *ManagedClustersClient) getUpgradeProfileCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -889,7 +898,7 @@ func (client *ManagedClustersClient) getUpgradeProfileHandleResponse(resp *http. // NewListPager - Gets a list of managed clusters in the specified subscription. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - options - ManagedClustersClientListOptions contains the optional parameters for the ManagedClustersClient.NewListPager // method. func (client *ManagedClustersClient) NewListPager(options *ManagedClustersClientListOptions) *runtime.Pager[ManagedClustersClientListResponse] { @@ -927,7 +936,7 @@ func (client *ManagedClustersClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -944,7 +953,7 @@ func (client *ManagedClustersClient) listHandleResponse(resp *http.Response) (Ma // NewListByResourceGroupPager - Lists managed clusters in the specified subscription and resource group. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ManagedClustersClientListByResourceGroupOptions contains the optional parameters for the ManagedClustersClient.NewListByResourceGroupPager // method. @@ -987,7 +996,7 @@ func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1005,7 +1014,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -1052,7 +1061,7 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -1073,7 +1082,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -1120,7 +1129,7 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -1141,7 +1150,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -1188,7 +1197,7 @@ func (client *ManagedClustersClient) listClusterUserCredentialsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") if options != nil && options.Format != nil { reqQP.Set("format", string(*options.Format)) } @@ -1212,7 +1221,7 @@ func (client *ManagedClustersClient) listClusterUserCredentialsHandleResponse(re // NewListGuardrailsVersionsPager - Contains list of Guardrails version along with its support info and whether it is a default // version. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - location - The name of the Azure region. // - options - ManagedClustersClientListGuardrailsVersionsOptions contains the optional parameters for the ManagedClustersClient.NewListGuardrailsVersionsPager // method. @@ -1255,7 +1264,7 @@ func (client *ManagedClustersClient) listGuardrailsVersionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1274,7 +1283,7 @@ func (client *ManagedClustersClient) listGuardrailsVersionsHandleResponse(resp * // upgrades, and details on preview status of the version // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - location - The name of the Azure region. // - options - ManagedClustersClientListKubernetesVersionsOptions contains the optional parameters for the ManagedClustersClient.ListKubernetesVersions // method. @@ -1316,7 +1325,7 @@ func (client *ManagedClustersClient) listKubernetesVersionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1334,7 +1343,7 @@ func (client *ManagedClustersClient) listKubernetesVersionsHandleResponse(resp * // NewListMeshRevisionProfilesPager - Contains extra metadata on each revision, including supported revisions, cluster compatibility // and available upgrades // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - location - The name of the Azure region. // - options - ManagedClustersClientListMeshRevisionProfilesOptions contains the optional parameters for the ManagedClustersClient.NewListMeshRevisionProfilesPager // method. @@ -1377,7 +1386,7 @@ func (client *ManagedClustersClient) listMeshRevisionProfilesCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1394,7 +1403,7 @@ func (client *ManagedClustersClient) listMeshRevisionProfilesHandleResponse(resp // NewListMeshUpgradeProfilesPager - Lists available upgrades for all service meshes in a specific cluster. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListMeshUpgradeProfilesOptions contains the optional parameters for the ManagedClustersClient.NewListMeshUpgradeProfilesPager @@ -1442,7 +1451,7 @@ func (client *ManagedClustersClient) listMeshUpgradeProfilesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1460,7 +1469,7 @@ func (client *ManagedClustersClient) listMeshUpgradeProfilesHandleResponse(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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -1508,7 +1517,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1526,7 +1535,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsHan // NewListSafeguardsVersionsPager - Contains list of Safeguards version along with its support info and whether it is a default // version. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - location - The name of the Azure region. // - options - ManagedClustersClientListSafeguardsVersionsOptions contains the optional parameters for the ManagedClustersClient.NewListSafeguardsVersionsPager // method. @@ -1569,7 +1578,7 @@ func (client *ManagedClustersClient) listSafeguardsVersionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1584,11 +1593,91 @@ func (client *ManagedClustersClient) listSafeguardsVersionsHandleResponse(resp * return result, nil } +// BeginRebalanceLoadBalancers - Rebalance nodes across specific load balancers. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - parameters - The names of the load balancers to be rebalanced. If set to empty, all load balancers will be rebalanced. +// - options - ManagedClustersClientBeginRebalanceLoadBalancersOptions contains the optional parameters for the ManagedClustersClient.BeginRebalanceLoadBalancers +// method. +func (client *ManagedClustersClient) BeginRebalanceLoadBalancers(ctx context.Context, resourceGroupName string, resourceName string, parameters RebalanceLoadBalancersRequestBody, options *ManagedClustersClientBeginRebalanceLoadBalancersOptions) (*runtime.Poller[ManagedClustersClientRebalanceLoadBalancersResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.rebalanceLoadBalancers(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientRebalanceLoadBalancersResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientRebalanceLoadBalancersResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// RebalanceLoadBalancers - Rebalance nodes across specific load balancers. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-04-02-preview +func (client *ManagedClustersClient) rebalanceLoadBalancers(ctx context.Context, resourceGroupName string, resourceName string, parameters RebalanceLoadBalancersRequestBody, options *ManagedClustersClientBeginRebalanceLoadBalancersOptions) (*http.Response, error) { + var err error + const operationName = "ManagedClustersClient.BeginRebalanceLoadBalancers" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.rebalanceLoadBalancersCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// rebalanceLoadBalancersCreateRequest creates the RebalanceLoadBalancers request. +func (client *ManagedClustersClient) rebalanceLoadBalancersCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters RebalanceLoadBalancersRequestBody, options *ManagedClustersClientBeginRebalanceLoadBalancersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-04-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 +} + // BeginResetAADProfile - WARNING: This API will be deprecated. Please see AKS-managed Azure Active Directory integration // [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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -1616,7 +1705,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview 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" @@ -1658,7 +1747,7 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1670,7 +1759,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -1697,7 +1786,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview 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" @@ -1739,7 +1828,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1752,7 +1841,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -1779,7 +1868,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview func (client *ManagedClustersClient) rotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateClusterCertificatesOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginRotateClusterCertificates" @@ -1821,7 +1910,7 @@ func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1830,7 +1919,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -1856,7 +1945,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview func (client *ManagedClustersClient) rotateServiceAccountSigningKeys(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginRotateServiceAccountSigningKeys" @@ -1898,7 +1987,7 @@ func (client *ManagedClustersClient) rotateServiceAccountSigningKeysCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1909,7 +1998,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -1938,7 +2027,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview 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" @@ -1980,7 +2069,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestPayload); err != nil { @@ -1993,7 +2082,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context // a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -2020,7 +2109,7 @@ func (client *ManagedClustersClient) BeginStart(ctx context.Context, resourceGro // a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview func (client *ManagedClustersClient) start(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginStart" @@ -2062,7 +2151,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2074,7 +2163,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 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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 @@ -2103,7 +2192,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview func (client *ManagedClustersClient) stop(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginStop" @@ -2145,7 +2234,7 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2154,7 +2243,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 2024-02-02-preview +// Generated from API version 2024-04-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 Tags operation. @@ -2180,7 +2269,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-02-preview 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" @@ -2222,9 +2311,12 @@ func (client *ManagedClustersClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go deleted file mode 100644 index 87271e4618a4..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go +++ /dev/null @@ -1,7154 +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" - - "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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ContainerServiceGetOSOptions.json -func ExampleManagedClustersClient_GetOSOptions() { - 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().GetOSOptions(ctx, "location1", &armcontainerservice.ManagedClustersClientGetOSOptionsOptions{ResourceType: 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.OSOptionProfile = armcontainerservice.OSOptionProfile{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ContainerService/locations/osOptions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/osOptions/default"), - // Properties: &armcontainerservice.OSOptionPropertyList{ - // OSOptionPropertyList: []*armcontainerservice.OSOptionProperty{ - // { - // EnableFipsImage: to.Ptr(false), - // OSType: to.Ptr("Linux"), - // }, - // { - // EnableFipsImage: to.Ptr(false), - // OSType: to.Ptr("Windows"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/KubernetesVersions_List.json -func ExampleManagedClustersClient_ListKubernetesVersions() { - 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().ListKubernetesVersions(ctx, "location1", 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.KubernetesVersionListResult = armcontainerservice.KubernetesVersionListResult{ - // Values: []*armcontainerservice.KubernetesVersion{ - // { - // Capabilities: &armcontainerservice.KubernetesVersionCapabilities{ - // SupportPlan: []*armcontainerservice.KubernetesSupportPlan{ - // to.Ptr(armcontainerservice.KubernetesSupportPlanKubernetesOfficial)}, - // }, - // PatchVersions: map[string]*armcontainerservice.KubernetesPatchVersion{ - // "1.23.12": &armcontainerservice.KubernetesPatchVersion{ - // Upgrades: []*string{ - // to.Ptr("1.23.15"), - // to.Ptr("1.24.6"), - // to.Ptr("1.24.9")}, - // }, - // "1.23.15": &armcontainerservice.KubernetesPatchVersion{ - // Upgrades: []*string{ - // to.Ptr("1.24.6"), - // to.Ptr("1.24.9")}, - // }, - // }, - // Version: to.Ptr("1.23"), - // }, - // { - // Capabilities: &armcontainerservice.KubernetesVersionCapabilities{ - // SupportPlan: []*armcontainerservice.KubernetesSupportPlan{ - // to.Ptr(armcontainerservice.KubernetesSupportPlanKubernetesOfficial)}, - // }, - // IsDefault: to.Ptr(true), - // PatchVersions: map[string]*armcontainerservice.KubernetesPatchVersion{ - // "1.24.6": &armcontainerservice.KubernetesPatchVersion{ - // Upgrades: []*string{ - // to.Ptr("1.24.9"), - // to.Ptr("1.25.4"), - // to.Ptr("1.25.5")}, - // }, - // "1.24.9": &armcontainerservice.KubernetesPatchVersion{ - // Upgrades: []*string{ - // to.Ptr("1.25.4"), - // to.Ptr("1.25.5")}, - // }, - // }, - // Version: to.Ptr("1.24"), - // }, - // { - // Capabilities: &armcontainerservice.KubernetesVersionCapabilities{ - // SupportPlan: []*armcontainerservice.KubernetesSupportPlan{ - // to.Ptr(armcontainerservice.KubernetesSupportPlanKubernetesOfficial)}, - // }, - // PatchVersions: map[string]*armcontainerservice.KubernetesPatchVersion{ - // "1.25.4": &armcontainerservice.KubernetesPatchVersion{ - // Upgrades: []*string{ - // to.Ptr("1.25.5"), - // to.Ptr("1.26.0")}, - // }, - // "1.25.5": &armcontainerservice.KubernetesPatchVersion{ - // Upgrades: []*string{ - // to.Ptr("1.26.0")}, - // }, - // }, - // Version: to.Ptr("1.25"), - // }, - // { - // Capabilities: &armcontainerservice.KubernetesVersionCapabilities{ - // SupportPlan: []*armcontainerservice.KubernetesSupportPlan{ - // to.Ptr(armcontainerservice.KubernetesSupportPlanKubernetesOfficial)}, - // }, - // IsPreview: to.Ptr(true), - // PatchVersions: map[string]*armcontainerservice.KubernetesPatchVersion{ - // "1.26.0": &armcontainerservice.KubernetesPatchVersion{ - // Upgrades: []*string{ - // }, - // }, - // }, - // Version: to.Ptr("1.26"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersList.json -func ExampleManagedClustersClient_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.NewManagedClustersClient().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.ManagedClusterListResult = armcontainerservice.ManagedClusterListResult{ - // Value: []*armcontainerservice.ManagedCluster{ - // { - // Name: to.Ptr("clustername1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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{ - // { - // 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_DS1_v2"), - // Name: to.Ptr("nodepool1"), - // }}, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnableRBAC: to.Ptr(false), - // 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"), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // 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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersListByResourceGroup.json -func ExampleManagedClustersClient_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.NewManagedClustersClient().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.ManagedClusterListResult = armcontainerservice.ManagedClusterListResult{ - // Value: []*armcontainerservice.ManagedCluster{ - // { - // Name: to.Ptr("clustername1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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{ - // { - // 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_DS1_v2"), - // Name: to.Ptr("nodepool1"), - // }}, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnableRBAC: to.Ptr(false), - // 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"), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // 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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersGetUpgradeProfile.json -func ExampleManagedClustersClient_GetUpgradeProfile() { - 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().GetUpgradeProfile(ctx, "rg1", "clustername1", 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.ManagedClusterUpgradeProfile = armcontainerservice.ManagedClusterUpgradeProfile{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/upgradeprofiles"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/upgradeprofiles/default"), - // Properties: &armcontainerservice.ManagedClusterUpgradeProfileProperties{ - // AgentPoolProfiles: []*armcontainerservice.ManagedClusterPoolUpgradeProfile{ - // { - // Name: to.Ptr("agent"), - // KubernetesVersion: to.Ptr("1.7.7"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // Upgrades: []*armcontainerservice.ManagedClusterPoolUpgradeProfileUpgradesItem{ - // { - // KubernetesVersion: to.Ptr("1.7.9"), - // }, - // { - // IsPreview: to.Ptr(true), - // KubernetesVersion: to.Ptr("1.7.11"), - // }}, - // }}, - // ControlPlaneProfile: &armcontainerservice.ManagedClusterPoolUpgradeProfile{ - // Name: to.Ptr("master"), - // KubernetesVersion: to.Ptr("1.7.7"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // Upgrades: []*armcontainerservice.ManagedClusterPoolUpgradeProfileUpgradesItem{ - // { - // IsPreview: to.Ptr(true), - // KubernetesVersion: to.Ptr("1.7.9"), - // }, - // { - // KubernetesVersion: to.Ptr("1.7.11"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersGetAccessProfile.json -func ExampleManagedClustersClient_GetAccessProfile() { - 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().GetAccessProfile(ctx, "rg1", "clustername1", "clusterUser", 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.ManagedClusterAccessProfile = armcontainerservice.ManagedClusterAccessProfile{ - // Name: to.Ptr("clusterUser"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters/AccessProfiles"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/accessProfiles/clusterUser"), - // Location: to.Ptr("location1"), - // Properties: &armcontainerservice.AccessProfile{ - // KubeConfig: []byte("a3ViZUNvbmZpZzE="), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersListClusterCredentialResult.json -func ExampleManagedClustersClient_ListClusterAdminCredentials() { - 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().ListClusterAdminCredentials(ctx, "rg1", "clustername1", &armcontainerservice.ManagedClustersClientListClusterAdminCredentialsOptions{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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersGet.json -func ExampleManagedClustersClient_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.NewManagedClustersClient().Get(ctx, "rg1", "clustername1", 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.ManagedCluster = armcontainerservice.ManagedCluster{ - // Name: to.Ptr("clustername1"), - // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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{ - // { - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), - // MaxPods: to.Ptr[int32](110), - // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), - // OrchestratorVersion: to.Ptr("1.9.6"), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // ProvisioningState: to.Ptr("Succeeded"), - // UpgradeSettings: &armcontainerservice.AgentPoolUpgradeSettings{ - // MaxSurge: to.Ptr("33%"), - // }, - // VMSize: to.Ptr("Standard_DS1_v2"), - // Name: to.Ptr("nodepool1"), - // }}, - // AzurePortalFQDN: to.Ptr("dnsprefix1-abcd1234.portal.hcp.eastus.azmk8s.io"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnableRBAC: to.Ptr(false), - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // OutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileOutboundIPs{ - // PublicIPs: []*armcontainerservice.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/customeroutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/customeroutboundip2"), - // }}, - // }, - // }, - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - // 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"), - // }, - // UpgradeSettings: &armcontainerservice.ClusterUpgradeSettings{ - // OverrideSettings: &armcontainerservice.UpgradeOverrideSettings{ - // ForceUpgrade: to.Ptr(true), - // Until: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T13:00:00.000Z"); return t}()), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_Snapshot.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingAnAgentPoolSnapshot() { - 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), - CreationData: &armcontainerservice.CreationData{ - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), - }, - 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"), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(false), - 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/00000000-0000-0000-0000-000000000000/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), - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), - // }, - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), - // 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"), - // }}, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnablePodSecurityPolicy: to.Ptr(false), - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_EnableAIToolchainOperator.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAiToolchainOperatorEnabled() { - 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), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), - }}, - AiToolchainOperatorProfile: &armcontainerservice.ManagedClusterAIToolchainOperatorProfile{ - Enabled: to.Ptr(true), - }, - DNSPrefix: to.Ptr("dnsprefix1"), - 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), - NetworkDataplane: to.Ptr(armcontainerservice.NetworkDataplaneCilium), - NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginAzure), - NetworkPluginMode: to.Ptr(armcontainerservice.NetworkPluginModeOverlay), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - }, - 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/00000000-0000-0000-0000-000000000000/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"), - // }}, - // AiToolchainOperatorProfile: &armcontainerservice.ManagedClusterAIToolchainOperatorProfile{ - // Enabled: to.Ptr(true), - // }, - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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.LoadBalancerSKUStandard), - // NetworkDataplane: to.Ptr(armcontainerservice.NetworkDataplaneCilium), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginAzure), - // NetworkPluginMode: to.Ptr(armcontainerservice.NetworkPluginModeOverlay), - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_ManagedNATGateway.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAksManagedNatGatewayAsOutboundType() { - 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(false), - 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/00000000-0000-0000-0000-000000000000/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{ - LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - NatGatewayProfile: &armcontainerservice.ManagedClusterNATGatewayProfile{ - ManagedOutboundIPProfile: &armcontainerservice.ManagedClusterManagedOutboundIPProfile{ - Count: to.Ptr[int32](2), - }, - }, - OutboundType: to.Ptr(armcontainerservice.OutboundTypeManagedNATGateway), - }, - 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/00000000-0000-0000-0000-000000000000/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(false), - // 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/00000000-0000-0000-0000-000000000000/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"), - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), - // NatGatewayProfile: &armcontainerservice.ManagedClusterNATGatewayProfile{ - // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](4), - // ManagedOutboundIPProfile: &armcontainerservice.ManagedClusterManagedOutboundIPProfile{ - // Count: to.Ptr[int32](2), - // }, - // }, - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // OutboundType: to.Ptr(armcontainerservice.OutboundTypeManagedNATGateway), - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAzureKeyVaultSecretsProviderAddon() { - 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{ - "azureKeyvaultSecretsProvider": { - 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), - 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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=")}, - }, - 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/00000000-0000-0000-0000-000000000000/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"), - // EnableCustomCATrust: 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_DedicatedHostGroup.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDedicatedHostGroup() { - 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), - HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"), - 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/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(false), - 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/00000000-0000-0000-0000-000000000000/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), - // HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"), - // MaxPods: to.Ptr[int32](110), - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnablePodSecurityPolicy: to.Ptr(false), - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_EnableEncryptionAtHost.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEncryptionAtHostEnabled() { - 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), - EnableEncryptionAtHost: 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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"), - // 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_EnabledFIPS.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFipsEnabledOs() { - 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), - 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"), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(false), - 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/00000000-0000-0000-0000-000000000000/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"), - // 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"), - // }}, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnablePodSecurityPolicy: to.Ptr(false), - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_GPUMIG.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGpumig() { - 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), - GpuInstanceProfile: to.Ptr(armcontainerservice.GPUInstanceProfileMIG3G), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_ND96asr_v4"), - Name: to.Ptr("nodepool1"), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(true), - EnableRBAC: to.Ptr(true), - HTTPProxyConfig: &armcontainerservice.ManagedClusterHTTPProxyConfig{ - HTTPProxy: to.Ptr("http://myproxy.server.com:8080"), - HTTPSProxy: to.Ptr("https://myproxy.server.com:8080"), - NoProxy: []*string{ - to.Ptr("localhost"), - to.Ptr("127.0.0.1")}, - TrustedCa: to.Ptr("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="), - }, - 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/00000000-0000-0000-0000-000000000000/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), - // GpuInstanceProfile: to.Ptr(armcontainerservice.GPUInstanceProfileMIG3G), - // 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_ND96asr_v4"), - // Name: to.Ptr("nodepool1"), - // }}, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - // HTTPProxyConfig: &armcontainerservice.ManagedClusterHTTPProxyConfig{ - // HTTPProxy: to.Ptr("http://myproxy.server.com:8080"), - // HTTPSProxy: to.Ptr("https://myproxy.server.com:8080"), - // NoProxy: []*string{ - // to.Ptr("localhost"), - // to.Ptr("127.0.0.1")}, - // TrustedCa: to.Ptr("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="), - // }, - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_HTTPProxy.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHttpProxyConfigured() { - 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), - 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/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(true), - EnableRBAC: to.Ptr(true), - HTTPProxyConfig: &armcontainerservice.ManagedClusterHTTPProxyConfig{ - HTTPProxy: to.Ptr("http://myproxy.server.com:8080"), - HTTPSProxy: to.Ptr("https://myproxy.server.com:8080"), - NoProxy: []*string{ - to.Ptr("localhost"), - to.Ptr("127.0.0.1")}, - TrustedCa: to.Ptr("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="), - }, - 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/00000000-0000-0000-0000-000000000000/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"), - // }}, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - // HTTPProxyConfig: &armcontainerservice.ManagedClusterHTTPProxyConfig{ - // HTTPProxy: to.Ptr("http://myproxy.server.com:8080"), - // HTTPSProxy: to.Ptr("https://myproxy.server.com:8080"), - // NoProxy: []*string{ - // to.Ptr("localhost"), - // to.Ptr("127.0.0.1")}, - // TrustedCa: to.Ptr("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="), - // }, - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_Premium.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithLongTermSupport() { - 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), - EnableEncryptionAtHost: 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"), - }}, - APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{ - DisableRunCommand: to.Ptr(true), - }, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - 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"), - }, - SupportPlan: to.Ptr(armcontainerservice.KubernetesSupportPlanAKSLongTermSupport), - WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - AdminPassword: to.Ptr("replacePassword1234$"), - AdminUsername: to.Ptr("azureuser"), - }, - }, - SKU: &armcontainerservice.ManagedClusterSKU{ - Name: to.Ptr(armcontainerservice.ManagedClusterSKUNameBase), - Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierPremium), - }, - }, 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/00000000-0000-0000-0000-000000000000/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"), - // 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"), - // }}, - // APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{ - // DisableRunCommand: to.Ptr(true), - // }, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnablePodSecurityPolicy: to.Ptr(true), - // EnableRBAC: to.Ptr(true), - // Fqdn: to.Ptr("dnsprefix1-ee788a1f.hcp.location1.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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - // PrivateFQDN: to.Ptr("dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - // ClientID: to.Ptr("clientid"), - // }, - // SupportPlan: to.Ptr(armcontainerservice.KubernetesSupportPlanAKSLongTermSupport), - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), - // }, - // }, - // SKU: &armcontainerservice.ManagedClusterSKU{ - // Name: to.Ptr(armcontainerservice.ManagedClusterSKUNameBase), - // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierPremium), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_NodeAutoProvisioning.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNodeAutoProvisioning() { - 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), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), - }}, - 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), - NetworkDataplane: to.Ptr(armcontainerservice.NetworkDataplaneCilium), - NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginAzure), - NetworkPluginMode: to.Ptr(armcontainerservice.NetworkPluginModeOverlay), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - }, - 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/00000000-0000-0000-0000-000000000000/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"), - // }}, - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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.LoadBalancerSKUStandard), - // NetworkDataplane: to.Ptr(armcontainerservice.NetworkDataplaneCilium), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginAzure), - // NetworkPluginMode: to.Ptr(armcontainerservice.NetworkPluginModeOverlay), - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_NodePublicIPPrefix.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNodePublicIpPrefix() { - 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), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - NodePublicIPPrefixID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix"), - 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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"), - // NodePublicIPPrefixID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix"), - // 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_OSSKU.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOssku() { - 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), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSSKU: to.Ptr(armcontainerservice.OSSKUAzureLinux), - 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/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(true), - EnableRBAC: to.Ptr(true), - HTTPProxyConfig: &armcontainerservice.ManagedClusterHTTPProxyConfig{ - HTTPProxy: to.Ptr("http://myproxy.server.com:8080"), - HTTPSProxy: to.Ptr("https://myproxy.server.com:8080"), - NoProxy: []*string{ - to.Ptr("localhost"), - to.Ptr("127.0.0.1")}, - TrustedCa: to.Ptr("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="), - }, - 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/00000000-0000-0000-0000-000000000000/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"), - // OSSKU: to.Ptr(armcontainerservice.OSSKUAzureLinux), - // 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/00000000-0000-0000-0000-000000000000/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"), - // HTTPProxyConfig: &armcontainerservice.ManagedClusterHTTPProxyConfig{ - // HTTPProxy: to.Ptr("http://myproxy.server.com:8080"), - // HTTPSProxy: to.Ptr("https://myproxy.server.com:8080"), - // NoProxy: []*string{ - // to.Ptr("localhost"), - // to.Ptr("127.0.0.1")}, - // TrustedCa: to.Ptr("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U="), - // }, - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_PPG.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPpg() { - 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), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - ProximityPlacementGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), - 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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"), - // ProximityPlacementGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), - // 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_PodIdentity.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPodIdentityEnabled() { - 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), - 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/00000000-0000-0000-0000-000000000000/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), - }, - PodIdentityProfile: &armcontainerservice.ManagedClusterPodIdentityProfile{ - AllowNetworkPluginKubenet: to.Ptr(true), - Enabled: to.Ptr(true), - }, - 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/00000000-0000-0000-0000-000000000000/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"), - // }}, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - // PodIdentityProfile: &armcontainerservice.ManagedClusterPodIdentityProfile{ - // AllowNetworkPluginKubenet: to.Ptr(true), - // Enabled: to.Ptr(true), - // }, - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_DisableRunCommand.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithRunCommandDisabled() { - 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), - EnableEncryptionAtHost: 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"), - }}, - APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{ - DisableRunCommand: to.Ptr(true), - }, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - 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/00000000-0000-0000-0000-000000000000/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"), - // 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"), - // }}, - // APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{ - // DisableRunCommand: to.Ptr(true), - // }, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnablePodSecurityPolicy: to.Ptr(true), - // EnableRBAC: to.Ptr(true), - // Fqdn: to.Ptr("dnsprefix1-ee788a1f.hcp.location1.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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - // PrivateFQDN: to.Ptr("dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - // ClientID: to.Ptr("clientid"), - // }, - // SupportPlan: to.Ptr(armcontainerservice.KubernetesSupportPlanKubernetesOfficial), - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_SecurityProfile.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSecurityProfileConfigured() { - 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), - 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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), - // EnableUltraSSD: 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_VirtualMachines.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithVirtualMachinesPoolType() { - 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.AgentPoolTypeVirtualMachines), - Count: to.Ptr[int32](3), - EnableFIPS: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), - }}, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(false), - 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"), - }, - }, - 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/00000000-0000-0000-0000-000000000000/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.AgentPoolTypeVirtualMachines), - // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), - // EnableFIPS: 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/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnablePodSecurityPolicy: to.Ptr(false), - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithWebAppRoutingIngressProfileConfigured() { - 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), - 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"), - IngressProfile: &armcontainerservice.ManagedClusterIngressProfile{ - WebAppRouting: &armcontainerservice.ManagedClusterIngressProfileWebAppRouting{ - DNSZoneResourceIDs: []*string{ - to.Ptr("/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME")}, - Enabled: 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), - }, - }, - 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/00000000-0000-0000-0000-000000000000/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), - // 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/00000000-0000-0000-0000-000000000000/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{ - // DNSZoneResourceIDs: []*string{ - // 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"), - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_UserAssignedNATGateway.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUserAssignedNatGatewayAsOutboundType() { - 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(false), - 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/00000000-0000-0000-0000-000000000000/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{ - LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeUserAssignedNATGateway), - }, - 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/00000000-0000-0000-0000-000000000000/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(false), - // 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/00000000-0000-0000-0000-000000000000/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"), - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // OutboundType: to.Ptr(armcontainerservice.OutboundTypeUserAssignedNATGateway), - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateClusterWithPublicFqdnSpecified() { - 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), - EnableEncryptionAtHost: 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"), - }}, - APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{ - EnablePrivateCluster: to.Ptr(true), - EnablePrivateClusterPublicFQDN: to.Ptr(true), - }, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - 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/00000000-0000-0000-0000-000000000000/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"), - // 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"), - // }}, - // APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{ - // EnablePrivateCluster: to.Ptr(true), - // EnablePrivateClusterPublicFQDN: to.Ptr(true), - // PrivateDNSZone: to.Ptr("system"), - // }, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnablePodSecurityPolicy: to.Ptr(true), - // EnableRBAC: to.Ptr(true), - // Fqdn: to.Ptr("dnsprefix1-ee788a1f.hcp.location1.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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - // PrivateFQDN: to.Ptr("dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io"), - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateClusterWithFqdnSubdomainSpecified() { - 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), - EnableEncryptionAtHost: 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"), - }}, - APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{ - EnablePrivateCluster: to.Ptr(true), - PrivateDNSZone: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io"), - }, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - EnablePodSecurityPolicy: to.Ptr(true), - EnableRBAC: to.Ptr(true), - FqdnSubdomain: to.Ptr("domain1"), - 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/00000000-0000-0000-0000-000000000000/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"), - // 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"), - // }}, - // APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{ - // EnablePrivateCluster: to.Ptr(true), - // PrivateDNSZone: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io"), - // }, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // EnablePodSecurityPolicy: to.Ptr(true), - // EnableRBAC: to.Ptr(true), - // FqdnSubdomain: to.Ptr("domain1"), - // 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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - // PrivateFQDN: to.Ptr("domain1.privatelink.location1.azmk8s.io"), - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClusterWithEnableAzureRbac() { - 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{ - AADProfile: &armcontainerservice.ManagedClusterAADProfile{ - EnableAzureRBAC: to.Ptr(true), - Managed: to.Ptr(true), - }, - 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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{ - // AADProfile: &armcontainerservice.ManagedClusterAADProfile{ - // EnableAzureRBAC: to.Ptr(true), - // Managed: to.Ptr(true), - // TenantID: to.Ptr("tenantID"), - // }, - // 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_Update.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster() { - 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"), - }, - Identity: &armcontainerservice.ManagedClusterIdentity{ - Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, - }, - }, - 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), - ScaleDownMode: to.Ptr(armcontainerservice.ScaleDownModeDeallocate), - VMSize: to.Ptr("Standard_DS1_v2"), - Name: to.Ptr("nodepool1"), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - BalanceSimilarNodeGroups: to.Ptr("true"), - Expander: to.Ptr(armcontainerservice.ExpanderPriority), - MaxNodeProvisionTime: to.Ptr("15m"), - NewPodScaleUpDelay: to.Ptr("1m"), - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - SkipNodesWithSystemPods: to.Ptr("false"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - }, - UpgradeSettings: &armcontainerservice.ClusterUpgradeSettings{ - OverrideSettings: &armcontainerservice.UpgradeOverrideSettings{ - ForceUpgrade: to.Ptr(true), - Until: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T13:00:00.000Z"); return t }()), - }, - }, - 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), - // Location: to.Ptr("location1"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // Identity: &armcontainerservice.ManagedClusterIdentity{ - // Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // }, - // }, - // 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"), - // ScaleDownMode: to.Ptr(armcontainerservice.ScaleDownModeDeallocate), - // VMSize: to.Ptr("Standard_DS1_v2"), - // Name: to.Ptr("nodepool1"), - // }}, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // BalanceSimilarNodeGroups: to.Ptr("true"), - // Expander: to.Ptr(armcontainerservice.ExpanderPriority), - // MaxNodeProvisionTime: to.Ptr("15m"), - // NewPodScaleUpDelay: to.Ptr("1m"), - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // SkipNodesWithSystemPods: to.Ptr("false"), - // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - // }, - // UpgradeSettings: &armcontainerservice.ClusterUpgradeSettings{ - // OverrideSettings: &armcontainerservice.UpgradeOverrideSettings{ - // ForceUpgrade: to.Ptr(false), - // Until: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T13:00:00.000Z"); return t}()), - // }, - // }, - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_AzureServiceMesh.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithAzureServiceMesh() { - 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{ - "azureKeyvaultSecretsProvider": { - 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), - 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/00000000-0000-0000-0000-000000000000/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), - }, - ServiceMeshProfile: &armcontainerservice.ServiceMeshProfile{ - Istio: &armcontainerservice.IstioServiceMesh{ - CertificateAuthority: &armcontainerservice.IstioCertificateAuthority{ - Plugin: &armcontainerservice.IstioPluginCertificateAuthority{ - CertChainObjectName: to.Ptr("cert-chain"), - CertObjectName: to.Ptr("ca-cert"), - KeyObjectName: to.Ptr("ca-key"), - KeyVaultID: to.Ptr("/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv"), - RootCertObjectName: to.Ptr("root-cert"), - }, - }, - Components: &armcontainerservice.IstioComponents{ - EgressGateways: []*armcontainerservice.IstioEgressGateway{ - { - Enabled: to.Ptr(true), - }}, - IngressGateways: []*armcontainerservice.IstioIngressGateway{ - { - Enabled: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.IstioIngressGatewayModeInternal), - }}, - }, - }, - Mode: to.Ptr(armcontainerservice.ServiceMeshModeIstio), - }, - 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - // ServiceMeshProfile: &armcontainerservice.ServiceMeshProfile{ - // Istio: &armcontainerservice.IstioServiceMesh{ - // CertificateAuthority: &armcontainerservice.IstioCertificateAuthority{ - // Plugin: &armcontainerservice.IstioPluginCertificateAuthority{ - // CertChainObjectName: to.Ptr("cert-chain"), - // CertObjectName: to.Ptr("ca-cert"), - // KeyObjectName: to.Ptr("ca-key"), - // KeyVaultID: to.Ptr("/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv"), - // RootCertObjectName: to.Ptr("root-cert"), - // }, - // }, - // Components: &armcontainerservice.IstioComponents{ - // EgressGateways: []*armcontainerservice.IstioEgressGateway{ - // { - // Enabled: to.Ptr(true), - // }}, - // IngressGateways: []*armcontainerservice.IstioIngressGateway{ - // { - // Enabled: to.Ptr(true), - // Mode: to.Ptr(armcontainerservice.IstioIngressGatewayModeInternal), - // }}, - // }, - // Revisions: []*string{ - // to.Ptr("asm-1-17")}, - // }, - // Mode: to.Ptr(armcontainerservice.ServiceMeshModeIstio), - // }, - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_UpdateWithAHUB.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithEnableAhub() { - 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"), - }, - Identity: &armcontainerservice.ManagedClusterIdentity{ - Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, - }, - }, - 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/00000000-0000-0000-0000-000000000000/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"), - LicenseType: to.Ptr(armcontainerservice.LicenseTypeWindowsServer), - }, - }, - 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), - // Location: to.Ptr("location1"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // Identity: &armcontainerservice.ManagedClusterIdentity{ - // Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // }, - // }, - // 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - // LicenseType: to.Ptr(armcontainerservice.LicenseTypeWindowsServer), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_UpdateWindowsGmsa.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithWindowsGMsaEnabled() { - 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"), - }, - Identity: &armcontainerservice.ManagedClusterIdentity{ - Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, - }, - }, - 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/00000000-0000-0000-0000-000000000000/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"), - GmsaProfile: &armcontainerservice.WindowsGmsaProfile{ - 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), - // Location: to.Ptr("location1"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // Identity: &armcontainerservice.ManagedClusterIdentity{ - // Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // }, - // }, - // 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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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"), - // GmsaProfile: &armcontainerservice.WindowsGmsaProfile{ - // Enabled: to.Ptr(true), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersCreate_DualStackNetworking.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithDualStackNetworking() { - 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"), - }, - Identity: &armcontainerservice.ManagedClusterIdentity{ - Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, - }, - }, - 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), - ScaleDownMode: to.Ptr(armcontainerservice.ScaleDownModeDeallocate), - VMSize: to.Ptr("Standard_DS1_v2"), - Name: to.Ptr("nodepool1"), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - BalanceSimilarNodeGroups: to.Ptr("true"), - Expander: to.Ptr(armcontainerservice.ExpanderPriority), - MaxNodeProvisionTime: to.Ptr("15m"), - NewPodScaleUpDelay: to.Ptr("1m"), - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - SkipNodesWithSystemPods: to.Ptr("false"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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{ - IPFamilies: []*armcontainerservice.IPFamily{ - to.Ptr(armcontainerservice.IPFamilyIPv4), - to.Ptr(armcontainerservice.IPFamilyIPv6)}, - 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), - // Location: to.Ptr("location1"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // Identity: &armcontainerservice.ManagedClusterIdentity{ - // Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // }, - // }, - // 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"), - // ScaleDownMode: to.Ptr(armcontainerservice.ScaleDownModeDeallocate), - // VMSize: to.Ptr("Standard_DS1_v2"), - // Name: to.Ptr("nodepool1"), - // }}, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // BalanceSimilarNodeGroups: to.Ptr("true"), - // Expander: to.Ptr(armcontainerservice.ExpanderPriority), - // MaxNodeProvisionTime: to.Ptr("15m"), - // NewPodScaleUpDelay: to.Ptr("1m"), - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // SkipNodesWithSystemPods: to.Ptr("false"), - // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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), - // to.Ptr(armcontainerservice.IPFamilyIPv6)}, - // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - // AllocatedOutboundPorts: to.Ptr[int32](2000), - // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip3-ipv6"), - // }}, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - // Count: to.Ptr[int32](2), - // CountIPv6: to.Ptr[int32](1), - // }, - // }, - // 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"), - // to.Ptr("fd11:1234::/64")}, - // ServiceCidr: to.Ptr("10.0.0.0/16"), - // ServiceCidrs: []*string{ - // to.Ptr("10.0.0.0/16"), - // to.Ptr("fd00:1234::/108")}, - // }, - // 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersUpdateTags.json -func ExampleManagedClustersClient_BeginUpdateTags() { - 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().BeginUpdateTags(ctx, "rg1", "clustername1", armcontainerservice.TagsObject{ - Tags: map[string]*string{ - "archv3": to.Ptr(""), - "tier": to.Ptr("testing"), - }, - }, 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/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), - // Location: to.Ptr("location1"), - // Tags: map[string]*string{ - // "archv3": to.Ptr(""), - // "tier": to.Ptr("testing"), - // }, - // Properties: &armcontainerservice.ManagedClusterProperties{ - // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - // { - // 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_DS1_v2"), - // Name: to.Ptr("nodepool1"), - // }}, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - // DNSPrefix: to.Ptr("dnsprefix1"), - // EnableRBAC: to.Ptr(false), - // 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"), - // }}, - // }, - // }, - // NetworkProfile: &armcontainerservice.NetworkProfile{ - // DNSServiceIP: to.Ptr("10.0.0.10"), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersDelete.json -func ExampleManagedClustersClient_BeginDelete() { - 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().BeginDelete(ctx, "rg1", "clustername1", &armcontainerservice.ManagedClustersClientBeginDeleteOptions{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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersResetServicePrincipalProfile.json -func ExampleManagedClustersClient_BeginResetServicePrincipalProfile() { - 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().BeginResetServicePrincipalProfile(ctx, "rg1", "clustername1", armcontainerservice.ManagedClusterServicePrincipalProfile{ - ClientID: to.Ptr("clientid"), - Secret: to.Ptr("secret"), - }, 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersResetAADProfile.json -func ExampleManagedClustersClient_BeginResetAADProfile() { - 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().BeginResetAADProfile(ctx, "rg1", "clustername1", armcontainerservice.ManagedClusterAADProfile{ - ClientAppID: to.Ptr("clientappid"), - ServerAppID: to.Ptr("serverappid"), - ServerAppSecret: to.Ptr("serverappsecret"), - TenantID: to.Ptr("tenantid"), - }, 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersAbortOperation.json -func ExampleManagedClustersClient_BeginAbortLatestOperation() { - 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().BeginAbortLatestOperation(ctx, "rg1", "clustername1", 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersRotateClusterCertificates.json -func ExampleManagedClustersClient_BeginRotateClusterCertificates() { - 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().BeginRotateClusterCertificates(ctx, "rg1", "clustername1", 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersRotateServiceAccountSigningKeys.json -func ExampleManagedClustersClient_BeginRotateServiceAccountSigningKeys() { - 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().BeginRotateServiceAccountSigningKeys(ctx, "rg1", "clustername1", 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersStop.json -func ExampleManagedClustersClient_BeginStop() { - 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().BeginStop(ctx, "rg1", "clustername1", 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersStart.json -func ExampleManagedClustersClient_BeginStart() { - 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().BeginStart(ctx, "rg1", "clustername1", 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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/RunCommandRequest.json -func ExampleManagedClustersClient_BeginRunCommand() { - 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().BeginRunCommand(ctx, "rg1", "clustername1", armcontainerservice.RunCommandRequest{ - ClusterToken: to.Ptr(""), - Command: to.Ptr("kubectl apply -f ns.yaml"), - Context: to.Ptr(""), - }, 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.RunCommandResult = armcontainerservice.RunCommandResult{ - // ID: to.Ptr("def7b3ea71bd4f7e9d226ddbc0f00ad9"), - // Properties: &armcontainerservice.CommandResultProperties{ - // ExitCode: to.Ptr[int32](0), - // FinishedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-17T00:28:33.000Z"); return t}()), - // Logs: to.Ptr("namespace dummy created"), - // ProvisioningState: to.Ptr("Succeeded"), - // StartedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-17T00:28:20.000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/RunCommandResultFailed.json -func ExampleManagedClustersClient_GetCommandResult_commandFailedResult() { - 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().GetCommandResult(ctx, "rg1", "clustername1", "def7b3ea71bd4f7e9d226ddbc0f00ad9", 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.RunCommandResult = armcontainerservice.RunCommandResult{ - // ID: to.Ptr("def7b3ea71bd4f7e9d226ddbc0f00ad9"), - // Properties: &armcontainerservice.CommandResultProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Reason: to.Ptr("ImagePullBackoff"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/RunCommandResultSucceed.json -func ExampleManagedClustersClient_GetCommandResult_commandSucceedResult() { - 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().GetCommandResult(ctx, "rg1", "clustername1", "def7b3ea71bd4f7e9d226ddbc0f00ad9", 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.RunCommandResult = armcontainerservice.RunCommandResult{ - // ID: to.Ptr("def7b3ea71bd4f7e9d226ddbc0f00ad9"), - // Properties: &armcontainerservice.CommandResultProperties{ - // ExitCode: to.Ptr[int32](0), - // FinishedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-17T00:28:33.000Z"); return t}()), - // Logs: to.Ptr("namespace dummy created"), - // ProvisioningState: to.Ptr("Succeeded"), - // StartedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-17T00:28:20.000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/OutboundNetworkDependenciesEndpointsList.json -func ExampleManagedClustersClient_NewListOutboundNetworkDependenciesEndpointsPager() { - 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.NewManagedClustersClient().NewListOutboundNetworkDependenciesEndpointsPager("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.OutboundEnvironmentEndpointCollection = armcontainerservice.OutboundEnvironmentEndpointCollection{ - // Value: []*armcontainerservice.OutboundEnvironmentEndpoint{ - // { - // Category: to.Ptr("azure-resource-management"), - // Endpoints: []*armcontainerservice.EndpointDependency{ - // { - // DomainName: to.Ptr("management.azure.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("Https"), - // }}, - // }, - // { - // DomainName: to.Ptr("login.microsoftonline.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("Https"), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("images"), - // Endpoints: []*armcontainerservice.EndpointDependency{ - // { - // DomainName: to.Ptr("mcr.microsoft.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("Https"), - // }}, - // }, - // { - // DomainName: to.Ptr("*.data.mcr.microsoft.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Description: to.Ptr("mcr cdn"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("Https"), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("artifacts"), - // Endpoints: []*armcontainerservice.EndpointDependency{ - // { - // DomainName: to.Ptr("packages.microsoft.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("Https"), - // }}, - // }, - // { - // DomainName: to.Ptr("acs-mirror.azureedge.net"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("Https"), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("time-sync"), - // Endpoints: []*armcontainerservice.EndpointDependency{ - // { - // DomainName: to.Ptr("ntp.ubuntu.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](123), - // Protocol: to.Ptr("UDP"), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("ubuntu-optional"), - // Endpoints: []*armcontainerservice.EndpointDependency{ - // { - // DomainName: to.Ptr("security.ubuntu.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](80), - // Protocol: to.Ptr("Http"), - // }}, - // }, - // { - // DomainName: to.Ptr("azure.archive.ubuntu.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](80), - // Protocol: to.Ptr("Http"), - // }}, - // }, - // { - // DomainName: to.Ptr("changelogs.ubuntu.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](80), - // Protocol: to.Ptr("Http"), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("gpu"), - // Endpoints: []*armcontainerservice.EndpointDependency{ - // { - // DomainName: to.Ptr("nvidia.github.io"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("Https"), - // }}, - // }, - // { - // DomainName: to.Ptr("us.download.nvidia.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("Https"), - // }}, - // }, - // { - // DomainName: to.Ptr("apt.dockerproject.org"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("Https"), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("windows"), - // Endpoints: []*armcontainerservice.EndpointDependency{ - // { - // DomainName: to.Ptr("onegetcdn.azureedge.net"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("Https"), - // }}, - // }, - // { - // DomainName: to.Ptr("go.microsoft.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("Https"), - // }}, - // }, - // { - // DomainName: to.Ptr("*.mp.microsoft.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](80), - // Protocol: to.Ptr("Http"), - // }}, - // }, - // { - // DomainName: to.Ptr("www.msftconnecttest.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](80), - // Protocol: to.Ptr("Http"), - // }}, - // }, - // { - // DomainName: to.Ptr("ctldl.windowsupdate.com"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](80), - // Protocol: to.Ptr("Http"), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("apiserver"), - // Endpoints: []*armcontainerservice.EndpointDependency{ - // { - // DomainName: to.Ptr("*.azmk8s.io"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("Https"), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("tunnel-classic"), - // Endpoints: []*armcontainerservice.EndpointDependency{ - // { - // DomainName: to.Ptr("*.azmk8s.io"), - // EndpointDetails: []*armcontainerservice.EndpointDetail{ - // { - // Port: to.Ptr[int32](9000), - // Protocol: to.Ptr("TCP"), - // }}, - // }}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/GetGuardrailsVersions.json -func ExampleManagedClustersClient_GetGuardrailsVersions() { - 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().GetGuardrailsVersions(ctx, "location1", "v1.0.0", 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.GuardrailsAvailableVersion = armcontainerservice.GuardrailsAvailableVersion{ - // Name: to.Ptr("v1.0.0"), - // Type: to.Ptr("Microsoft.ContainerService/locations/guardrailsVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/guardrailsVersions/v1.0.0"), - // Properties: &armcontainerservice.GuardrailsAvailableVersionsProperties{ - // IsDefaultVersion: to.Ptr(true), - // Support: to.Ptr(armcontainerservice.GuardrailsSupportPreview), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ListGuardrailsVersions.json -func ExampleManagedClustersClient_NewListGuardrailsVersionsPager() { - 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.NewManagedClustersClient().NewListGuardrailsVersionsPager("location1", 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.GuardrailsAvailableVersionsList = armcontainerservice.GuardrailsAvailableVersionsList{ - // Value: []*armcontainerservice.GuardrailsAvailableVersion{ - // { - // Name: to.Ptr("v1.0.0"), - // Type: to.Ptr("Microsoft.ContainerService/locations/guardrailsVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/guardrailsVersions/v1.0.0"), - // Properties: &armcontainerservice.GuardrailsAvailableVersionsProperties{ - // IsDefaultVersion: to.Ptr(true), - // Support: to.Ptr(armcontainerservice.GuardrailsSupportPreview), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/GetSafeguardsVersions.json -func ExampleManagedClustersClient_GetSafeguardsVersions() { - 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().GetSafeguardsVersions(ctx, "location1", "v1.0.0", 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.SafeguardsAvailableVersion = armcontainerservice.SafeguardsAvailableVersion{ - // Name: to.Ptr("v1.0.0"), - // Type: to.Ptr("Microsoft.ContainerService/locations/safeguardsVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/safeguardsVersions/v1.0.0"), - // Properties: &armcontainerservice.SafeguardsAvailableVersionsProperties{ - // IsDefaultVersion: to.Ptr(true), - // Support: to.Ptr(armcontainerservice.SafeguardsSupportPreview), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ListSafeguardsVersions.json -func ExampleManagedClustersClient_NewListSafeguardsVersionsPager() { - 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.NewManagedClustersClient().NewListSafeguardsVersionsPager("location1", 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.SafeguardsAvailableVersionsList = armcontainerservice.SafeguardsAvailableVersionsList{ - // Value: []*armcontainerservice.SafeguardsAvailableVersion{ - // { - // Name: to.Ptr("v1.0.0"), - // Type: to.Ptr("Microsoft.ContainerService/locations/safeguardsVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/safeguardsVersions/v1.0.0"), - // Properties: &armcontainerservice.SafeguardsAvailableVersionsProperties{ - // IsDefaultVersion: to.Ptr(true), - // Support: to.Ptr(armcontainerservice.SafeguardsSupportPreview), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersList_MeshRevisionProfiles.json -func ExampleManagedClustersClient_NewListMeshRevisionProfilesPager() { - 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.NewManagedClustersClient().NewListMeshRevisionProfilesPager("location1", 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.MeshRevisionProfileList = armcontainerservice.MeshRevisionProfileList{ - // Value: []*armcontainerservice.MeshRevisionProfile{ - // { - // Name: to.Ptr("istio"), - // Type: to.Ptr("Microsoft.ContainerService/locations/meshRevisionProfiles"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/meshRevisionProfiles/istio"), - // Properties: &armcontainerservice.MeshRevisionProfileProperties{ - // MeshRevisions: []*armcontainerservice.MeshRevision{ - // { - // CompatibleWith: []*armcontainerservice.CompatibleVersions{ - // { - // Name: to.Ptr("kubernetes"), - // Versions: []*string{ - // to.Ptr("1.23"), - // to.Ptr("1.24"), - // to.Ptr("1.25"), - // to.Ptr("1.26")}, - // }}, - // Revision: to.Ptr("asm-1-17"), - // Upgrades: []*string{ - // to.Ptr("1-18")}, - // }, - // { - // CompatibleWith: []*armcontainerservice.CompatibleVersions{ - // { - // Name: to.Ptr("kubernetes"), - // Versions: []*string{ - // to.Ptr("1.24"), - // to.Ptr("1.25"), - // to.Ptr("1.26"), - // to.Ptr("1.27")}, - // }}, - // Revision: to.Ptr("asm-1-18"), - // Upgrades: []*string{ - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersGet_MeshRevisionProfile.json -func ExampleManagedClustersClient_GetMeshRevisionProfile() { - 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().GetMeshRevisionProfile(ctx, "location1", "istio", 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.MeshRevisionProfile = armcontainerservice.MeshRevisionProfile{ - // Name: to.Ptr("istio"), - // Type: to.Ptr("Microsoft.ContainerService/locations/meshRevisionProfiles"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/meshRevisionProfiles/istio"), - // Properties: &armcontainerservice.MeshRevisionProfileProperties{ - // MeshRevisions: []*armcontainerservice.MeshRevision{ - // { - // CompatibleWith: []*armcontainerservice.CompatibleVersions{ - // { - // Name: to.Ptr("kubernetes"), - // Versions: []*string{ - // to.Ptr("1.23"), - // to.Ptr("1.24"), - // to.Ptr("1.25"), - // to.Ptr("1.26")}, - // }}, - // Revision: to.Ptr("asm-1-17"), - // Upgrades: []*string{ - // to.Ptr("1-18")}, - // }, - // { - // CompatibleWith: []*armcontainerservice.CompatibleVersions{ - // { - // Name: to.Ptr("kubernetes"), - // Versions: []*string{ - // to.Ptr("1.24"), - // to.Ptr("1.25"), - // to.Ptr("1.26"), - // to.Ptr("1.27")}, - // }}, - // Revision: to.Ptr("asm-1-18"), - // Upgrades: []*string{ - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersList_MeshUpgradeProfiles.json -func ExampleManagedClustersClient_NewListMeshUpgradeProfilesPager() { - 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.NewManagedClustersClient().NewListMeshUpgradeProfilesPager("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.MeshUpgradeProfileList = armcontainerservice.MeshUpgradeProfileList{ - // Value: []*armcontainerservice.MeshUpgradeProfile{ - // { - // Name: to.Ptr("istio"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/meshUpgradeProfiles"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/meshUpgradeProfiles/istio"), - // Properties: &armcontainerservice.MeshUpgradeProfileProperties{ - // CompatibleWith: []*armcontainerservice.CompatibleVersions{ - // { - // Name: to.Ptr("kubernetes"), - // Versions: []*string{ - // to.Ptr("1.23"), - // to.Ptr("1.24"), - // to.Ptr("1.25"), - // to.Ptr("1.26")}, - // }}, - // Revision: to.Ptr("asm-1-17"), - // Upgrades: []*string{ - // to.Ptr("1-18")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ManagedClustersGet_MeshUpgradeProfile.json -func ExampleManagedClustersClient_GetMeshUpgradeProfile() { - 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().GetMeshUpgradeProfile(ctx, "rg1", "clustername1", "istio", 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.MeshUpgradeProfile = armcontainerservice.MeshUpgradeProfile{ - // Name: to.Ptr("istio"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/meshUpgradeProfiles"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/meshUpgradeProfiles/istio"), - // Properties: &armcontainerservice.MeshUpgradeProfileProperties{ - // CompatibleWith: []*armcontainerservice.CompatibleVersions{ - // { - // Name: to.Ptr("kubernetes"), - // Versions: []*string{ - // to.Ptr("1.23"), - // to.Ptr("1.24"), - // to.Ptr("1.25"), - // to.Ptr("1.26")}, - // }}, - // Revision: to.Ptr("asm-1-17"), - // Upgrades: []*string{ - // to.Ptr("1-18")}, - // }, - // } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go index b63d7a513f58..83c6cda6b76a 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go @@ -46,7 +46,7 @@ func NewManagedClusterSnapshotsClient(subscriptionID string, credential azcore.T // CreateOrUpdate - Creates or updates a managed cluster snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-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. @@ -94,7 +94,7 @@ func (client *ManagedClusterSnapshotsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -115,7 +115,7 @@ func (client *ManagedClusterSnapshotsClient) createOrUpdateHandleResponse(resp * // Delete - Deletes a managed cluster snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-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 @@ -161,7 +161,7 @@ func (client *ManagedClusterSnapshotsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,7 +170,7 @@ func (client *ManagedClusterSnapshotsClient) deleteCreateRequest(ctx context.Con // Get - Gets a managed cluster snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-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 @@ -217,7 +217,7 @@ func (client *ManagedClusterSnapshotsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +234,7 @@ func (client *ManagedClusterSnapshotsClient) getHandleResponse(resp *http.Respon // NewListPager - Gets a list of managed cluster snapshots in the specified subscription. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - options - ManagedClusterSnapshotsClientListOptions contains the optional parameters for the ManagedClusterSnapshotsClient.NewListPager // method. func (client *ManagedClusterSnapshotsClient) NewListPager(options *ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse] { @@ -272,7 +272,7 @@ func (client *ManagedClusterSnapshotsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -289,7 +289,7 @@ func (client *ManagedClusterSnapshotsClient) listHandleResponse(resp *http.Respo // NewListByResourceGroupPager - Lists managed cluster snapshots in the specified subscription and resource group. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-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. @@ -332,7 +332,7 @@ func (client *ManagedClusterSnapshotsClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +350,7 @@ func (client *ManagedClusterSnapshotsClient) listByResourceGroupHandleResponse(r // UpdateTags - Updates tags on a managed cluster snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-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. @@ -398,7 +398,7 @@ func (client *ManagedClusterSnapshotsClient) updateTagsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") 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/managedclustersnapshots_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client_example_test.go deleted file mode 100644 index 73d78027ca5b..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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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.298Z"); 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/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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.298Z"); 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/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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.298Z"); 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/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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.298Z"); 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/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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.298Z"); 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/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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 9e45d38b43c4..e5eb884e4eac 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/models.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/models.go @@ -25,6 +25,20 @@ type AccessProfile struct { KubeConfig []byte } +// AdvancedNetworking - Advanced Networking profile for enabling observability on a cluster. Note that enabling advanced networking +// features may incur additional costs. For more information see aka.ms/aksadvancednetworking. +type AdvancedNetworking struct { + // Observability profile to enable advanced network metrics and flow logs with historical contexts. + Observability *AdvancedNetworkingObservability +} + +// AdvancedNetworkingObservability - Observability profile to enable advanced network metrics and flow logs with historical +// contexts. +type AdvancedNetworkingObservability struct { + // Indicates the enablement of Advanced Networking observability functionalities on clusters. + Enabled *bool +} + // AgentPool - Agent Pool. type AgentPool struct { // Properties of an agent pool. @@ -163,6 +177,9 @@ type AgentPoolUpgradeProfileProperties struct { // REQUIRED; The operating system type. The default is Linux. OSType *OSType + // components of given Kubernetes version. + ComponentsByReleases *ComponentsByReleases + // The latest AKS supported node image version. LatestNodeImageVersion *string @@ -195,6 +212,11 @@ type AgentPoolUpgradeSettings struct { // The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not // specified, the default is 0 minutes. NodeSoakDurationInMinutes *int32 + + // Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + // Budgets (PDBs), but other issues, such as pod termination grace period is + // exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. + UndrainableNodeBehavior *UndrainableNodeBehavior } // AgentPoolWindowsProfile - The Windows agent pool's specific profile. @@ -204,6 +226,20 @@ type AgentPoolWindowsProfile struct { DisableOutboundNat *bool } +// AutoScaleProfile - Specifications on auto-scaling. +type AutoScaleProfile struct { + // The maximum number of nodes of the specified sizes. + MaxCount *int32 + + // The minimum number of nodes of the specified sizes. + MinCount *int32 + + // The list of allowed vm sizes e.g. ['StandardE4sv3', 'StandardE16sv3', 'StandardD16sv5']. AKS will use the first available + // one when auto scaling. If a VM size is unavailable (e.g. due to quota or + // regional capacity reasons), AKS will use the next size. + Sizes []*string +} + // 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. @@ -261,6 +297,28 @@ type CompatibleVersions struct { Versions []*string } +type Component struct { + // If upgraded component version contains breaking changes from the current version. To see a detailed description of what + // the breaking changes are, visit + // https://learn.microsoft.com/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version. + HasBreakingChanges *bool + + // Component name. + Name *string + + // Component version. + Version *string +} + +// ComponentsByReleases - components of given Kubernetes version. +type ComponentsByReleases struct { + // components of current or upgraded Kubernetes version in the cluster. + Components []*Component + + // The Kubernetes version (major.minor). + KubernetesVersion *string +} + // CreationData - Data used when creating a target resource from a source resource. type CreationData struct { // This is the ARM ID of the source object to be used to create the target object. @@ -561,6 +619,32 @@ type KubernetesVersionListResult struct { Values []*KubernetesVersion } +// LabelSelector - A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions +// are ANDed. An empty label selector matches all objects. A null label selector matches no +// objects. +type LabelSelector struct { + // matchExpressions is a list of label selector requirements. The requirements are ANDed. + MatchExpressions []*LabelSelectorRequirement + + // matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of + // matchExpressions, whose key field is key, the operator is In, and the values + // array contains only value. The requirements are ANDed. + MatchLabels []*string +} + +// LabelSelectorRequirement - A label selector requirement is a selector that contains values, a key, and an operator that +// relates the key and values. +type LabelSelectorRequirement struct { + // key is the label key that the selector applies to. + Key *string + + // operator represents a key's relationship to a set of values. Valid operators are In and NotIn + Operator *Operator + + // values is an array of string values, the values array must be non-empty. + Values []*string +} + // LinuxOSConfig - See AKS custom node configuration [https://docs.microsoft.com/azure/aks/custom-node-configuration] for // more details. type LinuxOSConfig struct { @@ -589,6 +673,64 @@ type LinuxProfile struct { SSH *SSHConfiguration } +// LoadBalancer - The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode +// will be used. Multiple standard load balancers mode will be used if at lease one configuration +// is supplied. There has to be a configuration named kubernetes. +type LoadBalancer struct { + // The properties of the load balancer. + Properties *LoadBalancerProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// LoadBalancerListResult - The response from the List Load Balancers operation. +type LoadBalancerListResult struct { + // The list of Load Balancers. + Value []*LoadBalancer + + // READ-ONLY; The URL to get the next set of load balancer results. + NextLink *string +} + +type LoadBalancerProperties struct { + // REQUIRED; Name of the public load balancer. There will be an internal load balancer created if needed, and the name will + // be -internal. The internal lb shares the same configurations as the external one. + // The internal lbs are not needed to be included in LoadBalancer list. There must be a name of kubernetes in the list. + Name *string + + // REQUIRED; Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool + // will always be added to this load balancer. This agent pool must have at least one node + // and minCount>=1 for autoscaling operations. An agent pool can only be the primary pool for a single load balancer. + PrimaryAgentPoolName *string + + // Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false + // manually, both of the external and the internal load balancer will not be + // selected for services unless they explicitly target it. + AllowServicePlacement *bool + + // Nodes that match this selector will be possible members of this load balancer. + NodeSelector *LabelSelector + + // Only services that must match this selector can be placed on this load balancer. + ServiceLabelSelector *LabelSelector + + // Services created in namespaces that match the selector can be placed on this load balancer. + ServiceNamespaceSelector *LabelSelector + + // READ-ONLY; The current provisioning state. + ProvisioningState *string +} + // Machine - A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl // get nodes; if so it may be because the machine has not been registered with the // Kubernetes API Server yet. @@ -729,6 +871,11 @@ type ManagedCluster struct { // Resource tags. Tags map[string]*string + // READ-ONLY; Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource + // is updated. Specify an if-match or if-none-match header with the eTag value for a + // subsequent request to enable optimistic concurrency per the normal etag convention. + ETag *string + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string @@ -1050,6 +1197,11 @@ type ManagedClusterAgentPoolProfile struct { // was , this field will contain the full version being used. CurrentOrchestratorVersion *string + // READ-ONLY; Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource + // is updated. Specify an if-match or if-none-match header with the eTag value for a + // subsequent request to enable optimistic concurrency per the normal etag convention. + ETag *string + // READ-ONLY; The version of node image NodeImageVersion *string @@ -1254,6 +1406,11 @@ type ManagedClusterAgentPoolProfileProperties struct { // was , this field will contain the full version being used. CurrentOrchestratorVersion *string + // READ-ONLY; Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource + // is updated. Specify an if-match or if-none-match header with the eTag value for a + // subsequent request to enable optimistic concurrency per the normal etag convention. + ETag *string + // READ-ONLY; The version of node image NodeImageVersion *string @@ -1657,6 +1814,9 @@ type ManagedClusterPoolUpgradeProfile struct { // REQUIRED; The operating system type. The default is Linux. OSType *OSType + // components of given Kubernetes version. + ComponentsByReleases *ComponentsByReleases + // The Agent Pool name. Name *string @@ -2201,8 +2361,9 @@ type ManualScaleProfile struct { // Number of nodes. Count *int32 - // The list of allowed vm sizes. AKS will use the first available one when scaling. If a VM size is unavailable (e.g. due - // to quota or regional capacity reasons), AKS will use the next size. + // The list of allowed vm sizes e.g. ['StandardE4sv3', 'StandardE16sv3', 'StandardD16sv5']. AKS will use the first available + // one when scaling. If a VM size is unavailable (e.g. due to quota or regional + // capacity reasons), AKS will use the next size. Sizes []*string } @@ -2298,6 +2459,10 @@ type NetworkMonitoring struct { // NetworkProfile - Profile of network configuration. type NetworkProfile struct { + // Advanced Networking profile for enabling observability on a cluster. Note that enabling advanced networking features may + // incur additional costs. For more information see aka.ms/aksadvancednetworking. + AdvancedNetworking *AdvancedNetworking + // An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified // in serviceCidr. DNSServiceIP *string @@ -2351,6 +2516,10 @@ type NetworkProfile struct { // networking. PodCidrs []*string + // Defines access to special link local addresses (Azure Instance Metadata Service, aka IMDS) for pods with hostNetwork=false. + // if not specified, the default is 'IMDS'. + PodLinkLocalAccess *PodLinkLocalAccess + // A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. ServiceCidr *string @@ -2625,6 +2794,13 @@ type PrivateLinkServiceConnectionState struct { Status *ConnectionStatus } +// RebalanceLoadBalancersRequestBody - The names of the load balancers to rebalance. If set to empty, all load balancers will +// be rebalanced. +type RebalanceLoadBalancersRequestBody struct { + // The load balancer names list. + LoadBalancerNames []*string +} + // RelativeMonthlySchedule - For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last // Friday'. type RelativeMonthlySchedule struct { @@ -2732,7 +2908,12 @@ type SafeguardsProfile struct { // ScaleProfile - Specifications on how to scale a VirtualMachines agent pool. type ScaleProfile struct { - // Specifications on how to scale the VirtualMachines agent pool to a fixed size. + // Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most one + // AutoScaleProfile is allowed. + Autoscale []*AutoScaleProfile + + // Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + // is allowed. Manual []*ManualScaleProfile } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/models_serde.go b/sdk/resourcemanager/containerservice/armcontainerservice/models_serde.go index db58051762ee..4b45a53215cf 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/models_serde.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/models_serde.go @@ -78,6 +78,60 @@ func (a *AccessProfile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AdvancedNetworking. +func (a AdvancedNetworking) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "observability", a.Observability) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedNetworking. +func (a *AdvancedNetworking) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "observability": + err = unpopulate(val, "Observability", &a.Observability) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AdvancedNetworkingObservability. +func (a AdvancedNetworkingObservability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", a.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedNetworkingObservability. +func (a *AdvancedNetworkingObservability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AgentPool. func (a AgentPool) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -469,6 +523,7 @@ func (a *AgentPoolUpgradeProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AgentPoolUpgradeProfileProperties. func (a AgentPoolUpgradeProfileProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "componentsByReleases", a.ComponentsByReleases) populate(objectMap, "kubernetesVersion", a.KubernetesVersion) populate(objectMap, "latestNodeImageVersion", a.LatestNodeImageVersion) populate(objectMap, "osType", a.OSType) @@ -485,6 +540,9 @@ func (a *AgentPoolUpgradeProfileProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "componentsByReleases": + err = unpopulate(val, "ComponentsByReleases", &a.ComponentsByReleases) + delete(rawMsg, key) case "kubernetesVersion": err = unpopulate(val, "KubernetesVersion", &a.KubernetesVersion) delete(rawMsg, key) @@ -542,6 +600,7 @@ func (a AgentPoolUpgradeSettings) MarshalJSON() ([]byte, error) { populate(objectMap, "drainTimeoutInMinutes", a.DrainTimeoutInMinutes) populate(objectMap, "maxSurge", a.MaxSurge) populate(objectMap, "nodeSoakDurationInMinutes", a.NodeSoakDurationInMinutes) + populate(objectMap, "undrainableNodeBehavior", a.UndrainableNodeBehavior) return json.Marshal(objectMap) } @@ -563,6 +622,9 @@ func (a *AgentPoolUpgradeSettings) UnmarshalJSON(data []byte) error { case "nodeSoakDurationInMinutes": err = unpopulate(val, "NodeSoakDurationInMinutes", &a.NodeSoakDurationInMinutes) delete(rawMsg, key) + case "undrainableNodeBehavior": + err = unpopulate(val, "UndrainableNodeBehavior", &a.UndrainableNodeBehavior) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -598,6 +660,41 @@ func (a *AgentPoolWindowsProfile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AutoScaleProfile. +func (a AutoScaleProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxCount", a.MaxCount) + populate(objectMap, "minCount", a.MinCount) + populate(objectMap, "sizes", a.Sizes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoScaleProfile. +func (a *AutoScaleProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxCount": + err = unpopulate(val, "MaxCount", &a.MaxCount) + delete(rawMsg, key) + case "minCount": + err = unpopulate(val, "MinCount", &a.MinCount) + delete(rawMsg, key) + case "sizes": + err = unpopulate(val, "Sizes", &a.Sizes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AzureKeyVaultKms. func (a AzureKeyVaultKms) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -742,6 +839,72 @@ func (c *CompatibleVersions) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Component. +func (c Component) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hasBreakingChanges", c.HasBreakingChanges) + populate(objectMap, "name", c.Name) + populate(objectMap, "version", c.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Component. +func (c *Component) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hasBreakingChanges": + err = unpopulate(val, "HasBreakingChanges", &c.HasBreakingChanges) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &c.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentsByReleases. +func (c ComponentsByReleases) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "components", c.Components) + populate(objectMap, "kubernetesVersion", c.KubernetesVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentsByReleases. +func (c *ComponentsByReleases) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "components": + err = unpopulate(val, "Components", &c.Components) + delete(rawMsg, key) + case "kubernetesVersion": + err = unpopulate(val, "KubernetesVersion", &c.KubernetesVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CreationData. func (c CreationData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1624,6 +1787,72 @@ func (k *KubernetesVersionListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LabelSelector. +func (l LabelSelector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "matchExpressions", l.MatchExpressions) + populate(objectMap, "matchLabels", l.MatchLabels) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelSelector. +func (l *LabelSelector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchExpressions": + err = unpopulate(val, "MatchExpressions", &l.MatchExpressions) + delete(rawMsg, key) + case "matchLabels": + err = unpopulate(val, "MatchLabels", &l.MatchLabels) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelSelectorRequirement. +func (l LabelSelectorRequirement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", l.Key) + populate(objectMap, "operator", l.Operator) + populate(objectMap, "values", l.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelSelectorRequirement. +func (l *LabelSelectorRequirement) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "key": + err = unpopulate(val, "Key", &l.Key) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &l.Operator) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &l.Values) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type LinuxOSConfig. func (l LinuxOSConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1694,6 +1923,131 @@ func (l *LinuxProfile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LoadBalancer. +func (l LoadBalancer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancer. +func (l *LoadBalancer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LoadBalancerListResult. +func (l LoadBalancerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerListResult. +func (l *LoadBalancerListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LoadBalancerProperties. +func (l LoadBalancerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowServicePlacement", l.AllowServicePlacement) + populate(objectMap, "name", l.Name) + populate(objectMap, "nodeSelector", l.NodeSelector) + populate(objectMap, "primaryAgentPoolName", l.PrimaryAgentPoolName) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "serviceLabelSelector", l.ServiceLabelSelector) + populate(objectMap, "serviceNamespaceSelector", l.ServiceNamespaceSelector) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerProperties. +func (l *LoadBalancerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowServicePlacement": + err = unpopulate(val, "AllowServicePlacement", &l.AllowServicePlacement) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "nodeSelector": + err = unpopulate(val, "NodeSelector", &l.NodeSelector) + delete(rawMsg, key) + case "primaryAgentPoolName": + err = unpopulate(val, "PrimaryAgentPoolName", &l.PrimaryAgentPoolName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "serviceLabelSelector": + err = unpopulate(val, "ServiceLabelSelector", &l.ServiceLabelSelector) + delete(rawMsg, key) + case "serviceNamespaceSelector": + err = unpopulate(val, "ServiceNamespaceSelector", &l.ServiceNamespaceSelector) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Machine. func (m Machine) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2012,6 +2366,7 @@ func (m *MaintenanceWindow) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedCluster. func (m ManagedCluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "eTag", m.ETag) populate(objectMap, "extendedLocation", m.ExtendedLocation) populate(objectMap, "id", m.ID) populate(objectMap, "identity", m.Identity) @@ -2035,6 +2390,9 @@ func (m *ManagedCluster) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "eTag": + err = unpopulate(val, "ETag", &m.ETag) + delete(rawMsg, key) case "extendedLocation": err = unpopulate(val, "ExtendedLocation", &m.ExtendedLocation) delete(rawMsg, key) @@ -2335,6 +2693,7 @@ func (m ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { populate(objectMap, "count", m.Count) populate(objectMap, "creationData", m.CreationData) populate(objectMap, "currentOrchestratorVersion", m.CurrentOrchestratorVersion) + populate(objectMap, "eTag", m.ETag) populate(objectMap, "enableAutoScaling", m.EnableAutoScaling) populate(objectMap, "enableCustomCATrust", m.EnableCustomCATrust) populate(objectMap, "enableEncryptionAtHost", m.EnableEncryptionAtHost) @@ -2414,6 +2773,9 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { case "currentOrchestratorVersion": err = unpopulate(val, "CurrentOrchestratorVersion", &m.CurrentOrchestratorVersion) delete(rawMsg, key) + case "eTag": + err = unpopulate(val, "ETag", &m.ETag) + delete(rawMsg, key) case "enableAutoScaling": err = unpopulate(val, "EnableAutoScaling", &m.EnableAutoScaling) delete(rawMsg, key) @@ -2578,6 +2940,7 @@ func (m ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) populate(objectMap, "count", m.Count) populate(objectMap, "creationData", m.CreationData) populate(objectMap, "currentOrchestratorVersion", m.CurrentOrchestratorVersion) + populate(objectMap, "eTag", m.ETag) populate(objectMap, "enableAutoScaling", m.EnableAutoScaling) populate(objectMap, "enableCustomCATrust", m.EnableCustomCATrust) populate(objectMap, "enableEncryptionAtHost", m.EnableEncryptionAtHost) @@ -2656,6 +3019,9 @@ func (m *ManagedClusterAgentPoolProfileProperties) UnmarshalJSON(data []byte) er case "currentOrchestratorVersion": err = unpopulate(val, "CurrentOrchestratorVersion", &m.CurrentOrchestratorVersion) delete(rawMsg, key) + case "eTag": + err = unpopulate(val, "ETag", &m.ETag) + delete(rawMsg, key) case "enableAutoScaling": err = unpopulate(val, "EnableAutoScaling", &m.EnableAutoScaling) delete(rawMsg, key) @@ -3875,6 +4241,7 @@ func (m *ManagedClusterPodIdentityProvisioningInfo) UnmarshalJSON(data []byte) e // MarshalJSON implements the json.Marshaller interface for type ManagedClusterPoolUpgradeProfile. func (m ManagedClusterPoolUpgradeProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "componentsByReleases", m.ComponentsByReleases) populate(objectMap, "kubernetesVersion", m.KubernetesVersion) populate(objectMap, "name", m.Name) populate(objectMap, "osType", m.OSType) @@ -3891,6 +4258,9 @@ func (m *ManagedClusterPoolUpgradeProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "componentsByReleases": + err = unpopulate(val, "ComponentsByReleases", &m.ComponentsByReleases) + delete(rawMsg, key) case "kubernetesVersion": err = unpopulate(val, "KubernetesVersion", &m.KubernetesVersion) delete(rawMsg, key) @@ -5429,6 +5799,7 @@ func (n *NetworkMonitoring) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type NetworkProfile. func (n NetworkProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "advancedNetworking", n.AdvancedNetworking) populate(objectMap, "dnsServiceIP", n.DNSServiceIP) populate(objectMap, "ipFamilies", n.IPFamilies) populate(objectMap, "kubeProxyConfig", n.KubeProxyConfig) @@ -5444,6 +5815,7 @@ func (n NetworkProfile) MarshalJSON() ([]byte, error) { populate(objectMap, "outboundType", n.OutboundType) populate(objectMap, "podCidr", n.PodCidr) populate(objectMap, "podCidrs", n.PodCidrs) + populate(objectMap, "podLinkLocalAccess", n.PodLinkLocalAccess) populate(objectMap, "serviceCidr", n.ServiceCidr) populate(objectMap, "serviceCidrs", n.ServiceCidrs) populate(objectMap, "staticEgressGatewayProfile", n.StaticEgressGatewayProfile) @@ -5459,6 +5831,9 @@ func (n *NetworkProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "advancedNetworking": + err = unpopulate(val, "AdvancedNetworking", &n.AdvancedNetworking) + delete(rawMsg, key) case "dnsServiceIP": err = unpopulate(val, "DNSServiceIP", &n.DNSServiceIP) delete(rawMsg, key) @@ -5504,6 +5879,9 @@ func (n *NetworkProfile) UnmarshalJSON(data []byte) error { case "podCidrs": err = unpopulate(val, "PodCidrs", &n.PodCidrs) delete(rawMsg, key) + case "podLinkLocalAccess": + err = unpopulate(val, "PodLinkLocalAccess", &n.PodLinkLocalAccess) + delete(rawMsg, key) case "serviceCidr": err = unpopulate(val, "ServiceCidr", &n.ServiceCidr) delete(rawMsg, key) @@ -6283,6 +6661,33 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RebalanceLoadBalancersRequestBody. +func (r RebalanceLoadBalancersRequestBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "loadBalancerNames", r.LoadBalancerNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RebalanceLoadBalancersRequestBody. +func (r *RebalanceLoadBalancersRequestBody) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "loadBalancerNames": + err = unpopulate(val, "LoadBalancerNames", &r.LoadBalancerNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RelativeMonthlySchedule. func (r RelativeMonthlySchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -6612,6 +7017,7 @@ func (s *SafeguardsProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScaleProfile. func (s ScaleProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "autoscale", s.Autoscale) populate(objectMap, "manual", s.Manual) return json.Marshal(objectMap) } @@ -6625,6 +7031,9 @@ func (s *ScaleProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "autoscale": + err = unpopulate(val, "Autoscale", &s.Autoscale) + delete(rawMsg, key) case "manual": err = unpopulate(val, "Manual", &s.Manual) delete(rawMsg, key) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/operations_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/operations_client.go index 78489a21345f..6203e8bde32f 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/operations_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Gets a list of operations. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -73,7 +73,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/operations_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/operations_client_example_test.go deleted file mode 100644 index b563f2dc4d72..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/operations_client_example_test.go +++ /dev/null @@ -1,3616 +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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/Operation_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armcontainerservice.OperationListResult{ - // Value: []*armcontainerservice.OperationValue{ - // { - // Name: to.Ptr("Microsoft.ContainerService/locations/operations/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Gets the status of an asynchronous operation"), - // Operation: to.Ptr("Get Operation"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Operation"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/locations/orchestrators/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Lists the supported orchestrators"), - // Operation: to.Ptr("List Orchestrators"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Orchestrator"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/locations/osOptions/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Gets OS options"), - // Operation: to.Ptr("Get OS Options"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("OSOptions"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/operations/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Lists operations available on Microsoft.ContainerService resource provider"), - // Operation: to.Ptr("List Available Container Service Operations"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Available Container Service Operations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/register/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Registers Subscription with Microsoft.ContainerService resource provider"), - // Operation: to.Ptr("Register Subscription for Container Service"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Container Service Register Subscription"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/unregister/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Unregisters Subscription with Microsoft.ContainerService resource provider"), - // Operation: to.Ptr("Unregister Subscription for Container Service"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Container Service Unregister Subscription"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/locations/operationresults/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Gets the status of an asynchronous operation result"), - // Operation: to.Ptr("Get Operation Result"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("OperationResult"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/containerServices/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Get a container service"), - // Operation: to.Ptr("Get Container Service"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Container Services"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/containerServices/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Creates a new container service or updates an existing one"), - // Operation: to.Ptr("Create or Update Container Service"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Container Services"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/containerServices/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes a container service"), - // Operation: to.Ptr("Delete Container Service"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Container Services"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Get a managed cluster"), - // Operation: to.Ptr("Get Managed Cluster"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Creates a new managed cluster or updates an existing one"), - // Operation: to.Ptr("Create or Update Managed Cluster"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes a managed cluster"), - // Operation: to.Ptr("Delete Managed Cluster"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/start/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Starts a managed cluster"), - // Operation: to.Ptr("Start Managed Cluster"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/stop/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Stops a managed cluster"), - // Operation: to.Ptr("Stop Managed Cluster"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/maintenanceConfigurations/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Gets a maintenance configuration"), - // Operation: to.Ptr("Get a maintenance configuration"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Maintenance Configurations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/maintenanceConfigurations/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Creates a new MaintenanceConfiguration or updates an existing one"), - // Operation: to.Ptr("Create or Update maintenance configuratio"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Maintenance Configurations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/maintenanceConfigurations/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes a maintenance configuration"), - // Operation: to.Ptr("Delete Maintenance Configuration"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Maintenance Configurations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Gets an agent pool"), - // Operation: to.Ptr("Get Agent Pool"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Agent Pools"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Creates a new agent pool or updates an existing one"), - // Operation: to.Ptr("Create or Update Agent Pool"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Agent Pools"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes an agent pool"), - // Operation: to.Ptr("Delete Agent Pool"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Agent Pools"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools/upgradeProfiles/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Gets the upgrade profile of the Agent Pool"), - // Operation: to.Ptr("Get Agent Pool UpgradeProfile"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Agent Pools"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools/upgradeNodeImageVersion/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Upgrade the node image version of agent pool"), - // Operation: to.Ptr("Upgrade agent pool node image version"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Agent Pools"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/availableAgentPoolVersions/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Gets the available agent pool versions of the cluster"), - // Operation: to.Ptr("Get Available Agent Pool Versions"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/accessProfiles/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Get a managed cluster access profile by role name"), - // Operation: to.Ptr("Get Managed Cluster AccessProfile"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/accessProfiles/listCredential/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Get a managed cluster access profile by role name using list credential"), - // Operation: to.Ptr("Get Managed Cluster AccessProfile by List Credential"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/upgradeProfiles/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Gets the upgrade profile of the cluster"), - // Operation: to.Ptr("Get UpgradeProfile"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("UpgradeProfile"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/listClusterAdminCredential/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("List the clusterAdmin credential of a managed cluster"), - // Operation: to.Ptr("List clusterAdmin credential"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/listClusterUserCredential/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("List the clusterUser credential of a managed cluster"), - // Operation: to.Ptr("List clusterUser credential"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/listClusterMonitoringUserCredential/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("List the clusterMonitoringUser credential of a managed cluster"), - // Operation: to.Ptr("List clusterMonitoringUser credential"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/resetServicePrincipalProfile/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reset the service principal profile of a managed cluster"), - // Operation: to.Ptr("Reset service principal profile"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/resolvePrivateLinkServiceId/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Resolve the private link service id of a managed cluster"), - // Operation: to.Ptr("Resolve private link service id"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/resetAADProfile/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reset the AAD profile of a managed cluster"), - // Operation: to.Ptr("Reset AAD profile"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rotateClusterCertificates/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Rotate certificates of a managed cluster"), - // Operation: to.Ptr("Rotate certificates of the cluster"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/runCommand/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Run user issued command against managed kubernetes server."), - // Operation: to.Ptr("RunCommand"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/commandResults/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Retrieve result from previous issued command."), - // Operation: to.Ptr("CommandResult"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Get the diagnostic setting for a managed cluster resource"), - // Operation: to.Ptr("Read Diagnostic Setting"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for a managed cluster resource"), - // Operation: to.Ptr("Write Diagnostic Setting"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Clusters"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/detectors/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Get Managed Cluster Detector"), - // Operation: to.Ptr("Get Managed Cluster Detector"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Managed Cluster Detector"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/diagnosticsState/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Gets the diagnostics state of the cluster"), - // Operation: to.Ptr("Get Diagnostics State"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Diagnostics State"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/privateEndpointConnectionsApproval/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Determines if user is allowed to approve a private endpoint connection"), - // Operation: to.Ptr("Approve Private Endpoint Connections"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Approve Private Endpoint Connections"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/privateEndpointConnections/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Get private endpoint connection"), - // Operation: to.Ptr("Get private endpoint connection"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Private Endpoint Connections"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/privateEndpointConnections/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Approve or Reject a private endpoint connection"), - // Operation: to.Ptr("Update private endpoint connection"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Private Endpoint Connections"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/privateEndpointConnections/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Delete private endpoint connection"), - // Operation: to.Ptr("Delete private endpoint connection"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Private Endpoint Connections"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensionaddons/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Gets an extension addon"), - // Operation: to.Ptr("Get an extension addon"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("ExtensionAddons"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensionaddons/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Creates a new extension addon or updates an existing one"), - // Operation: to.Ptr("Create or Update extension addon"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("ExtensionAddons"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensionaddons/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes an extension addon"), - // Operation: to.Ptr("Delete an extension addon"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("ExtensionAddons"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/snapshots/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Get a snapshot"), - // Operation: to.Ptr("Get Snapshot"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Snapshots"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/snapshots/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Creates a new snapshot"), - // Operation: to.Ptr("Create Snapshot"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Snapshots"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/snapshots/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes a snapshot"), - // Operation: to.Ptr("Delete Snapshot"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Snapshots"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/eventGridFilters/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Get eventgrid filter"), - // Operation: to.Ptr("Get eventgrid filter"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("EventGridFilters"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/eventGridFilters/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Create or Update eventgrid filter"), - // Operation: to.Ptr("Create or Update eventgrid filter"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("EventGridFilters"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/eventGridFilters/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Delete an eventgrid filter"), - // Operation: to.Ptr("Delete an eventgrid filter"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("EventGridFilters"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/admissionregistration.k8s.io/initializerconfigurations/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads initializerconfigurations"), - // Operation: to.Ptr("Gets/List initializerconfigurations resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Initializerconfigurations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/admissionregistration.k8s.io/initializerconfigurations/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes initializerconfigurations"), - // Operation: to.Ptr("Creates/Updates initializerconfigurations resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Initializerconfigurations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/admissionregistration.k8s.io/initializerconfigurations/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes/DeletesCollection initializerconfigurations resource"), - // Operation: to.Ptr("Initializerconfigurations"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Initializerconfigurations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/admissionregistration.k8s.io/mutatingwebhookconfigurations/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads mutatingwebhookconfigurations"), - // Operation: to.Ptr("Gets/List mutatingwebhookconfigurations resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Mutatingwebhookconfigurations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/admissionregistration.k8s.io/mutatingwebhookconfigurations/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes mutatingwebhookconfigurations"), - // Operation: to.Ptr("Creates/Updates mutatingwebhookconfigurations resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Mutatingwebhookconfigurations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/admissionregistration.k8s.io/mutatingwebhookconfigurations/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes mutatingwebhookconfigurations"), - // Operation: to.Ptr("Deletes/DeletesCollection mutatingwebhookconfigurations resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Mutatingwebhookconfigurations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/admissionregistration.k8s.io/validatingwebhookconfigurations/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads validatingwebhookconfigurations"), - // Operation: to.Ptr("Gets/List validatingwebhookconfigurations resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Validatingwebhookconfigurations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/admissionregistration.k8s.io/validatingwebhookconfigurations/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes validatingwebhookconfigurations"), - // Operation: to.Ptr("Creates/Updates validatingwebhookconfigurations resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Validatingwebhookconfigurations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/admissionregistration.k8s.io/validatingwebhookconfigurations/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes validatingwebhookconfigurations"), - // Operation: to.Ptr("Deletes/DeletesCollection validatingwebhookconfigurations resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Validatingwebhookconfigurations"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apiextensions.k8s.io/customresourcedefinitions/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads customresourcedefinitions"), - // Operation: to.Ptr("Gets/List customresourcedefinitions resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Customresourcedefinitions"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apiextensions.k8s.io/customresourcedefinitions/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes customresourcedefinitions"), - // Operation: to.Ptr("Creates/Updates customresourcedefinitions resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Customresourcedefinitions"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apiextensions.k8s.io/customresourcedefinitions/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes customresourcedefinitions"), - // Operation: to.Ptr("Deletes/DeletesCollection customresourcedefinitions resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Customresourcedefinitions"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apiregistration.k8s.io/apiservices/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiservices"), - // Operation: to.Ptr("Gets/List apiservices resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apiservices"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apiregistration.k8s.io/apiservices/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes apiservices"), - // Operation: to.Ptr("Creates/Updates apiservices resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apiservices"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apiregistration.k8s.io/apiservices/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes apiservices"), - // Operation: to.Ptr("Deletes/DeletesCollection apiservices resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apiservices"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/controllerrevisions/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads controllerrevisions"), - // Operation: to.Ptr("Gets/List controllerrevisions resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Controllerrevisions"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/controllerrevisions/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes controllerrevisions"), - // Operation: to.Ptr("Creates/Updates controllerrevisions resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Controllerrevisions"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/controllerrevisions/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes controllerrevisions"), - // Operation: to.Ptr("Deletes/DeletesCollection controllerrevisions resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Controllerrevisions"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/daemonsets/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads daemonsets"), - // Operation: to.Ptr("Gets/List daemonsets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Daemonsets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/daemonsets/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes daemonsets"), - // Operation: to.Ptr("Creates/Updates daemonsets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Daemonsets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/daemonsets/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes daemonsets"), - // Operation: to.Ptr("Deletes/DeletesCollection daemonsets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Daemonsets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/deployments/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads deployments"), - // Operation: to.Ptr("Gets/List deployments resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Deployments"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/deployments/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes deployments"), - // Operation: to.Ptr("Creates/Updates deployments resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Deployments"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/deployments/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes deployments"), - // Operation: to.Ptr("Deletes/DeletesCollection deployments resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Deployments"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/replicasets/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads replicasets"), - // Operation: to.Ptr("Gets/List replicasets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Replicasets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/replicasets/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes replicasets"), - // Operation: to.Ptr("Creates/Updates replicasets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Replicasets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/replicasets/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes replicasets"), - // Operation: to.Ptr("Deletes/DeletesCollection replicasets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Replicasets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/statefulsets/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads statefulsets"), - // Operation: to.Ptr("Gets/List statefulsets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Statefulsets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/statefulsets/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes statefulsets"), - // Operation: to.Ptr("Creates/Updates statefulsets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Statefulsets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apps/statefulsets/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes statefulsets"), - // Operation: to.Ptr("Deletes/DeletesCollection statefulsets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Statefulsets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/authentication.k8s.io/tokenreviews/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes tokenreviews"), - // Operation: to.Ptr("Creates/Updates tokenreviews resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Tokenreviews"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/authorization.k8s.io/localsubjectaccessreviews/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes localsubjectaccessreviews"), - // Operation: to.Ptr("Creates/Updates localsubjectaccessreviews resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Localsubjectaccessreviews"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/authorization.k8s.io/selfsubjectaccessreviews/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes selfsubjectaccessreviews"), - // Operation: to.Ptr("Creates/Updates selfsubjectaccessreviews resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Selfsubjectaccessreviews"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/authorization.k8s.io/selfsubjectrulesreviews/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes selfsubjectrulesreviews"), - // Operation: to.Ptr("Creates/Updates selfsubjectrulesreviews resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Selfsubjectrulesreviews"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/authorization.k8s.io/subjectaccessreviews/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes subjectaccessreviews"), - // Operation: to.Ptr("Creates/Updates subjectaccessreviews resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Subjectaccessreviews"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/autoscaling/horizontalpodautoscalers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads horizontalpodautoscalers"), - // Operation: to.Ptr("Gets/List horizontalpodautoscalers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Horizontalpodautoscalers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/autoscaling/horizontalpodautoscalers/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes horizontalpodautoscalers"), - // Operation: to.Ptr("Creates/Updates horizontalpodautoscalers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Horizontalpodautoscalers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/autoscaling/horizontalpodautoscalers/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes horizontalpodautoscalers"), - // Operation: to.Ptr("Deletes/DeletesCollection horizontalpodautoscalers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Horizontalpodautoscalers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/batch/cronjobs/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads cronjobs"), - // Operation: to.Ptr("Gets/List cronjobs resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Cronjobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/batch/cronjobs/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes cronjobs"), - // Operation: to.Ptr("Creates/Updates cronjobs resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Cronjobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/batch/cronjobs/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes cronjobs"), - // Operation: to.Ptr("Deletes/DeletesCollection cronjobs resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Cronjobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/batch/jobs/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads jobs"), - // Operation: to.Ptr("Gets/List jobs resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Jobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/batch/jobs/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes jobs"), - // Operation: to.Ptr("Creates/Updates jobs resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Jobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/batch/jobs/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes jobs"), - // Operation: to.Ptr("Deletes/DeletesCollection jobs resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Jobs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/certificates.k8s.io/certificatesigningrequests/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads certificatesigningrequests"), - // Operation: to.Ptr("Gets/List certificatesigningrequests resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Certificatesigningrequests"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/certificates.k8s.io/certificatesigningrequests/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes certificatesigningrequests"), - // Operation: to.Ptr("Creates/Updates certificatesigningrequests resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Certificatesigningrequests"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/certificates.k8s.io/certificatesigningrequests/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes certificatesigningrequests"), - // Operation: to.Ptr("Deletes/DeletesCollection certificatesigningrequests resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Certificatesigningrequests"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/coordination.k8s.io/leases/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads leases"), - // Operation: to.Ptr("Gets/List leases resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Leases"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/coordination.k8s.io/leases/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes leases"), - // Operation: to.Ptr("Creates/Updates leases resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Leases"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/coordination.k8s.io/leases/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes leases"), - // Operation: to.Ptr("Deletes/DeletesCollection leases resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Leases"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/bindings/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes bindings"), - // Operation: to.Ptr("Creates/Updates bindings resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Bindings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/componentstatuses/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads componentstatuses"), - // Operation: to.Ptr("Gets/List componentstatuses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Componentstatuses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/componentstatuses/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes componentstatuses"), - // Operation: to.Ptr("Creates/Updates componentstatuses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Componentstatuses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/componentstatuses/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes componentstatuses"), - // Operation: to.Ptr("Deletes/DeletesCollection componentstatuses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Componentstatuses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/configmaps/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads configmaps"), - // Operation: to.Ptr("Gets/List configmaps resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Configmaps"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/configmaps/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes configmaps"), - // Operation: to.Ptr("Creates/Updates configmaps resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Configmaps"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/configmaps/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes configmaps"), - // Operation: to.Ptr("Deletes/DeletesCollection configmaps resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Configmaps"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/endpoints/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads endpoints"), - // Operation: to.Ptr("Gets/List endpoints resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Endpoints"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/endpoints/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes endpoints"), - // Operation: to.Ptr("Creates/Updates endpoints resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Endpoints"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/endpoints/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes endpoints"), - // Operation: to.Ptr("Deletes/DeletesCollection endpoints resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Endpoints"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/events/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads events"), - // Operation: to.Ptr("Gets/List events resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Events"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/events/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes events"), - // Operation: to.Ptr("Creates/Updates events resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Events"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/events/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes events"), - // Operation: to.Ptr("Deletes/DeletesCollection events resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Events"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/limitranges/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads limitranges"), - // Operation: to.Ptr("Gets/List limitranges resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Limitranges"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/limitranges/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes limitranges"), - // Operation: to.Ptr("Creates/Updates limitranges resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Limitranges"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/limitranges/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes limitranges"), - // Operation: to.Ptr("Deletes/DeletesCollection limitranges resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Limitranges"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/namespaces/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads namespaces"), - // Operation: to.Ptr("Gets/List namespaces resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Namespaces"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/namespaces/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes namespaces"), - // Operation: to.Ptr("Creates/Updates namespaces resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Namespaces"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/namespaces/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes namespaces"), - // Operation: to.Ptr("Deletes/DeletesCollection namespaces resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Namespaces"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/nodes/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads nodes"), - // Operation: to.Ptr("Gets/List nodes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Nodes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/nodes/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes nodes"), - // Operation: to.Ptr("Creates/Updates nodes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Nodes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/nodes/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes nodes"), - // Operation: to.Ptr("Deletes/DeletesCollection nodes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Nodes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/persistentvolumeclaims/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads persistentvolumeclaims"), - // Operation: to.Ptr("Gets/List persistentvolumeclaims resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Persistentvolumeclaims"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/persistentvolumeclaims/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes persistentvolumeclaims"), - // Operation: to.Ptr("Creates/Updates persistentvolumeclaims resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Persistentvolumeclaims"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/persistentvolumeclaims/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes persistentvolumeclaims"), - // Operation: to.Ptr("Deletes/DeletesCollection persistentvolumeclaims resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Persistentvolumeclaims"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/persistentvolumes/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads persistentvolumes"), - // Operation: to.Ptr("Gets/List persistentvolumes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Persistentvolumes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/persistentvolumes/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes persistentvolumes"), - // Operation: to.Ptr("Creates/Updates persistentvolumes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Persistentvolumes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/persistentvolumes/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes persistentvolumes"), - // Operation: to.Ptr("Deletes/DeletesCollection persistentvolumes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Persistentvolumes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/pods/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads pods"), - // Operation: to.Ptr("Gets/List pods resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Pods"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/pods/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes pods"), - // Operation: to.Ptr("Creates/Updates pods resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Pods"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/pods/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes pods"), - // Operation: to.Ptr("Deletes/DeletesCollection pods resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Pods"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/pods/exec/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Exec into pods resource"), - // Operation: to.Ptr("Exec into pods resource "), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Pods"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/podtemplates/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads podtemplates"), - // Operation: to.Ptr("Gets/List podtemplates resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Podtemplates"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/podtemplates/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes podtemplates"), - // Operation: to.Ptr("Creates/Updates podtemplates resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Podtemplates"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/podtemplates/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes podtemplates"), - // Operation: to.Ptr("Deletes/DeletesCollection podtemplates resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Podtemplates"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/replicationcontrollers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads replicationcontrollers"), - // Operation: to.Ptr("Gets/List replicationcontrollers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Replicationcontrollers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/replicationcontrollers/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes replicationcontrollers"), - // Operation: to.Ptr("Creates/Updates replicationcontrollers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Replicationcontrollers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/replicationcontrollers/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes replicationcontrollers"), - // Operation: to.Ptr("Deletes/DeletesCollection replicationcontrollers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Replicationcontrollers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/resourcequotas/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads resourcequotas"), - // Operation: to.Ptr("Gets/List resourcequotas resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Resourcequotas"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/resourcequotas/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes resourcequotas"), - // Operation: to.Ptr("Creates/Updates resourcequotas resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Resourcequotas"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/resourcequotas/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes resourcequotas"), - // Operation: to.Ptr("Deletes/DeletesCollection resourcequotas resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Resourcequotas"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/secrets/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads secrets"), - // Operation: to.Ptr("Gets/List secrets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Secrets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/secrets/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes secrets"), - // Operation: to.Ptr("Creates/Updates secrets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Secrets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/secrets/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes secrets"), - // Operation: to.Ptr("Deletes/DeletesCollection secrets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Secrets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/serviceaccounts/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads serviceaccounts"), - // Operation: to.Ptr("Gets/List serviceaccounts resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Serviceaccounts"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/serviceaccounts/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes serviceaccounts"), - // Operation: to.Ptr("Creates/Updates serviceaccounts resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Serviceaccounts"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/serviceaccounts/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes serviceaccounts"), - // Operation: to.Ptr("Deletes/DeletesCollection serviceaccounts resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Serviceaccounts"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/services/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads services"), - // Operation: to.Ptr("Gets/List services resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Services"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/services/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes services"), - // Operation: to.Ptr("Creates/Updates services resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Services"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/services/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes services"), - // Operation: to.Ptr("Deletes/DeletesCollection services resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Services"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/events.k8s.io/events/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads events"), - // Operation: to.Ptr("Gets/List events resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Events"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/events.k8s.io/events/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes events"), - // Operation: to.Ptr("Creates/Updates events resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Events"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/events.k8s.io/events/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes events"), - // Operation: to.Ptr("Deletes/DeletesCollection events resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Events"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/daemonsets/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads daemonsets"), - // Operation: to.Ptr("Gets/List daemonsets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Daemonsets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/daemonsets/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes daemonsets"), - // Operation: to.Ptr("Creates/Updates daemonsets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Daemonsets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/daemonsets/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes daemonsets"), - // Operation: to.Ptr("Deletes/DeletesCollection daemonsets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Daemonsets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/deployments/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads deployments"), - // Operation: to.Ptr("Gets/List deployments resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Deployments"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/deployments/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes deployments"), - // Operation: to.Ptr("Creates/Updates deployments resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Deployments"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/deployments/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes deployments"), - // Operation: to.Ptr("Deletes/DeletesCollection deployments resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Deployments"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/ingresses/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads ingresses"), - // Operation: to.Ptr("Gets/List ingresses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Ingresses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/ingresses/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes ingresses"), - // Operation: to.Ptr("Creates/Updates ingresses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Ingresses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/ingresses/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes ingresses"), - // Operation: to.Ptr("Deletes/DeletesCollection ingresses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Ingresses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/networkpolicies/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads networkpolicies"), - // Operation: to.Ptr("Gets/List networkpolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Networkpolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/networkpolicies/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes networkpolicies"), - // Operation: to.Ptr("Creates/Updates networkpolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Networkpolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/networkpolicies/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes networkpolicies"), - // Operation: to.Ptr("Deletes/DeletesCollection networkpolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Networkpolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/podsecuritypolicies/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads podsecuritypolicies"), - // Operation: to.Ptr("Gets/List podsecuritypolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Podsecuritypolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/podsecuritypolicies/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes podsecuritypolicies"), - // Operation: to.Ptr("Creates/Updates podsecuritypolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Podsecuritypolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/podsecuritypolicies/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes podsecuritypolicies"), - // Operation: to.Ptr("Deletes/DeletesCollection podsecuritypolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Podsecuritypolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/replicasets/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads replicasets"), - // Operation: to.Ptr("Gets/List replicasets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Replicasets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/replicasets/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes replicasets"), - // Operation: to.Ptr("Creates/Updates replicasets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Replicasets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/extensions/replicasets/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes replicasets"), - // Operation: to.Ptr("Deletes/DeletesCollection replicasets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Replicasets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/metrics.k8s.io/pods/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads pods"), - // Operation: to.Ptr("Gets/List pods resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Pods"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/metrics.k8s.io/nodes/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads nodes"), - // Operation: to.Ptr("Gets/List nodes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Nodes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/networking.k8s.io/networkpolicies/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads networkpolicies"), - // Operation: to.Ptr("Gets/List networkpolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Networkpolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/networking.k8s.io/networkpolicies/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes networkpolicies"), - // Operation: to.Ptr("Creates/Updates networkpolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Networkpolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/networking.k8s.io/networkpolicies/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes networkpolicies"), - // Operation: to.Ptr("Deletes/DeletesCollection networkpolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Networkpolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/networking.k8s.io/ingresses/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads ingresses"), - // Operation: to.Ptr("Gets/List ingresses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Ingresses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/networking.k8s.io/ingresses/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes ingresses"), - // Operation: to.Ptr("Creates/Updates ingresses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Ingresses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/networking.k8s.io/ingresses/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes ingresses"), - // Operation: to.Ptr("Deletes/DeletesCollection ingresses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Ingresses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/node.k8s.io/runtimeclasses/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads runtimeclasses"), - // Operation: to.Ptr("Gets/List runtimeclasses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Runtimeclasses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/node.k8s.io/runtimeclasses/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes runtimeclasses"), - // Operation: to.Ptr("Creates/Updates runtimeclasses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Runtimeclasses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/node.k8s.io/runtimeclasses/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes runtimeclasses"), - // Operation: to.Ptr("Deletes/DeletesCollection runtimeclasses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Runtimeclasses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/api/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads api"), - // Operation: to.Ptr("Gets/List api resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Api"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/api/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads api/v1"), - // Operation: to.Ptr("Gets/List api/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Api/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apis"), - // Operation: to.Ptr("Gets/List apis resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apis"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/admissionregistration.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads admissionregistration.k8s.io"), - // Operation: to.Ptr("Gets/List admissionregistration.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Admissionregistration.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/admissionregistration.k8s.io/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads admissionregistration.k8s.io/v1"), - // Operation: to.Ptr("Gets/List admissionregistration.k8s.io/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Admissionregistration.K8s.Io/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/admissionregistration.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads admissionregistration.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List admissionregistration.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Admissionregistration.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/apiextensions.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiextensions.k8s.io"), - // Operation: to.Ptr("Gets/List apiextensions.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apiextensions.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/apiextensions.k8s.io/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiextensions.k8s.io/v1"), - // Operation: to.Ptr("Gets/List apiextensions.k8s.io/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apiextensions.K8s.Io/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/apiextensions.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiextensions.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List apiextensions.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apiextensions.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/apiregistration.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiregistration.k8s.io"), - // Operation: to.Ptr("Gets/List apiregistration.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apiregistration.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/apiregistration.k8s.io/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiregistration.k8s.io/v1"), - // Operation: to.Ptr("Gets/List apiregistration.k8s.io/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apiregistration.K8s.Io/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/apiregistration.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiregistration.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List apiregistration.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apiregistration.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/apps/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apps"), - // Operation: to.Ptr("Gets/List apps resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apps"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/apps/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apps/v1"), - // Operation: to.Ptr("Gets/List apps/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apps/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/apps/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apps/v1beta1"), - // Operation: to.Ptr("Gets/List apps/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apps/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/apps/v1beta2/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apps/v1beta2"), - // Operation: to.Ptr("Gets/List apps/v1beta2 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Apps/V1beta2"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/authentication.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads authentication.k8s.io"), - // Operation: to.Ptr("Gets/List authentication.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Authentication.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/authentication.k8s.io/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads authentication.k8s.io/v1"), - // Operation: to.Ptr("Gets/List authentication.k8s.io/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Authentication.K8s.Io/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/authentication.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads authentication.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List authentication.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Authentication.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/authorization.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads authorization.k8s.io"), - // Operation: to.Ptr("Gets/List authorization.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Authorization.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/authorization.k8s.io/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads authorization.k8s.io/v1"), - // Operation: to.Ptr("Gets/List authorization.k8s.io/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Authorization.K8s.Io/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/authorization.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads authorization.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List authorization.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Authorization.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/autoscaling/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads autoscaling"), - // Operation: to.Ptr("Gets/List autoscaling resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Autoscaling"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/autoscaling/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads autoscaling/v1"), - // Operation: to.Ptr("Gets/List autoscaling/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Autoscaling/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/autoscaling/v2beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads autoscaling/v2beta1"), - // Operation: to.Ptr("Gets/List autoscaling/v2beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Autoscaling/V2beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/autoscaling/v2beta2/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads autoscaling/v2beta2"), - // Operation: to.Ptr("Gets/List autoscaling/v2beta2 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Autoscaling/V2beta2"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/batch/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads batch"), - // Operation: to.Ptr("Gets/List batch resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Batch"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/batch/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads batch/v1"), - // Operation: to.Ptr("Gets/List batch/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Batch/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/batch/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads batch/v1beta1"), - // Operation: to.Ptr("Gets/List batch/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Batch/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/certificates.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads certificates.k8s.io"), - // Operation: to.Ptr("Gets/List certificates.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Certificates.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/certificates.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads certificates.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List certificates.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Certificates.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/coordination.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads coordination.k8s.io"), - // Operation: to.Ptr("Gets/List coordination.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Coordination.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/coordination.k8s.io/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads coordination/v1"), - // Operation: to.Ptr("Gets/List coordination/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Coordination.K8s.Io/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/coordination.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads coordination.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List coordination.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Coordination.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/events.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads events.k8s.io"), - // Operation: to.Ptr("Gets/List events.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Events.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/events.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads events.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List events.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Events.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/extensions/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads extensions"), - // Operation: to.Ptr("Gets/List extensions resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Extensions"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/extensions/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads extensions/v1beta1"), - // Operation: to.Ptr("Gets/List extensions/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Extensions/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/metrics.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads metrics.k8s.io"), - // Operation: to.Ptr("Gets/List metrics.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Metrics.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/metrics.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads metrics.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List metrics.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Metrics.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/networking.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads networking.k8s.io"), - // Operation: to.Ptr("Gets/List networking.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Networking.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/networking.k8s.io/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads networking/v1"), - // Operation: to.Ptr("Gets/List networking/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Networking.K8s.Io/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/networking.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads networking.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List networking.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Networking.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/node.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads node.k8s.io"), - // Operation: to.Ptr("Gets/List node.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Node.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/node.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads node.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List node.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Node.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/policy/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads policy"), - // Operation: to.Ptr("Gets/List policy resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Policy"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/policy/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads policy/v1beta1"), - // Operation: to.Ptr("Gets/List policy/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Policy/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/rbac.authorization.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads rbac.authorization.k8s.io"), - // Operation: to.Ptr("Gets/List rbac.authorization.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Rbac.Authorization.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/rbac.authorization.k8s.io/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads rbac.authorization/v1"), - // Operation: to.Ptr("Gets/List rbac.authorization/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Rbac.Authorization.K8s.Io/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/rbac.authorization.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads rbac.authorization.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List rbac.authorization.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Rbac.Authorization.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/scheduling.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads scheduling.k8s.io"), - // Operation: to.Ptr("Gets/List scheduling.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Scheduling.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/scheduling.k8s.io/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads scheduling/v1"), - // Operation: to.Ptr("Gets/List scheduling/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Scheduling.K8s.Io/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/scheduling.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads scheduling.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List scheduling.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Scheduling.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/storage.k8s.io/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads storage.k8s.io"), - // Operation: to.Ptr("Gets/List storage.k8s.io resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Storage.K8s.Io"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/storage.k8s.io/v1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads storage/v1"), - // Operation: to.Ptr("Gets/List storage/v1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Storage.K8s.Io/V1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/apis/storage.k8s.io/v1beta1/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads storage.k8s.io/v1beta1"), - // Operation: to.Ptr("Gets/List storage.k8s.io/v1beta1 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Storage.K8s.Io/V1beta1"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads healthz"), - // Operation: to.Ptr("Gets/List healthz resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/autoregister-completion/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads autoregister-completion"), - // Operation: to.Ptr("Gets/List autoregister-completion resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Autoregister-Completion"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/etcd/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads etcd"), - // Operation: to.Ptr("Gets/List etcd resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Etcd"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/log/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads log"), - // Operation: to.Ptr("Gets/List log resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Log"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/ping/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads ping"), - // Operation: to.Ptr("Gets/List ping resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Ping"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/apiservice-openapi-controller/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiservice-openapi-controller"), - // Operation: to.Ptr("Gets/List apiservice-openapi-controller resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Apiservice-Openapi-Controller"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/apiservice-registration-controller/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiservice-registration-controller"), - // Operation: to.Ptr("Gets/List apiservice-registration-controller resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Apiservice-Registration-Controller"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/apiservice-status-available-controller/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiservice-status-available-controller"), - // Operation: to.Ptr("Gets/List apiservice-status-available-controller resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Apiservice-Status-Available-Controller"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/bootstrap-controller/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads bootstrap-controller"), - // Operation: to.Ptr("Gets/List bootstrap-controller resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Bootstrap-Controller"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/ca-registration/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads ca-registration"), - // Operation: to.Ptr("Gets/List ca-registration resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Ca-Registration"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/crd-informer-synced/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads crd-informer-synced"), - // Operation: to.Ptr("Gets/List crd-informer-synced resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Crd-Informer-Synced"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/generic-apiserver-start-informers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads generic-apiserver-start-informers"), - // Operation: to.Ptr("Gets/List generic-apiserver-start-informers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Generic-Apiserver-Start-Informers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/kube-apiserver-autoregistration/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads kube-apiserver-autoregistration"), - // Operation: to.Ptr("Gets/List kube-apiserver-autoregistration resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Kube-Apiserver-Autoregistration"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/rbac/bootstrap-roles/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads bootstrap-roles"), - // Operation: to.Ptr("Gets/List bootstrap-roles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Bootstrap-Roles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/scheduling/bootstrap-system-priority-classes/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads bootstrap-system-priority-classes"), - // Operation: to.Ptr("Gets/List bootstrap-system-priority-classes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Bootstrap-System-Priority-Classes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/start-apiextensions-controllers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads start-apiextensions-controllers"), - // Operation: to.Ptr("Gets/List start-apiextensions-controllers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Start-Apiextensions-Controllers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/start-apiextensions-informers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads start-apiextensions-informers"), - // Operation: to.Ptr("Gets/List start-apiextensions-informers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Start-Apiextensions-Informers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/start-kube-aggregator-informers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads start-kube-aggregator-informers"), - // Operation: to.Ptr("Gets/List start-kube-aggregator-informers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Start-Kube-Aggregator-Informers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/healthz/poststarthook/start-kube-apiserver-admission-initializer/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads start-kube-apiserver-admission-initializer"), - // Operation: to.Ptr("Gets/List start-kube-apiserver-admission-initializer resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Healthz/Poststarthook/Start-Kube-Apiserver-Admission-Initializer"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads livez"), - // Operation: to.Ptr("Gets/List livez resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/autoregister-completion/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads autoregister-completion"), - // Operation: to.Ptr("Gets/List autoregister-completion resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Autoregister-Completion"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/etcd/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads etcd"), - // Operation: to.Ptr("Gets/List etcd resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Etcd"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/log/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads log"), - // Operation: to.Ptr("Gets/List log resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Log"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/ping/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads ping"), - // Operation: to.Ptr("Gets/List ping resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Ping"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/apiservice-openapi-controller/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiservice-openapi-controller"), - // Operation: to.Ptr("Gets/List apiservice-openapi-controller resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Apiservice-Openapi-Controller"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/apiservice-registration-controller/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiservice-registration-controller"), - // Operation: to.Ptr("Gets/List apiservice-registration-controller resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Apiservice-Registration-Controller"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/apiservice-status-available-controller/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiservice-status-available-controller"), - // Operation: to.Ptr("Gets/List apiservice-status-available-controller resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Apiservice-Status-Available-Controller"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/bootstrap-controller/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads bootstrap-controller"), - // Operation: to.Ptr("Gets/List bootstrap-controller resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Bootstrap-Controller"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/ca-registration/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads ca-registration"), - // Operation: to.Ptr("Gets/List ca-registration resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Ca-Registration"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/crd-informer-synced/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads crd-informer-synced"), - // Operation: to.Ptr("Gets/List crd-informer-synced resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Crd-Informer-Synced"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/generic-apiserver-start-informers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads generic-apiserver-start-informers"), - // Operation: to.Ptr("Gets/List generic-apiserver-start-informers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Generic-Apiserver-Start-Informers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/kube-apiserver-autoregistration/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads kube-apiserver-autoregistration"), - // Operation: to.Ptr("Gets/List kube-apiserver-autoregistration resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Kube-Apiserver-Autoregistration"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/rbac/bootstrap-roles/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads bootstrap-roles"), - // Operation: to.Ptr("Gets/List bootstrap-roles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Bootstrap-Roles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/scheduling/bootstrap-system-priority-classes/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads bootstrap-system-priority-classes"), - // Operation: to.Ptr("Gets/List bootstrap-system-priority-classes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Bootstrap-System-Priority-Classes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/start-apiextensions-controllers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads start-apiextensions-controllers"), - // Operation: to.Ptr("Gets/List start-apiextensions-controllers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Start-Apiextensions-Controllers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/start-apiextensions-informers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads start-apiextensions-informers"), - // Operation: to.Ptr("Gets/List start-apiextensions-informers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Start-Apiextensions-Informers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/start-kube-aggregator-informers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads start-kube-aggregator-informers"), - // Operation: to.Ptr("Gets/List start-kube-aggregator-informers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Start-Kube-Aggregator-Informers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/livez/poststarthook/start-kube-apiserver-admission-initializer/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads start-kube-apiserver-admission-initializer"), - // Operation: to.Ptr("Gets/List start-kube-apiserver-admission-initializer resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Livez/Poststarthook/Start-Kube-Apiserver-Admission-Initializer"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/logs/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads logs"), - // Operation: to.Ptr("Gets/List logs resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Logs"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/metrics/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads metrics"), - // Operation: to.Ptr("Gets/List metrics resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Metrics"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/openapi/v2/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads v2"), - // Operation: to.Ptr("Gets/List v2 resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Openapi/V2"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads readyz"), - // Operation: to.Ptr("Gets/List readyz resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/autoregister-completion/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads autoregister-completion"), - // Operation: to.Ptr("Gets/List autoregister-completion resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Autoregister-Completion"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/etcd/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads etcd"), - // Operation: to.Ptr("Gets/List etcd resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Etcd"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/log/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads log"), - // Operation: to.Ptr("Gets/List log resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Log"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/ping/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads ping"), - // Operation: to.Ptr("Gets/List ping resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Ping"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/apiservice-openapi-controller/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiservice-openapi-controller"), - // Operation: to.Ptr("Gets/List apiservice-openapi-controller resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Apiservice-Openapi-Controller"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/apiservice-registration-controller/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiservice-registration-controller"), - // Operation: to.Ptr("Gets/List apiservice-registration-controller resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Apiservice-Registration-Controller"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/apiservice-status-available-controller/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads apiservice-status-available-controller"), - // Operation: to.Ptr("Gets/List apiservice-status-available-controller resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Apiservice-Status-Available-Controller"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/bootstrap-controller/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads bootstrap-controller"), - // Operation: to.Ptr("Gets/List bootstrap-controller resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Bootstrap-Controller"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/ca-registration/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads ca-registration"), - // Operation: to.Ptr("Gets/List ca-registration resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Ca-Registration"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/crd-informer-synced/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads crd-informer-synced"), - // Operation: to.Ptr("Gets/List crd-informer-synced resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Crd-Informer-Synced"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/generic-apiserver-start-informers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads generic-apiserver-start-informers"), - // Operation: to.Ptr("Gets/List generic-apiserver-start-informers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Generic-Apiserver-Start-Informers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/kube-apiserver-autoregistration/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads kube-apiserver-autoregistration"), - // Operation: to.Ptr("Gets/List kube-apiserver-autoregistration resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Kube-Apiserver-Autoregistration"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/rbac/bootstrap-roles/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads bootstrap-roles"), - // Operation: to.Ptr("Gets/List bootstrap-roles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Bootstrap-Roles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/scheduling/bootstrap-system-priority-classes/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads bootstrap-system-priority-classes"), - // Operation: to.Ptr("Gets/List bootstrap-system-priority-classes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Bootstrap-System-Priority-Classes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/start-apiextensions-controllers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads start-apiextensions-controllers"), - // Operation: to.Ptr("Gets/List start-apiextensions-controllers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Start-Apiextensions-Controllers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/start-apiextensions-informers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads start-apiextensions-informers"), - // Operation: to.Ptr("Gets/List start-apiextensions-informers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Start-Apiextensions-Informers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/start-kube-aggregator-informers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads start-kube-aggregator-informers"), - // Operation: to.Ptr("Gets/List start-kube-aggregator-informers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Start-Kube-Aggregator-Informers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/poststarthook/start-kube-apiserver-admission-initializer/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads start-kube-apiserver-admission-initializer"), - // Operation: to.Ptr("Gets/List start-kube-apiserver-admission-initializer resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Poststarthook/Start-Kube-Apiserver-Admission-Initializer"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/readyz/shutdown/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads shutdown"), - // Operation: to.Ptr("Gets/List shutdown resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Readyz/Shutdown"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/resetMetrics/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads resetMetrics"), - // Operation: to.Ptr("Gets/List resetMetrics resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Resetmetrics"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/swagger-ui/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads swagger-ui"), - // Operation: to.Ptr("Gets/List swagger-ui resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Swagger-Ui"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/swagger-api/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads swagger-api"), - // Operation: to.Ptr("Gets/List swagger-api resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Swagger-Api"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/ui/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads ui"), - // Operation: to.Ptr("Gets/List ui resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Ui"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/version/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads version"), - // Operation: to.Ptr("Gets/List version resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Version"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/policy/poddisruptionbudgets/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads poddisruptionbudgets"), - // Operation: to.Ptr("Gets/List poddisruptionbudgets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Poddisruptionbudgets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/policy/poddisruptionbudgets/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes poddisruptionbudgets"), - // Operation: to.Ptr("Creates/Updates poddisruptionbudgets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Poddisruptionbudgets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/policy/poddisruptionbudgets/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes poddisruptionbudgets"), - // Operation: to.Ptr("Deletes/DeletesCollection poddisruptionbudgets resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Poddisruptionbudgets"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/policy/podsecuritypolicies/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads podsecuritypolicies"), - // Operation: to.Ptr("Gets/List podsecuritypolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Podsecuritypolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/policy/podsecuritypolicies/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes podsecuritypolicies"), - // Operation: to.Ptr("Creates/Updates podsecuritypolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Podsecuritypolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/policy/podsecuritypolicies/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes podsecuritypolicies"), - // Operation: to.Ptr("Deletes/DeletesCollection podsecuritypolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Podsecuritypolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/clusterrolebindings/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads clusterrolebindings"), - // Operation: to.Ptr("Gets/List clusterrolebindings resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Clusterrolebindings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/clusterrolebindings/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes clusterrolebindings"), - // Operation: to.Ptr("Creates/Updates clusterrolebindings resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Clusterrolebindings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/clusterrolebindings/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes clusterrolebindings"), - // Operation: to.Ptr("Deletes/DeletesCollection clusterrolebindings resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Clusterrolebindings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/clusterroles/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads clusterroles"), - // Operation: to.Ptr("Gets/List clusterroles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Clusterroles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/clusterroles/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes clusterroles"), - // Operation: to.Ptr("Creates/Updates clusterroles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Clusterroles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/clusterroles/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes clusterroles"), - // Operation: to.Ptr("Deletes/DeletesCollection clusterroles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Clusterroles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/rolebindings/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads rolebindings"), - // Operation: to.Ptr("Gets/List rolebindings resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Rolebindings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/rolebindings/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes rolebindings"), - // Operation: to.Ptr("Creates/Updates rolebindings resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Rolebindings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/rolebindings/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes rolebindings"), - // Operation: to.Ptr("Deletes/DeletesCollection rolebindings resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Rolebindings"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/roles/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads roles"), - // Operation: to.Ptr("Gets/List roles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Roles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/roles/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes roles"), - // Operation: to.Ptr("Creates/Updates roles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Roles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/roles/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes roles"), - // Operation: to.Ptr("Deletes/DeletesCollection roles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Roles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/scheduling.k8s.io/priorityclasses/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads priorityclasses"), - // Operation: to.Ptr("Gets/List priorityclasses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Priorityclasses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/scheduling.k8s.io/priorityclasses/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes priorityclasses"), - // Operation: to.Ptr("Creates/Updates priorityclasses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Priorityclasses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/scheduling.k8s.io/priorityclasses/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes priorityclasses"), - // Operation: to.Ptr("Deletes/DeletesCollection priorityclasses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Priorityclasses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/policy/podsecuritypolicies/use/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Use action on podsecuritypolicies"), - // Operation: to.Ptr("Use podsecuritypolicies resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Podsecuritypolicies"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/clusterroles/bind/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Binds clusterroles"), - // Operation: to.Ptr("Bind clusterroles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Clusterroles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/clusterroles/escalate/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Escalates"), - // Operation: to.Ptr("Escalate clusterroles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Clusterroles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/roles/bind/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Binds roles"), - // Operation: to.Ptr("Bind roles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Roles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/roles/escalate/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Escalates roles"), - // Operation: to.Ptr("Escalate roles resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Roles"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/serviceaccounts/impersonate/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Impersonate serviceaccounts"), - // Operation: to.Ptr("Impersonate serviceaccounts resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Serviceaccounts"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/users/impersonate/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Impersonate users"), - // Operation: to.Ptr("Impersonate users resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Users"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/groups/impersonate/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Impersonate groups"), - // Operation: to.Ptr("Impersonate groups resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Groups"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/authentication.k8s.io/userextras/impersonate/action"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Impersonate userextras"), - // Operation: to.Ptr("Impersonate userextras resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Userextras"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/storage.k8s.io/storageclasses/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads storageclasses"), - // Operation: to.Ptr("Gets/List storageclasses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Storageclasses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/storage.k8s.io/storageclasses/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes storageclasses"), - // Operation: to.Ptr("Creates/Updates storageclasses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Storageclasses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/storage.k8s.io/storageclasses/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes storageclasses"), - // Operation: to.Ptr("Deletes/DeletesCollection storageclasses resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Storageclasses"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/storage.k8s.io/volumeattachments/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads volumeattachments"), - // Operation: to.Ptr("Gets/List volumeattachments resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Volumeattachments"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/storage.k8s.io/volumeattachments/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes volumeattachments"), - // Operation: to.Ptr("Creates/Updates volumeattachments resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Volumeattachments"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/storage.k8s.io/volumeattachments/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes volumeattachments"), - // Operation: to.Ptr("Deletes/DeletesCollection volumeattachments resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Volumeattachments"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/storage.k8s.io/csidrivers/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads csidrivers"), - // Operation: to.Ptr("Gets/List csidrivers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Csidrivers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/storage.k8s.io/csidrivers/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes csidrivers"), - // Operation: to.Ptr("Creates/Updates csidrivers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Csidrivers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/storage.k8s.io/csidrivers/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes csidrivers"), - // Operation: to.Ptr("Deletes/DeletesCollection csidrivers resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Csidrivers"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/storage.k8s.io/csinodes/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Reads csinodes"), - // Operation: to.Ptr("Gets/List csinodes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Csinodes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/storage.k8s.io/csinodes/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Writes csinodes"), - // Operation: to.Ptr("Creates/Updates csinodes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Csinodes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/storage.k8s.io/csinodes/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Deletes csinodes"), - // Operation: to.Ptr("Deletes/DeletesCollection csinodes resource"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Csinodes"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Gets the available metrics for Managed Cluster"), - // Operation: to.Ptr("Read Managed Cluster metric definitions"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("The metric definition of Managed Cluster"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/managedClusters/providers/Microsoft.Insights/logDefinitions/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Gets the available logs for Managed Cluster"), - // Operation: to.Ptr("Read Managed Cluster log definitions"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("The log definition of Managed Cluster"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/openShiftManagedClusters/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Get a Open Shift Managed Cluster"), - // Operation: to.Ptr("Get Open Shift Managed Cluster"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Open Shift Managed Cluster"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/openShiftManagedClusters/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Creates a new Open Shift Managed Cluster or updates an existing one"), - // Operation: to.Ptr("Create or Update Open Shift Managed Cluster"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Open Shift Managed Cluster"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/openShiftManagedClusters/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Delete a Open Shift Managed Cluster"), - // Operation: to.Ptr("Delete Open Shift Managed Cluster"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Open Shift Managed Cluster"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/openShiftClusters/read"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Get a Open Shift Cluster"), - // Operation: to.Ptr("Get Open Shift Cluster"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Open Shift Cluster"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/openShiftClusters/write"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Creates a new Open Shift Cluster or updates an existing one"), - // Operation: to.Ptr("Create or Update Open Shift Cluster"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Open Shift Cluster"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.ContainerService/openShiftClusters/delete"), - // Display: &armcontainerservice.OperationValueDisplay{ - // Description: to.Ptr("Delete a Open Shift Cluster"), - // Operation: to.Ptr("Delete Open Shift Cluster"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Open Shift Cluster"), - // }, - // Origin: to.Ptr("user,system"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client.go index f6ed366ffed8..830e7edbd60f 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client.go @@ -46,7 +46,7 @@ func NewOperationStatusResultClient(subscriptionID string, credential azcore.Tok // Get - Get the status of a specific operation in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - operationID - The ID of an ongoing async operation. @@ -98,7 +98,7 @@ func (client *OperationStatusResultClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *OperationStatusResultClient) getHandleResponse(resp *http.Response // GetByAgentPool - Get the status of a specific operation in the specified agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - 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. @@ -173,7 +173,7 @@ func (client *OperationStatusResultClient) getByAgentPoolCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *OperationStatusResultClient) getByAgentPoolHandleResponse(resp *ht // NewListPager - Gets a list of operations in the specified managedCluster // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - OperationStatusResultClientListOptions contains the optional parameters for the OperationStatusResultClient.NewListPager @@ -238,7 +238,7 @@ func (client *OperationStatusResultClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client_example_test.go deleted file mode 100644 index 9b4606bd88df..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client_example_test.go +++ /dev/null @@ -1,118 +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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/OperationStatusResultList.json -func ExampleOperationStatusResultClient_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.NewOperationStatusResultClient().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.OperationStatusResultList = armcontainerservice.OperationStatusResultList{ - // Value: []*armcontainerservice.OperationStatusResult{ - // { - // Name: to.Ptr("d11edb09-6e27-429f-9fe5-17baf773bc4a"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/operations/d11edb09-6e27-429f-9fe5-17baf773bc4a"), - // PercentComplete: to.Ptr[float32](40), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-26T12:14:26.317Z"); return t}()), - // Status: to.Ptr("InProgress"), - // }, - // { - // Name: to.Ptr("d11edb09-6e27-429f-9fe5-17baf773bc4b"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-26T12:14:50.317Z"); return t}()), - // Error: &armcontainerservice.ErrorDetail{ - // Code: to.Ptr("ReconcileAgentPoolIdentityError"), - // Message: to.Ptr("Reconcile agent pool nodepool1 identity failed"), - // }, - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/operations/d11edb09-6e27-429f-9fe5-17baf773bc4b"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-26T12:14:26.317Z"); return t}()), - // Status: to.Ptr("Failed"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/OperationStatusResultGet.json -func ExampleOperationStatusResultClient_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.NewOperationStatusResultClient().Get(ctx, "rg1", "clustername1", "00000000-0000-0000-0000-000000000001", 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.OperationStatusResult = armcontainerservice.OperationStatusResult{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000001"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/operations/00000000-0000-0000-0000-000000000001"), - // PercentComplete: to.Ptr[float32](40), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-26T12:14:26.317Z"); return t}()), - // Status: to.Ptr("InProgress"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/OperationStatusResultGetByAgentPool.json -func ExampleOperationStatusResultClient_GetByAgentPool() { - 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.NewOperationStatusResultClient().GetByAgentPool(ctx, "rg1", "clustername1", "agentpool1", "00000000-0000-0000-0000-000000000001", 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.OperationStatusResult = armcontainerservice.OperationStatusResult{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000001"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1/operations/00000000-0000-0000-0000-000000000001"), - // PercentComplete: to.Ptr[float32](40), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-26T12:14:26.317Z"); return t}()), - // Status: to.Ptr("InProgress"), - // } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/options.go b/sdk/resourcemanager/containerservice/armcontainerservice/options.go index f209cbc7f0ed..02d893167656 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/options.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/options.go @@ -18,6 +18,12 @@ type AgentPoolsClientBeginAbortLatestOperationOptions struct { // AgentPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginCreateOrUpdate // method. type AgentPoolsClientBeginCreateOrUpdateOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + + // The request should only proceed if no entity matches this string. + IfNoneMatch *string + // Resumes the LRO from the provided token. ResumeToken string } @@ -31,6 +37,9 @@ type AgentPoolsClientBeginDeleteMachinesOptions struct { // AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method. type AgentPoolsClientBeginDeleteOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + // ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget IgnorePodDisruptionBudget *bool @@ -66,6 +75,28 @@ type AgentPoolsClientListOptions struct { // placeholder for future optional parameters } +// LoadBalancersClientBeginDeleteOptions contains the optional parameters for the LoadBalancersClient.BeginDelete method. +type LoadBalancersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LoadBalancersClientCreateOrUpdateOptions contains the optional parameters for the LoadBalancersClient.CreateOrUpdate method. +type LoadBalancersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancersClientGetOptions contains the optional parameters for the LoadBalancersClient.Get method. +type LoadBalancersClientGetOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancersClientListByManagedClusterOptions contains the optional parameters for the LoadBalancersClient.NewListByManagedClusterPager +// method. +type LoadBalancersClientListByManagedClusterOptions struct { + // placeholder for future optional parameters +} + // MachinesClientGetOptions contains the optional parameters for the MachinesClient.Get method. type MachinesClientGetOptions struct { // placeholder for future optional parameters @@ -145,12 +176,21 @@ type ManagedClustersClientBeginAbortLatestOperationOptions struct { // ManagedClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedClustersClient.BeginCreateOrUpdate // method. type ManagedClustersClientBeginCreateOrUpdateOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + + // The request should only proceed if no entity matches this string. + IfNoneMatch *string + // Resumes the LRO from the provided token. ResumeToken string } // ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete method. type ManagedClustersClientBeginDeleteOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + // ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget IgnorePodDisruptionBudget *bool @@ -158,6 +198,13 @@ type ManagedClustersClientBeginDeleteOptions struct { ResumeToken string } +// ManagedClustersClientBeginRebalanceLoadBalancersOptions contains the optional parameters for the ManagedClustersClient.BeginRebalanceLoadBalancers +// method. +type ManagedClustersClientBeginRebalanceLoadBalancersOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ManagedClustersClientBeginResetAADProfileOptions contains the optional parameters for the ManagedClustersClient.BeginResetAADProfile // method. type ManagedClustersClientBeginResetAADProfileOptions struct { @@ -208,6 +255,9 @@ type ManagedClustersClientBeginStopOptions struct { // ManagedClustersClientBeginUpdateTagsOptions contains the optional parameters for the ManagedClustersClient.BeginUpdateTags // method. type ManagedClustersClientBeginUpdateTagsOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + // Resumes the LRO from the provided token. ResumeToken string } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client.go index 5d5979f7fedb..434c809aab26 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client.go @@ -46,7 +46,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginDelete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -72,7 +72,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginDelete" @@ -118,7 +118,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -127,7 +127,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -179,7 +179,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,7 +197,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // List - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List @@ -244,7 +244,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re // Update - Updates a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -315,7 +315,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") 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/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client_example_test.go deleted file mode 100644 index 7d61431108f9..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,151 +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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/PrivateEndpointConnectionsList.json -func ExamplePrivateEndpointConnectionsClient_List() { - 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.NewPrivateEndpointConnectionsClient().List(ctx, "rg1", "clustername1", 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.PrivateEndpointConnectionListResult = armcontainerservice.PrivateEndpointConnectionListResult{ - // Value: []*armcontainerservice.PrivateEndpointConnection{ - // { - // Name: to.Ptr("privateendpointconnection1"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedCluster/clustername1/privateEndpointConnections/privateendpointconnection1"), - // Properties: &armcontainerservice.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcontainerservice.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/pe2"), - // }, - // PrivateLinkServiceConnectionState: &armcontainerservice.PrivateLinkServiceConnectionState{ - // Status: to.Ptr(armcontainerservice.ConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcontainerservice.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/PrivateEndpointConnectionsGet.json -func ExamplePrivateEndpointConnectionsClient_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.NewPrivateEndpointConnectionsClient().Get(ctx, "rg1", "clustername1", "privateendpointconnection1", 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.PrivateEndpointConnection = armcontainerservice.PrivateEndpointConnection{ - // Name: to.Ptr("privateendpointconnection1"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedCluster/clustername1/privateEndpointConnections/privateendpointconnection1"), - // Properties: &armcontainerservice.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcontainerservice.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/pe2"), - // }, - // PrivateLinkServiceConnectionState: &armcontainerservice.PrivateLinkServiceConnectionState{ - // Status: to.Ptr(armcontainerservice.ConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcontainerservice.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/PrivateEndpointConnectionsUpdate.json -func ExamplePrivateEndpointConnectionsClient_Update() { - 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.NewPrivateEndpointConnectionsClient().Update(ctx, "rg1", "clustername1", "privateendpointconnection1", armcontainerservice.PrivateEndpointConnection{ - Properties: &armcontainerservice.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armcontainerservice.PrivateLinkServiceConnectionState{ - Status: to.Ptr(armcontainerservice.ConnectionStatusApproved), - }, - }, - }, 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.PrivateEndpointConnection = armcontainerservice.PrivateEndpointConnection{ - // Name: to.Ptr("privateendpointconnection1"), - // Type: to.Ptr("Microsoft.Network/privateLinkServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedCluster/clustername1/privateEndpointConnections/privateendpointconnection1"), - // Properties: &armcontainerservice.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcontainerservice.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/pe2"), - // }, - // PrivateLinkServiceConnectionState: &armcontainerservice.PrivateLinkServiceConnectionState{ - // Status: to.Ptr(armcontainerservice.ConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcontainerservice.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/PrivateEndpointConnectionsDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - 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.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "rg1", "clustername1", "privateendpointconnection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client.go index 453a98a33393..6a4801410542 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client.go @@ -46,7 +46,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // List - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List @@ -93,7 +93,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client_example_test.go deleted file mode 100644 index 2a7510bfb776..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,49 +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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/PrivateLinkResourcesList.json -func ExamplePrivateLinkResourcesClient_List() { - 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.NewPrivateLinkResourcesClient().List(ctx, "rg1", "clustername1", 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.PrivateLinkResourcesListResult = armcontainerservice.PrivateLinkResourcesListResult{ - // Value: []*armcontainerservice.PrivateLinkResource{ - // { - // Name: to.Ptr("management"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/privateLinkResources"), - // GroupID: to.Ptr("management"), - // PrivateLinkServiceID: to.Ptr("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/plsName"), - // RequiredMembers: []*string{ - // to.Ptr("management")}, - // }}, - // } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client.go index 9d40e2356175..681c66a8eef2 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client.go @@ -46,7 +46,7 @@ func NewResolvePrivateLinkServiceIDClient(subscriptionID string, credential azco // POST - Gets the private link service ID for the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - Parameters required in order to resolve a private link service ID. @@ -94,7 +94,7 @@ func (client *ResolvePrivateLinkServiceIDClient) postCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") 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/resolveprivatelinkserviceid_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client_example_test.go deleted file mode 100644 index 079ca83da7e0..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client_example_test.go +++ /dev/null @@ -1,44 +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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/ResolvePrivateLinkServiceId.json -func ExampleResolvePrivateLinkServiceIDClient_POST() { - 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.NewResolvePrivateLinkServiceIDClient().POST(ctx, "rg1", "clustername1", armcontainerservice.PrivateLinkResource{ - Name: to.Ptr("management"), - }, 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.PrivateLinkResource = armcontainerservice.PrivateLinkResource{ - // PrivateLinkServiceID: to.Ptr("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Network/privateLinkServices/plsName"), - // } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/responses.go b/sdk/resourcemanager/containerservice/armcontainerservice/responses.go index 8acdd298df60..5c819f1e2225 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/responses.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/responses.go @@ -59,6 +59,33 @@ type AgentPoolsClientUpgradeNodeImageVersionResponse struct { AgentPool } +// LoadBalancersClientCreateOrUpdateResponse contains the response from method LoadBalancersClient.CreateOrUpdate. +type LoadBalancersClientCreateOrUpdateResponse struct { + // The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode will be used. + // Multiple standard load balancers mode will be used if at lease one configuration is supplied. There has to be a configuration + // named `kubernetes`. + LoadBalancer +} + +// LoadBalancersClientDeleteResponse contains the response from method LoadBalancersClient.BeginDelete. +type LoadBalancersClientDeleteResponse struct { + // placeholder for future response values +} + +// LoadBalancersClientGetResponse contains the response from method LoadBalancersClient.Get. +type LoadBalancersClientGetResponse struct { + // The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode will be used. + // Multiple standard load balancers mode will be used if at lease one configuration is supplied. There has to be a configuration + // named `kubernetes`. + LoadBalancer +} + +// LoadBalancersClientListByManagedClusterResponse contains the response from method LoadBalancersClient.NewListByManagedClusterPager. +type LoadBalancersClientListByManagedClusterResponse struct { + // The response from the List Load Balancers operation. + LoadBalancerListResult +} + // MachinesClientGetResponse contains the response from method MachinesClient.Get. type MachinesClientGetResponse struct { // A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl get @@ -271,6 +298,11 @@ type ManagedClustersClientListSafeguardsVersionsResponse struct { SafeguardsAvailableVersionsList } +// ManagedClustersClientRebalanceLoadBalancersResponse contains the response from method ManagedClustersClient.BeginRebalanceLoadBalancers. +type ManagedClustersClientRebalanceLoadBalancersResponse struct { + // placeholder for future response values +} + // ManagedClustersClientResetAADProfileResponse contains the response from method ManagedClustersClient.BeginResetAADProfile. type ManagedClustersClientResetAADProfileResponse struct { // placeholder for future response values diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client.go index b78533b40ab0..ccb81445efab 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client.go @@ -46,7 +46,7 @@ func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Creates or updates a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - The snapshot to create or update. @@ -94,7 +94,7 @@ func (client *SnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -115,7 +115,7 @@ func (client *SnapshotsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - SnapshotsClientDeleteOptions contains the optional parameters for the SnapshotsClient.Delete method. @@ -160,7 +160,7 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,7 +169,7 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. @@ -215,7 +215,7 @@ func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +232,7 @@ func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (Snapshots // NewListPager - Gets a list of snapshots in the specified subscription. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - options - SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. func (client *SnapshotsClient) NewListPager(options *SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListResponse]{ @@ -269,7 +269,7 @@ func (client *SnapshotsClient) listCreateRequest(ctx context.Context, options *S return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,7 +286,7 @@ func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (Snapshot // NewListByResourceGroupPager - Lists snapshots in the specified subscription and resource group. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager // method. @@ -329,7 +329,7 @@ func (client *SnapshotsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +347,7 @@ 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 2024-02-02-preview +// Generated from API version 2024-04-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 snapshot Tags operation. @@ -394,7 +394,7 @@ func (client *SnapshotsClient) updateTagsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") 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 deleted file mode 100644 index 835638902993..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client_example_test.go +++ /dev/null @@ -1,303 +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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/SnapshotsList.json -func ExampleSnapshotsClient_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.NewSnapshotsClient().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.SnapshotListResult = armcontainerservice.SnapshotListResult{ - // Value: []*armcontainerservice.Snapshot{ - // { - // Name: to.Ptr("snapshot1"), - // Type: to.Ptr("Microsoft.ContainerService/Snapshots"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298Z"); 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.SnapshotProperties{ - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0"), - // }, - // EnableFIPS: to.Ptr(false), - // KubernetesVersion: to.Ptr("1.20.5"), - // NodeImageVersion: to.Ptr("AKSUbuntu-1804gen2containerd-2021.09.11"), - // OSSKU: to.Ptr(armcontainerservice.OSSKUUbuntu), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeNodePool), - // VMSize: to.Ptr("Standard_D2s_v3"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/SnapshotsListByResourceGroup.json -func ExampleSnapshotsClient_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.NewSnapshotsClient().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.SnapshotListResult = armcontainerservice.SnapshotListResult{ - // Value: []*armcontainerservice.Snapshot{ - // { - // Name: to.Ptr("snapshot1"), - // Type: to.Ptr("Microsoft.ContainerService/Snapshots"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298Z"); 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.SnapshotProperties{ - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0"), - // }, - // EnableFIPS: to.Ptr(false), - // KubernetesVersion: to.Ptr("1.20.5"), - // NodeImageVersion: to.Ptr("AKSUbuntu-1804gen2containerd-2021.09.11"), - // OSSKU: to.Ptr(armcontainerservice.OSSKUUbuntu), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeNodePool), - // VMSize: to.Ptr("Standard_D2s_v3"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/SnapshotsGet.json -func ExampleSnapshotsClient_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.NewSnapshotsClient().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.Snapshot = armcontainerservice.Snapshot{ - // Name: to.Ptr("snapshot1"), - // Type: to.Ptr("Microsoft.ContainerService/Snapshots"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298Z"); 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.SnapshotProperties{ - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0"), - // }, - // EnableFIPS: to.Ptr(false), - // KubernetesVersion: to.Ptr("1.20.5"), - // NodeImageVersion: to.Ptr("AKSUbuntu-1804gen2containerd-2021.09.11"), - // OSSKU: to.Ptr(armcontainerservice.OSSKUUbuntu), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeNodePool), - // VMSize: to.Ptr("Standard_D2s_v3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/SnapshotsCreate.json -func ExampleSnapshotsClient_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.NewSnapshotsClient().CreateOrUpdate(ctx, "rg1", "snapshot1", armcontainerservice.Snapshot{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - "key2": to.Ptr("val2"), - }, - Properties: &armcontainerservice.SnapshotProperties{ - CreationData: &armcontainerservice.CreationData{ - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0"), - }, - }, - }, 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.Snapshot = armcontainerservice.Snapshot{ - // Name: to.Ptr("snapshot1"), - // Type: to.Ptr("Microsoft.ContainerService/Snapshots"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298Z"); 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.SnapshotProperties{ - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0"), - // }, - // EnableFIPS: to.Ptr(false), - // KubernetesVersion: to.Ptr("1.20.5"), - // NodeImageVersion: to.Ptr("AKSUbuntu-1804gen2containerd-2021.09.11"), - // OSSKU: to.Ptr(armcontainerservice.OSSKUUbuntu), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeNodePool), - // VMSize: to.Ptr("Standard_D2s_v3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/SnapshotsUpdateTags.json -func ExampleSnapshotsClient_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.NewSnapshotsClient().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.Snapshot = armcontainerservice.Snapshot{ - // Name: to.Ptr("snapshot1"), - // Type: to.Ptr("Microsoft.ContainerService/Snapshots"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), - // SystemData: &armcontainerservice.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298Z"); 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.SnapshotProperties{ - // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0"), - // }, - // EnableFIPS: to.Ptr(false), - // KubernetesVersion: to.Ptr("1.20.5"), - // NodeImageVersion: to.Ptr("AKSUbuntu-1804gen2containerd-2021.09.11"), - // OSSKU: to.Ptr(armcontainerservice.OSSKUUbuntu), - // OSType: to.Ptr(armcontainerservice.OSTypeLinux), - // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeNodePool), - // VMSize: to.Ptr("Standard_D2s_v3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/SnapshotsDelete.json -func ExampleSnapshotsClient_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.NewSnapshotsClient().Delete(ctx, "rg1", "snapshot1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client.go index 408bf8c7e3e8..f5937737c05d 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client.go @@ -46,7 +46,7 @@ func NewTrustedAccessRoleBindingsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Create or update a trusted access role binding // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-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. @@ -73,7 +73,7 @@ func (client *TrustedAccessRoleBindingsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Create or update a trusted access role binding // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview func (client *TrustedAccessRoleBindingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, trustedAccessRoleBinding TrustedAccessRoleBinding, options *TrustedAccessRoleBindingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "TrustedAccessRoleBindingsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *TrustedAccessRoleBindingsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, trustedAccessRoleBinding); err != nil { @@ -131,7 +131,7 @@ func (client *TrustedAccessRoleBindingsClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Delete a trusted access role binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-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. @@ -157,7 +157,7 @@ func (client *TrustedAccessRoleBindingsClient) BeginDelete(ctx context.Context, // Delete - Delete a trusted access role binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview func (client *TrustedAccessRoleBindingsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "TrustedAccessRoleBindingsClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *TrustedAccessRoleBindingsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *TrustedAccessRoleBindingsClient) deleteCreateRequest(ctx context.C // Get - Get a trusted access role binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-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. @@ -264,7 +264,7 @@ func (client *TrustedAccessRoleBindingsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *TrustedAccessRoleBindingsClient) getHandleResponse(resp *http.Resp // NewListPager - List trusted access role bindings. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-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 @@ -329,7 +329,7 @@ func (client *TrustedAccessRoleBindingsClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, 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 910a8df7da78..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client_example_test.go +++ /dev/null @@ -1,152 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/TrustedAccessRoleBindings_CreateOrUpdate.json -func ExampleTrustedAccessRoleBindingsClient_BeginCreateOrUpdate() { - 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.NewTrustedAccessRoleBindingsClient().BeginCreateOrUpdate(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) - } - 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.TrustedAccessRoleBinding = armcontainerservice.TrustedAccessRoleBinding{ - // Name: to.Ptr("binding1"), - // Type: to.Ptr("Microsoft.ContainerService/managedClusters/trustedAccessRoleBindings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-02-preview/examples/TrustedAccessRoleBindings_Delete.json -func ExampleTrustedAccessRoleBindingsClient_BeginDelete() { - 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.NewTrustedAccessRoleBindingsClient().BeginDelete(ctx, "rg1", "clustername1", "binding1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go index fd6d2e992b1e..f61d4fe2438b 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go @@ -45,7 +45,7 @@ func NewTrustedAccessRolesClient(subscriptionID string, credential azcore.TokenC // NewListPager - List supported trusted access roles. // -// Generated from API version 2024-02-02-preview +// Generated from API version 2024-04-02-preview // - location - The name of the Azure region. // - options - TrustedAccessRolesClientListOptions contains the optional parameters for the TrustedAccessRolesClient.NewListPager // method. @@ -88,7 +88,7 @@ func (client *TrustedAccessRolesClient) listCreateRequest(ctx context.Context, l return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-02-preview") + reqQP.Set("api-version", "2024-04-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, 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 a625ddf3903c..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/v5" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1dd99306d14fd6c602f47652a209a4a6812c368c/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-02-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"), - // }}, - // } - } -}