From f6e4462f18a8af5e11ad4d01dbee527f2171cb28 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 28 Jul 2022 03:06:27 +0000 Subject: [PATCH] CodeGen from PR 19976 in Azure/azure-rest-api-specs Merge 24de78761c14cf36b33d1bc4b81a1fb02041d441 into 6ab607d028ef422b457b9acd425f2a75b00e1993 --- .../armcontainerservice/CHANGELOG.md | 7 + .../armcontainerservice/agentpools_client.go | 34 +- .../agentpools_client_example_test.go | 201 ------ .../armcontainerservice/autorest.md | 6 +- .../armcontainerservice/constants.go | 13 +- .../armcontainerservice/go.mod | 14 +- .../armcontainerservice/go.sum | 24 +- .../maintenanceconfigurations_client.go | 16 +- ...nanceconfigurations_client_example_test.go | 129 ---- .../managedclusters_client.go | 98 +-- .../managedclusters_client_example_test.go | 578 ------------------ .../armcontainerservice/models.go | 9 +- .../armcontainerservice/operations_client.go | 4 +- .../operations_client_example_test.go | 41 -- .../privateendpointconnections_client.go | 18 +- ...endpointconnections_client_example_test.go | 118 ---- .../privatelinkresources_client.go | 4 +- ...rivatelinkresources_client_example_test.go | 39 -- .../resolveprivatelinkserviceid_client.go | 4 +- ...rivatelinkserviceid_client_example_test.go | 43 -- .../armcontainerservice/snapshots_client.go | 24 +- .../snapshots_client_example_test.go | 171 ------ 22 files changed, 132 insertions(+), 1463 deletions(-) delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client_example_test.go delete mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client_example_test.go diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md index f36780f63570..3f12df7a4892 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md +++ b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 2.1.0 (2022-07-28) +### Features Added + +- New const `OSSKUWindows2022` +- New const `OSSKUWindows2019` + + ## 2.0.0 (2022-07-22) ### Breaking Changes diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go index 7ec7796976fc..f256e329a4c0 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go @@ -57,7 +57,7 @@ func NewAgentPoolsClient(subscriptionID string, credential azcore.TokenCredentia // 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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -78,7 +78,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 2022-06-01 +// Generated from API version 2022-07-01 func (client *AgentPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool, options *AgentPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, parameters, options) if err != nil { @@ -118,7 +118,7 @@ func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,7 +126,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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -145,7 +145,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 2022-06-01 +// Generated from API version 2022-07-01 func (client *AgentPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { @@ -185,7 +185,7 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the specified managed cluster agent pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -237,7 +237,7 @@ func (client *AgentPoolsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +255,7 @@ func (client *AgentPoolsClient) getHandleResponse(resp *http.Response) (AgentPoo // GetAvailableAgentPoolVersions - See supported Kubernetes versions [https://docs.microsoft.com/azure/aks/supported-kubernetes-versions] // for more details about the version lifecycle. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - AgentPoolsClientGetAvailableAgentPoolVersionsOptions contains the optional parameters for the AgentPoolsClient.GetAvailableAgentPoolVersions @@ -295,7 +295,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -312,7 +312,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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -357,7 +357,7 @@ func (client *AgentPoolsClient) getUpgradeProfileCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -374,7 +374,7 @@ func (client *AgentPoolsClient) getUpgradeProfileHandleResponse(resp *http.Respo // NewListPager - Gets a list of agent pools in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - AgentPoolsClientListOptions contains the optional parameters for the AgentPoolsClient.List method. @@ -426,7 +426,7 @@ func (client *AgentPoolsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -445,7 +445,7 @@ func (client *AgentPoolsClient) listHandleResponse(resp *http.Response) (AgentPo // to the nodes. AKS provides one new image per week with the latest updates. For more details on node image // 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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -467,7 +467,7 @@ func (client *AgentPoolsClient) BeginUpgradeNodeImageVersion(ctx context.Context // the nodes. AKS provides one new image per week with the latest updates. For more details on node image // 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 2022-06-01 +// Generated from API version 2022-07-01 func (client *AgentPoolsClient) upgradeNodeImageVersion(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginUpgradeNodeImageVersionOptions) (*http.Response, error) { req, err := client.upgradeNodeImageVersionCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { @@ -507,7 +507,7 @@ func (client *AgentPoolsClient) upgradeNodeImageVersionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go deleted file mode 100644 index 61ec0189ff6c..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go +++ /dev/null @@ -1,201 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewAgentPoolsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "clustername1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewAgentPoolsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "clustername1", - "agentpool1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/examples/AgentPoolsCreate_Snapshot.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewAgentPoolsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "clustername1", - "agentpool1", - armcontainerservice.AgentPool{ - Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - Count: to.Ptr[int32](3), - CreationData: &armcontainerservice.CreationData{ - SourceResourceID: to.Ptr("/subscriptions/subid1/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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/examples/AgentPoolsDelete.json -func ExampleAgentPoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewAgentPoolsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(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/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewAgentPoolsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetUpgradeProfile(ctx, - "rg1", - "clustername1", - "agentpool1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewAgentPoolsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAvailableAgentPoolVersions(ctx, - "rg1", - "clustername1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewAgentPoolsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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 80712dacf2f6..0485df113375 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md +++ b/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/43ca5ba8c01eafc595f418a66adb6c3c09d9b965/specification/containerservice/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/43ca5ba8c01eafc595f418a66adb6c3c09d9b965/specification/containerservice/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerservice/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerservice/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0 +module-version: 2.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/constants.go b/sdk/resourcemanager/containerservice/armcontainerservice/constants.go index 0b291c270943..cca02a243cae 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/constants.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/constants.go @@ -11,7 +11,7 @@ package armcontainerservice const ( moduleName = "armcontainerservice" - moduleVersion = "v2.0.0" + moduleVersion = "v2.1.0" ) // AgentPoolMode - A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent @@ -822,12 +822,15 @@ func PossibleOSDiskTypeValues() []OSDiskType { } } -// OSSKU - Specifies an OS SKU. This value must not be specified if OSType is Windows. +// OSSKU - Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 +// when Kubernetes = 1.25 if OSType is Windows. type OSSKU string const ( - OSSKUCBLMariner OSSKU = "CBLMariner" - OSSKUUbuntu OSSKU = "Ubuntu" + OSSKUCBLMariner OSSKU = "CBLMariner" + OSSKUUbuntu OSSKU = "Ubuntu" + OSSKUWindows2019 OSSKU = "Windows2019" + OSSKUWindows2022 OSSKU = "Windows2022" ) // PossibleOSSKUValues returns the possible values for the OSSKU const type. @@ -835,6 +838,8 @@ func PossibleOSSKUValues() []OSSKU { return []OSSKU{ OSSKUCBLMariner, OSSKUUbuntu, + OSSKUWindows2019, + OSSKUWindows2022, } } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/go.mod b/sdk/resourcemanager/containerservice/armcontainerservice/go.mod index 581f3eebacf6..75c9ae709dab 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/go.mod +++ b/sdk/resourcemanager/containerservice/armcontainerservice/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/ar go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/go.sum b/sdk/resourcemanager/containerservice/armcontainerservice/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/go.sum +++ b/sdk/resourcemanager/containerservice/armcontainerservice/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go index 49ca677082fc..353cc3226ec7 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go @@ -57,7 +57,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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // configName - The name of the maintenance configuration. @@ -103,7 +103,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // configName - The name of the maintenance configuration. @@ -165,7 +165,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +173,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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // configName - The name of the maintenance configuration. @@ -218,7 +218,7 @@ func (client *MaintenanceConfigurationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,7 +235,7 @@ func (client *MaintenanceConfigurationsClient) getHandleResponse(resp *http.Resp // NewListByManagedClusterPager - Gets a list of maintenance configurations in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - MaintenanceConfigurationsClientListByManagedClusterOptions contains the optional parameters for the MaintenanceConfigurationsClient.ListByManagedCluster @@ -288,7 +288,7 @@ func (client *MaintenanceConfigurationsClient) listByManagedClusterCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go deleted file mode 100644 index c53860481c6c..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go +++ /dev/null @@ -1,129 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/examples/MaintenanceConfigurationsList.json -func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewMaintenanceConfigurationsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByManagedClusterPager("rg1", - "clustername1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/examples/MaintenanceConfigurationsGet.json -func ExampleMaintenanceConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewMaintenanceConfigurationsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "clustername1", - "default", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/examples/MaintenanceConfigurationsCreate_Update.json -func ExampleMaintenanceConfigurationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewMaintenanceConfigurationsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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:00Z"); return t }()), - Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-26T03:00:00Z"); 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/examples/MaintenanceConfigurationsDelete.json -func ExampleMaintenanceConfigurationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewMaintenanceConfigurationsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "clustername1", - "default", - 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 caee097306b5..754117a7ca6d 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go @@ -57,7 +57,7 @@ func NewManagedClustersClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Creates or updates a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The managed cluster to create or update. @@ -77,7 +77,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 2022-06-01 +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster, options *ManagedClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -113,7 +113,7 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +121,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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete @@ -140,7 +140,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 2022-06-01 +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -176,7 +176,7 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +184,7 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re // Get - Gets a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientGetOptions contains the optional parameters for the ManagedClustersClient.Get method. @@ -223,7 +223,7 @@ func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +242,7 @@ func (client *ManagedClustersClient) getHandleResponse(resp *http.Response) (Man // or ListClusterAdminCredentials // [https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials] . // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // roleName - The name of the role for managed cluster accessProfile resource. @@ -287,7 +287,7 @@ func (client *ManagedClustersClient) getAccessProfileCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,7 +304,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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // commandID - Id of the command. @@ -349,7 +349,7 @@ func (client *ManagedClustersClient) getCommandResultCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -366,7 +366,7 @@ func (client *ManagedClustersClient) getCommandResultHandleResponse(resp *http.R // GetOSOptions - Gets supported OS options in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // location - The name of Azure region. // options - ManagedClustersClientGetOSOptionsOptions contains the optional parameters for the ManagedClustersClient.GetOSOptions // method. @@ -401,7 +401,7 @@ func (client *ManagedClustersClient) getOSOptionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.ResourceType != nil { reqQP.Set("resource-type", *options.ResourceType) } @@ -421,7 +421,7 @@ func (client *ManagedClustersClient) getOSOptionsHandleResponse(resp *http.Respo // GetUpgradeProfile - Gets the upgrade profile of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientGetUpgradeProfileOptions contains the optional parameters for the ManagedClustersClient.GetUpgradeProfile @@ -461,7 +461,7 @@ func (client *ManagedClustersClient) getUpgradeProfileCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -478,7 +478,7 @@ func (client *ManagedClustersClient) getUpgradeProfileHandleResponse(resp *http. // NewListPager - Gets a list of managed clusters in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // options - ManagedClustersClientListOptions contains the optional parameters for the ManagedClustersClient.List method. func (client *ManagedClustersClient) NewListPager(options *ManagedClustersClientListOptions) *runtime.Pager[ManagedClustersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedClustersClientListResponse]{ @@ -520,7 +520,7 @@ func (client *ManagedClustersClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -537,7 +537,7 @@ func (client *ManagedClustersClient) listHandleResponse(resp *http.Response) (Ma // NewListByResourceGroupPager - Lists managed clusters in the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - ManagedClustersClientListByResourceGroupOptions contains the optional parameters for the ManagedClustersClient.ListByResourceGroup // method. @@ -585,7 +585,7 @@ func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -602,7 +602,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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListClusterAdminCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterAdminCredentials @@ -642,7 +642,7 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -662,7 +662,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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListClusterMonitoringUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterMonitoringUserCredentials @@ -702,7 +702,7 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -722,7 +722,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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListClusterUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterUserCredentials @@ -762,7 +762,7 @@ func (client *ManagedClustersClient) listClusterUserCredentialsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -786,7 +786,7 @@ func (client *ManagedClustersClient) listClusterUserCredentialsHandleResponse(re // 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the @@ -839,7 +839,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -856,7 +856,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsHan // BeginResetAADProfile - Reset the AAD Profile of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The AAD profile to set on the Managed Cluster @@ -876,7 +876,7 @@ func (client *ManagedClustersClient) BeginResetAADProfile(ctx context.Context, r // ResetAADProfile - Reset the AAD Profile of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) resetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile, options *ManagedClustersClientBeginResetAADProfileOptions) (*http.Response, error) { req, err := client.resetAADProfileCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -912,7 +912,7 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -920,7 +920,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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The service principal profile to set on the managed cluster. @@ -940,7 +940,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 2022-06-01 +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) resetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile, options *ManagedClustersClientBeginResetServicePrincipalProfileOptions) (*http.Response, error) { req, err := client.resetServicePrincipalProfileCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -976,7 +976,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -985,7 +985,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c // BeginRotateClusterCertificates - See Certificate rotation [https://docs.microsoft.com/azure/aks/certificate-rotation] for // more details about rotating managed cluster certificates. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginRotateClusterCertificatesOptions contains the optional parameters for the ManagedClustersClient.BeginRotateClusterCertificates @@ -1005,7 +1005,7 @@ func (client *ManagedClustersClient) BeginRotateClusterCertificates(ctx context. // RotateClusterCertificates - See Certificate rotation [https://docs.microsoft.com/azure/aks/certificate-rotation] for more // details about rotating managed cluster certificates. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) rotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateClusterCertificatesOptions) (*http.Response, error) { req, err := client.rotateClusterCertificatesCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -1041,7 +1041,7 @@ func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1051,7 +1051,7 @@ func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx // see AKS Run Command // [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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // requestPayload - The run command request @@ -1073,7 +1073,7 @@ func (client *ManagedClustersClient) BeginRunCommand(ctx context.Context, resour // see AKS Run Command // [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 2022-06-01 +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) runCommand(ctx context.Context, resourceGroupName string, resourceName string, requestPayload RunCommandRequest, options *ManagedClustersClientBeginRunCommandOptions) (*http.Response, error) { req, err := client.runCommandCreateRequest(ctx, resourceGroupName, resourceName, requestPayload, options) if err != nil { @@ -1109,7 +1109,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, requestPayload) @@ -1118,7 +1118,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context // BeginStart - See starting a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] for more details about starting // a cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginStartOptions contains the optional parameters for the ManagedClustersClient.BeginStart @@ -1138,7 +1138,7 @@ func (client *ManagedClustersClient) BeginStart(ctx context.Context, resourceGro // Start - See starting a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] for more details about starting // a cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) start(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -1174,7 +1174,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1185,7 +1185,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res // cluster does not accrue charges while it is stopped. See stopping a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] // for more details about stopping a cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginStopOptions contains the optional parameters for the ManagedClustersClient.BeginStop @@ -1207,7 +1207,7 @@ func (client *ManagedClustersClient) BeginStop(ctx context.Context, resourceGrou // cluster does not accrue charges while it is stopped. See stopping a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] // for more details about stopping a cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) stop(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -1243,7 +1243,7 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1251,7 +1251,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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - Parameters supplied to the Update Managed Cluster Tags operation. @@ -1271,7 +1271,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 2022-06-01 +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) updateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClustersClientBeginUpdateTagsOptions) (*http.Response, error) { req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -1307,7 +1307,7 @@ func (client *ManagedClustersClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) 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 6bf78c9e4824..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go +++ /dev/null @@ -1,578 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetOSOptions(ctx, - "location1", - &armcontainerservice.ManagedClustersClientGetOSOptionsOptions{ResourceType: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("rg1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetUpgradeProfile(ctx, - "rg1", - "clustername1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAccessProfile(ctx, - "rg1", - "clustername1", - "clusterUser", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListClusterAdminCredentials(ctx, - "rg1", - "clustername1", - &armcontainerservice.ManagedClustersClientListClusterAdminCredentialsOptions{ServerFqdn: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/examples/ManagedClustersListClusterCredentialResult.json -func ExampleManagedClustersClient_ListClusterUserCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListClusterUserCredentials(ctx, - "rg1", - "clustername1", - &armcontainerservice.ManagedClustersClientListClusterUserCredentialsOptions{ServerFqdn: nil, - Format: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/examples/ManagedClustersListClusterCredentialResult.json -func ExampleManagedClustersClient_ListClusterMonitoringUserCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListClusterMonitoringUserCredentials(ctx, - "rg1", - "clustername1", - &armcontainerservice.ManagedClustersClientListClusterMonitoringUserCredentialsOptions{ServerFqdn: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "clustername1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/examples/ManagedClustersCreate_Snapshot.json -func ExampleManagedClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/subid1/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/subid1/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.ManagedClusterSKUNameBasic), - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(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/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/examples/RunCommandResultFailed.json -func ExampleManagedClustersClient_GetCommandResult() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetCommandResult(ctx, - "rg1", - "clustername1", - "def7b3ea71bd4f7e9d226ddbc0f00ad9", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListOutboundNetworkDependenciesEndpointsPager("rg1", - "clustername1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/models.go b/sdk/resourcemanager/containerservice/armcontainerservice/models.go index dbd7500efd57..5211b6379970 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/models.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/models.go @@ -627,7 +627,8 @@ type ManagedClusterAgentPoolProfile struct { // see Ephemeral OS [https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os]. OSDiskType *OSDiskType `json:"osDiskType,omitempty"` - // Specifies an OS SKU. This value must not be specified if OSType is Windows. + // Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when + // Kubernetes = 1.25 if OSType is Windows. OSSKU *OSSKU `json:"osSKU,omitempty"` // The operating system type. The default is Linux. @@ -782,7 +783,8 @@ type ManagedClusterAgentPoolProfileProperties struct { // see Ephemeral OS [https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os]. OSDiskType *OSDiskType `json:"osDiskType,omitempty"` - // Specifies an OS SKU. This value must not be specified if OSType is Windows. + // Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when + // Kubernetes = 1.25 if OSType is Windows. OSSKU *OSSKU `json:"osSKU,omitempty"` // The operating system type. The default is Linux. @@ -1906,7 +1908,8 @@ type SnapshotProperties struct { // READ-ONLY; The version of node image. NodeImageVersion *string `json:"nodeImageVersion,omitempty" azure:"ro"` - // READ-ONLY; Specifies an OS SKU. This value must not be specified if OSType is Windows. + // READ-ONLY; Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 + // when Kubernetes = 1.25 if OSType is Windows. OSSKU *OSSKU `json:"osSku,omitempty" azure:"ro"` // READ-ONLY; The operating system type. The default is Linux. diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/operations_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/operations_client.go index b47517acd261..ca5f8a4504cc 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/operations_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/operations_client.go @@ -51,7 +51,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Gets a list of operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -83,7 +83,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") 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 208ff42559a2..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/operations_client_example_test.go +++ /dev/null @@ -1,41 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client.go index a6c057f1dcc8..d0dafbe0cdae 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client.go @@ -57,7 +57,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 2022-06-01 +// Generated from API version 2022-07-01 // 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. @@ -77,7 +77,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 2022-06-01 +// Generated from API version 2022-07-01 func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) if err != nil { @@ -117,7 +117,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -125,7 +125,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 2022-06-01 +// Generated from API version 2022-07-01 // 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. @@ -170,7 +170,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,7 +187,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 2022-06-01 +// Generated from API version 2022-07-01 // 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 @@ -227,7 +227,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,7 +244,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 2022-06-01 +// Generated from API version 2022-07-01 // 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. @@ -290,7 +290,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) 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 45ccbcd25130..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewPrivateEndpointConnectionsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "rg1", - "clustername1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewPrivateEndpointConnectionsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "clustername1", - "privateendpointconnection1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewPrivateEndpointConnectionsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewPrivateEndpointConnectionsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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 5b4b800de2cd..da1b1dc7bfdb 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client.go @@ -57,7 +57,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 2022-06-01 +// Generated from API version 2022-07-01 // 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 @@ -97,7 +97,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") 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 debbf44e10d9..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,39 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewPrivateLinkResourcesClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "rg1", - "clustername1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client.go index 4bcaed19a912..56a80d14e6b2 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client.go @@ -57,7 +57,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 2022-06-01 +// Generated from API version 2022-07-01 // 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. @@ -98,7 +98,7 @@ func (client *ResolvePrivateLinkServiceIDClient) postCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) 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 1eec39a1bacf..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client_example_test.go +++ /dev/null @@ -1,43 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewResolvePrivateLinkServiceIDClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.POST(ctx, - "rg1", - "clustername1", - armcontainerservice.PrivateLinkResource{ - Name: to.Ptr("management"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client.go index 7ffd73f01053..54a69c2e408d 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client.go @@ -57,7 +57,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 2022-06-01 +// Generated from API version 2022-07-01 // 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. @@ -98,7 +98,7 @@ func (client *SnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -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 2022-06-01 +// Generated from API version 2022-07-01 // 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. @@ -154,7 +154,7 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -162,7 +162,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 2022-06-01 +// Generated from API version 2022-07-01 // 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. @@ -201,7 +201,7 @@ func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -218,7 +218,7 @@ func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (Snapshots // NewListPager - Gets a list of snapshots in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // options - SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.List method. func (client *SnapshotsClient) NewListPager(options *SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListResponse]{ @@ -260,7 +260,7 @@ func (client *SnapshotsClient) listCreateRequest(ctx context.Context, options *S return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (Snapshot // NewListByResourceGroupPager - Lists snapshots in the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.ListByResourceGroup // method. @@ -325,7 +325,7 @@ func (client *SnapshotsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +342,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 2022-06-01 +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - Parameters supplied to the Update snapshot Tags operation. @@ -382,7 +382,7 @@ func (client *SnapshotsClient) updateTagsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) 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 d3c77e1ee215..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client_example_test.go +++ /dev/null @@ -1,171 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewSnapshotsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewSnapshotsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("rg1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewSnapshotsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "snapshot1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewSnapshotsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewSnapshotsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-06-01/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() - client, err := armcontainerservice.NewSnapshotsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "snapshot1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -}