diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md index 47bdc9d88063..5fcca4e3de49 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md +++ b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md @@ -1,5 +1,101 @@ # Release History +## 2.0.0-beta.1 (2022-05-30) +### Breaking Changes + +- Struct `ManagedClusterSecurityProfileAzureDefender` has been removed +- Field `AzureDefender` of struct `ManagedClusterSecurityProfile` has been removed + +### Features Added + +- New const `NetworkPluginModeOverlay` +- New const `OSSKUWindows2022` +- New const `TrustedAccessRoleBindingProvisioningStateUpdating` +- New const `OSSKUWindows2019` +- New const `KeyVaultNetworkAccessTypesPublic` +- New const `TrustedAccessRoleBindingProvisioningStateFailed` +- New const `KeyVaultNetworkAccessTypesPrivate` +- New const `TrustedAccessRoleBindingProvisioningStateDeleting` +- New const `TrustedAccessRoleBindingProvisioningStateSucceeded` +- New const `SnapshotTypeManagedCluster` +- New const `NetworkPluginNone` +- New function `PossibleKeyVaultNetworkAccessTypesValues() []KeyVaultNetworkAccessTypes` +- New function `*ManagedClustersClient.BeginRotateServiceAccountSigningKeys(context.Context, string, string, *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*runtime.Poller[ManagedClustersClientRotateServiceAccountSigningKeysResponse], error)` +- New function `PossibleNetworkPluginModeValues() []NetworkPluginMode` +- New function `ManagedClusterSnapshot.MarshalJSON() ([]byte, error)` +- New function `TrustedAccessRoleBindingProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleTrustedAccessRoleBindingProvisioningStateValues() []TrustedAccessRoleBindingProvisioningState` +- New struct `AzureKeyVaultKms` +- New struct `ManagedClusterIngressProfile` +- New struct `ManagedClusterIngressProfileWebAppRouting` +- New struct `ManagedClusterOIDCIssuerProfile` +- New struct `ManagedClusterPropertiesForSnapshot` +- New struct `ManagedClusterSecurityProfileDefender` +- New struct `ManagedClusterSecurityProfileDefenderSecurityMonitoring` +- New struct `ManagedClusterSecurityProfileWorkloadIdentity` +- New struct `ManagedClusterSnapshot` +- New struct `ManagedClusterSnapshotListResult` +- New struct `ManagedClusterSnapshotProperties` +- New struct `ManagedClusterSnapshotsClientCreateOrUpdateOptions` +- New struct `ManagedClusterSnapshotsClientCreateOrUpdateResponse` +- New struct `ManagedClusterSnapshotsClientDeleteOptions` +- New struct `ManagedClusterSnapshotsClientDeleteResponse` +- New struct `ManagedClusterSnapshotsClientGetOptions` +- New struct `ManagedClusterSnapshotsClientGetResponse` +- New struct `ManagedClusterSnapshotsClientListByResourceGroupOptions` +- New struct `ManagedClusterSnapshotsClientListByResourceGroupResponse` +- New struct `ManagedClusterSnapshotsClientListOptions` +- New struct `ManagedClusterSnapshotsClientListResponse` +- New struct `ManagedClusterSnapshotsClientUpdateTagsOptions` +- New struct `ManagedClusterSnapshotsClientUpdateTagsResponse` +- New struct `ManagedClusterStorageProfileBlobCSIDriver` +- New struct `ManagedClusterWorkloadAutoScalerProfile` +- New struct `ManagedClusterWorkloadAutoScalerProfileKeda` +- New struct `ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions` +- New struct `ManagedClustersClientRotateServiceAccountSigningKeysResponse` +- New struct `NetworkProfileForSnapshot` +- New struct `TrustedAccessRole` +- New struct `TrustedAccessRoleBinding` +- New struct `TrustedAccessRoleBindingListResult` +- New struct `TrustedAccessRoleBindingProperties` +- New struct `TrustedAccessRoleBindingsClientCreateOrUpdateOptions` +- New struct `TrustedAccessRoleBindingsClientCreateOrUpdateResponse` +- New struct `TrustedAccessRoleBindingsClientDeleteOptions` +- New struct `TrustedAccessRoleBindingsClientDeleteResponse` +- New struct `TrustedAccessRoleBindingsClientGetOptions` +- New struct `TrustedAccessRoleBindingsClientGetResponse` +- New struct `TrustedAccessRoleBindingsClientListOptions` +- New struct `TrustedAccessRoleBindingsClientListResponse` +- New struct `TrustedAccessRoleListResult` +- New struct `TrustedAccessRoleRule` +- New struct `TrustedAccessRolesClientListOptions` +- New struct `TrustedAccessRolesClientListResponse` +- New field `CapacityReservationGroupID` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `EnableCustomCATrust` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `MessageOfTheDay` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `HostGroupID` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `EnableNamespaceResources` in struct `ManagedClusterProperties` +- New field `WorkloadAutoScalerProfile` in struct `ManagedClusterProperties` +- New field `OidcIssuerProfile` in struct `ManagedClusterProperties` +- New field `CreationData` in struct `ManagedClusterProperties` +- New field `IngressProfile` in struct `ManagedClusterProperties` +- New field `SubnetID` in struct `ManagedClusterAPIServerAccessProfile` +- New field `EnableVnetIntegration` in struct `ManagedClusterAPIServerAccessProfile` +- New field `BlobCSIDriver` in struct `ManagedClusterStorageProfile` +- New field `IgnorePodDisruptionBudget` in struct `ManagedClustersClientBeginDeleteOptions` +- New field `AzureKeyVaultKms` in struct `ManagedClusterSecurityProfile` +- New field `Defender` in struct `ManagedClusterSecurityProfile` +- New field `WorkloadIdentity` in struct `ManagedClusterSecurityProfile` +- New field `Version` in struct `ManagedClusterStorageProfileDiskCSIDriver` +- New field `IgnorePodDisruptionBudget` in struct `AgentPoolsClientBeginDeleteOptions` +- New field `NetworkPluginMode` in struct `NetworkProfile` +- New field `EffectiveNoProxy` in struct `ManagedClusterHTTPProxyConfig` +- New field `CapacityReservationGroupID` in struct `ManagedClusterAgentPoolProfile` +- New field `EnableCustomCATrust` in struct `ManagedClusterAgentPoolProfile` +- New field `MessageOfTheDay` in struct `ManagedClusterAgentPoolProfile` +- New field `HostGroupID` in struct `ManagedClusterAgentPoolProfile` + + ## 1.0.0 (2022-05-16) ### Breaking Changes diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md b/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md index 43d7192fe91a..a14fe9d2527d 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/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/containerservice/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/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: 1.0.0 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/go.mod b/sdk/resourcemanager/containerservice/armcontainerservice/go.mod index f62e2cbb953d..f8f47a243c1c 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/go.mod +++ b/sdk/resourcemanager/containerservice/armcontainerservice/go.mod @@ -1,21 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2 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.0.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.4.0 // 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 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 ) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/go.sum b/sdk/resourcemanager/containerservice/armcontainerservice/go.sum index ed5b814680ee..3f874a3bc5a6 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/go.sum +++ b/sdk/resourcemanager/containerservice/armcontainerservice/go.sum @@ -1,33 +1,12 @@ 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.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= 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.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/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.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 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/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_agentpools_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_agentpools_client_test.go deleted file mode 100644 index a649eab5b2aa..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_agentpools_client_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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-04-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-04-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-04-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-04-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-04-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-04-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-04-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/ze_generated_example_maintenanceconfigurations_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_maintenanceconfigurations_client_test.go deleted file mode 100644 index 03279655e0f3..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_maintenanceconfigurations_client_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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-04-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-04-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-04-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-04-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/ze_generated_example_managedclusters_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_managedclusters_client_test.go deleted file mode 100644 index 8483ef9beb67..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_managedclusters_client_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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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-04-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/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_operations_client_test.go deleted file mode 100644 index 39824944e8ee..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_operations_client_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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-04-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/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index f63191c0d21d..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_privateendpointconnections_client_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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-04-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-04-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-04-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-04-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/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index 3acf5fb8eaa6..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_privatelinkresources_client_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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-04-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/ze_generated_example_resolveprivatelinkserviceid_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_resolveprivatelinkserviceid_client_test.go deleted file mode 100644 index 38c85caa3016..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_resolveprivatelinkserviceid_client_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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-04-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/ze_generated_example_snapshots_client_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_snapshots_client_test.go deleted file mode 100644 index ecb625724240..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/ze_generated_example_snapshots_client_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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-04-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-04-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-04-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-04-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-04-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-04-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) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_agentpools_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_agentpools_client.go index 3043903f8bd1..50c1fac6c449 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_agentpools_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_agentpools_client.go @@ -19,6 +19,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -56,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -77,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -117,7 +118,7 @@ func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -144,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -184,7 +185,10 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") + if options != nil && options.IgnorePodDisruptionBudget != nil { + reqQP.Set("ignore-pod-disruption-budget", strconv.FormatBool(*options.IgnorePodDisruptionBudget)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +196,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -236,7 +240,7 @@ func (client *AgentPoolsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +258,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - AgentPoolsClientGetAvailableAgentPoolVersionsOptions contains the optional parameters for the AgentPoolsClient.GetAvailableAgentPoolVersions @@ -294,7 +298,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -311,7 +315,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -356,7 +360,7 @@ func (client *AgentPoolsClient) getUpgradeProfileCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,7 +377,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - AgentPoolsClientListOptions contains the optional parameters for the AgentPoolsClient.List method. @@ -425,7 +429,7 @@ func (client *AgentPoolsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -444,7 +448,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -466,7 +470,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -506,7 +510,7 @@ func (client *AgentPoolsClient) upgradeNodeImageVersionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_constants.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_constants.go index e59da28a7a85..82739b3d1dea 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_constants.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_constants.go @@ -10,7 +10,7 @@ package armcontainerservice const ( moduleName = "armcontainerservice" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) // AgentPoolMode - A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent @@ -604,6 +604,24 @@ func PossibleIPFamilyValues() []IPFamily { } } +// KeyVaultNetworkAccessTypes - Network access of key vault. The possible values are Public and Private. Public means the +// key vault allows public access from all networks. Private means the key vault disables public access and +// enables private link. The default value is Public. +type KeyVaultNetworkAccessTypes string + +const ( + KeyVaultNetworkAccessTypesPrivate KeyVaultNetworkAccessTypes = "Private" + KeyVaultNetworkAccessTypesPublic KeyVaultNetworkAccessTypes = "Public" +) + +// PossibleKeyVaultNetworkAccessTypesValues returns the possible values for the KeyVaultNetworkAccessTypes const type. +func PossibleKeyVaultNetworkAccessTypesValues() []KeyVaultNetworkAccessTypes { + return []KeyVaultNetworkAccessTypes{ + KeyVaultNetworkAccessTypesPrivate, + KeyVaultNetworkAccessTypesPublic, + } +} + // KubeletDiskType - Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. type KubeletDiskType string @@ -745,6 +763,9 @@ const ( // NetworkPluginKubenet - Use the Kubenet network plugin. See [Kubenet (basic) networking](https://docs.microsoft.com/azure/aks/concepts-network#kubenet-basic-networking) // for more information. NetworkPluginKubenet NetworkPlugin = "kubenet" + // NetworkPluginNone - Do not use a network plugin. A custom CNI will need to be installed after cluster creation for networking + // functionality. + NetworkPluginNone NetworkPlugin = "none" ) // PossibleNetworkPluginValues returns the possible values for the NetworkPlugin const type. @@ -752,6 +773,23 @@ func PossibleNetworkPluginValues() []NetworkPlugin { return []NetworkPlugin{ NetworkPluginAzure, NetworkPluginKubenet, + NetworkPluginNone, + } +} + +// NetworkPluginMode - The mode the network plugin should use. +type NetworkPluginMode string + +const ( + // NetworkPluginModeOverlay - Pods are given IPs from the PodCIDR address space but use Azure Routing Domains rather than + // Kubenet reference plugins host-local and bridge. + NetworkPluginModeOverlay NetworkPluginMode = "Overlay" +) + +// PossibleNetworkPluginModeValues returns the possible values for the NetworkPluginMode const type. +func PossibleNetworkPluginModeValues() []NetworkPluginMode { + return []NetworkPluginMode{ + NetworkPluginModeOverlay, } } @@ -799,12 +837,16 @@ 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. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 +// if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 +// after Windows2019 is deprecated. 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. @@ -812,6 +854,8 @@ func PossibleOSSKUValues() []OSSKU { return []OSSKU{ OSSKUCBLMariner, OSSKUUbuntu, + OSSKUWindows2019, + OSSKUWindows2022, } } @@ -986,6 +1030,8 @@ func PossibleScaleSetPriorityValues() []ScaleSetPriority { type SnapshotType string const ( + // SnapshotTypeManagedCluster - The snapshot is a snapshot of a managed cluster. + SnapshotTypeManagedCluster SnapshotType = "ManagedCluster" // SnapshotTypeNodePool - The snapshot is a snapshot of a node pool. SnapshotTypeNodePool SnapshotType = "NodePool" ) @@ -993,10 +1039,31 @@ const ( // PossibleSnapshotTypeValues returns the possible values for the SnapshotType const type. func PossibleSnapshotTypeValues() []SnapshotType { return []SnapshotType{ + SnapshotTypeManagedCluster, SnapshotTypeNodePool, } } +// TrustedAccessRoleBindingProvisioningState - The current provisioning state of trusted access role binding. +type TrustedAccessRoleBindingProvisioningState string + +const ( + TrustedAccessRoleBindingProvisioningStateDeleting TrustedAccessRoleBindingProvisioningState = "Deleting" + TrustedAccessRoleBindingProvisioningStateFailed TrustedAccessRoleBindingProvisioningState = "Failed" + TrustedAccessRoleBindingProvisioningStateSucceeded TrustedAccessRoleBindingProvisioningState = "Succeeded" + TrustedAccessRoleBindingProvisioningStateUpdating TrustedAccessRoleBindingProvisioningState = "Updating" +) + +// PossibleTrustedAccessRoleBindingProvisioningStateValues returns the possible values for the TrustedAccessRoleBindingProvisioningState const type. +func PossibleTrustedAccessRoleBindingProvisioningStateValues() []TrustedAccessRoleBindingProvisioningState { + return []TrustedAccessRoleBindingProvisioningState{ + TrustedAccessRoleBindingProvisioningStateDeleting, + TrustedAccessRoleBindingProvisioningStateFailed, + TrustedAccessRoleBindingProvisioningStateSucceeded, + TrustedAccessRoleBindingProvisioningStateUpdating, + } +} + // UpgradeChannel - For more information see setting the AKS cluster auto-upgrade channel [https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel]. type UpgradeChannel string diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_maintenanceconfigurations_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_maintenanceconfigurations_client.go index 08e391f0e44b..94d5919c64bd 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_maintenanceconfigurations_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_maintenanceconfigurations_client.go @@ -56,7 +56,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // configName - The name of the maintenance configuration. @@ -102,7 +102,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -119,7 +119,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // configName - The name of the maintenance configuration. @@ -164,7 +164,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +172,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C // Get - Gets the specified maintenance configuration of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // configName - The name of the maintenance configuration. @@ -217,7 +217,7 @@ func (client *MaintenanceConfigurationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +234,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - MaintenanceConfigurationsClientListByManagedClusterOptions contains the optional parameters for the MaintenanceConfigurationsClient.ListByManagedCluster @@ -287,7 +287,7 @@ func (client *MaintenanceConfigurationsClient) listByManagedClusterCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclusters_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclusters_client.go index 1c55d117f8a1..34d886303178 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclusters_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclusters_client.go @@ -19,6 +19,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -56,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The managed cluster to create or update. @@ -76,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -112,7 +113,7 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete @@ -139,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -175,7 +176,10 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") + if options != nil && options.IgnorePodDisruptionBudget != nil { + reqQP.Set("ignore-pod-disruption-budget", strconv.FormatBool(*options.IgnorePodDisruptionBudget)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +187,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientGetOptions contains the optional parameters for the ManagedClustersClient.Get method. @@ -222,7 +226,7 @@ func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,7 +245,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // roleName - The name of the role for managed cluster accessProfile resource. @@ -286,7 +290,7 @@ func (client *ManagedClustersClient) getAccessProfileCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,7 +307,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // commandID - Id of the command. @@ -348,7 +352,7 @@ func (client *ManagedClustersClient) getCommandResultCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,7 +369,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-04-01 +// Generated from API version 2022-05-02-preview // location - The name of Azure region. // options - ManagedClustersClientGetOSOptionsOptions contains the optional parameters for the ManagedClustersClient.GetOSOptions // method. @@ -400,7 +404,7 @@ func (client *ManagedClustersClient) getOSOptionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") if options != nil && options.ResourceType != nil { reqQP.Set("resource-type", *options.ResourceType) } @@ -420,7 +424,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientGetUpgradeProfileOptions contains the optional parameters for the ManagedClustersClient.GetUpgradeProfile @@ -460,7 +464,7 @@ func (client *ManagedClustersClient) getUpgradeProfileCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -477,7 +481,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-04-01 +// Generated from API version 2022-05-02-preview // 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]{ @@ -519,7 +523,7 @@ func (client *ManagedClustersClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -536,7 +540,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - ManagedClustersClientListByResourceGroupOptions contains the optional parameters for the ManagedClustersClient.ListByResourceGroup // method. @@ -584,7 +588,7 @@ func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -601,7 +605,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListClusterAdminCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterAdminCredentials @@ -641,7 +645,7 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -661,7 +665,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListClusterMonitoringUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterMonitoringUserCredentials @@ -701,7 +705,7 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -721,7 +725,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListClusterUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterUserCredentials @@ -761,7 +765,7 @@ func (client *ManagedClustersClient) listClusterUserCredentialsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -785,7 +789,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the @@ -838,7 +842,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -855,7 +859,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The AAD profile to set on the Managed Cluster @@ -875,7 +879,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -911,7 +915,7 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -919,7 +923,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The service principal profile to set on the managed cluster. @@ -939,7 +943,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -975,7 +979,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -984,7 +988,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginRotateClusterCertificatesOptions contains the optional parameters for the ManagedClustersClient.BeginRotateClusterCertificates @@ -1004,7 +1008,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -1040,7 +1044,70 @@ func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginRotateServiceAccountSigningKeys - Rotates the service account signing keys of a managed cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// options - ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions contains the optional parameters for the ManagedClustersClient.BeginRotateServiceAccountSigningKeys +// method. +func (client *ManagedClustersClient) BeginRotateServiceAccountSigningKeys(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*runtime.Poller[ManagedClustersClientRotateServiceAccountSigningKeysResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.rotateServiceAccountSigningKeys(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedClustersClientRotateServiceAccountSigningKeysResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedClustersClientRotateServiceAccountSigningKeysResponse](options.ResumeToken, client.pl, nil) + } +} + +// RotateServiceAccountSigningKeys - Rotates the service account signing keys of a managed cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +func (client *ManagedClustersClient) rotateServiceAccountSigningKeys(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*http.Response, error) { + req, err := client.rotateServiceAccountSigningKeysCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// rotateServiceAccountSigningKeysCreateRequest creates the RotateServiceAccountSigningKeys request. +func (client *ManagedClustersClient) rotateServiceAccountSigningKeysCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1050,7 +1117,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // requestPayload - The run command request @@ -1072,7 +1139,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -1108,7 +1175,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, requestPayload) @@ -1117,7 +1184,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginStartOptions contains the optional parameters for the ManagedClustersClient.BeginStart @@ -1137,7 +1204,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -1173,7 +1240,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1184,7 +1251,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginStopOptions contains the optional parameters for the ManagedClustersClient.BeginStop @@ -1206,7 +1273,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -1242,7 +1309,7 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1250,7 +1317,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - Parameters supplied to the Update Managed Cluster Tags operation. @@ -1270,7 +1337,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -1306,7 +1373,7 @@ func (client *ManagedClustersClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") 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/zz_generated_managedclustersnapshots_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclustersnapshots_client.go new file mode 100644 index 000000000000..a1b279986b33 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_managedclustersnapshots_client.go @@ -0,0 +1,401 @@ +//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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedClusterSnapshotsClient contains the methods for the ManagedClusterSnapshots group. +// Don't use this type directly, use NewManagedClusterSnapshotsClient() instead. +type ManagedClusterSnapshotsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedClusterSnapshotsClient creates a new instance of ManagedClusterSnapshotsClient with the specified values. +// subscriptionID - The ID of the target subscription. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewManagedClusterSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedClusterSnapshotsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a managed cluster snapshot. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// parameters - The managed cluster snapshot to create or update. +// options - ManagedClusterSnapshotsClientCreateOrUpdateOptions contains the optional parameters for the ManagedClusterSnapshotsClient.CreateOrUpdate +// method. +func (client *ManagedClusterSnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterSnapshot, options *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedClusterSnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterSnapshot, options *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ManagedClusterSnapshotsClient) createOrUpdateHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error) { + result := ManagedClusterSnapshotsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshot); err != nil { + return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes a managed cluster snapshot. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// options - ManagedClusterSnapshotsClientDeleteOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Delete +// method. +func (client *ManagedClusterSnapshotsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClusterSnapshotsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClusterSnapshotsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ManagedClusterSnapshotsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ManagedClusterSnapshotsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ManagedClusterSnapshotsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a managed cluster snapshot. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// options - ManagedClusterSnapshotsClientGetOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Get +// method. +func (client *ManagedClusterSnapshotsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClusterSnapshotsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClusterSnapshotsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedClusterSnapshotsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedClusterSnapshotsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedClusterSnapshotsClient) getHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientGetResponse, error) { + result := ManagedClusterSnapshotsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshot); err != nil { + return ManagedClusterSnapshotsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets a list of managed cluster snapshots in the specified subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +// options - ManagedClusterSnapshotsClientListOptions contains the optional parameters for the ManagedClusterSnapshotsClient.List +// method. +func (client *ManagedClusterSnapshotsClient) NewListPager(options *ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedClusterSnapshotsClientListResponse]{ + More: func(page ManagedClusterSnapshotsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedClusterSnapshotsClientListResponse) (ManagedClusterSnapshotsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedClusterSnapshotsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClusterSnapshotsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedClusterSnapshotsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ManagedClusterSnapshotsClient) listCreateRequest(ctx context.Context, options *ManagedClusterSnapshotsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ManagedClusterSnapshotsClient) listHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientListResponse, error) { + result := ManagedClusterSnapshotsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshotListResult); err != nil { + return ManagedClusterSnapshotsClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists managed cluster snapshots in the specified subscription and resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// options - ManagedClusterSnapshotsClientListByResourceGroupOptions contains the optional parameters for the ManagedClusterSnapshotsClient.ListByResourceGroup +// method. +func (client *ManagedClusterSnapshotsClient) NewListByResourceGroupPager(resourceGroupName string, options *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedClusterSnapshotsClientListByResourceGroupResponse]{ + More: func(page ManagedClusterSnapshotsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedClusterSnapshotsClientListByResourceGroupResponse) (ManagedClusterSnapshotsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ManagedClusterSnapshotsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedClusterSnapshotsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ManagedClusterSnapshotsClient) listByResourceGroupHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientListByResourceGroupResponse, error) { + result := ManagedClusterSnapshotsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshotListResult); err != nil { + return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates tags on a managed cluster snapshot. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// parameters - Parameters supplied to the Update managed cluster snapshot Tags operation. +// options - ManagedClusterSnapshotsClientUpdateTagsOptions contains the optional parameters for the ManagedClusterSnapshotsClient.UpdateTags +// method. +func (client *ManagedClusterSnapshotsClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedClusterSnapshotsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ManagedClusterSnapshotsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClusterSnapshotsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *ManagedClusterSnapshotsClient) updateTagsHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientUpdateTagsResponse, error) { + result := ManagedClusterSnapshotsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshot); err != nil { + return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models.go index f1f9a8e31ab2..9a95f2c74218 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models.go @@ -129,6 +129,8 @@ type AgentPoolsClientBeginCreateOrUpdateOptions struct { // AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method. type AgentPoolsClientBeginDeleteOptions struct { + // ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + IgnorePodDisruptionBudget *bool // Resumes the LRO from the provided token. ResumeToken string } @@ -161,6 +163,27 @@ type AgentPoolsClientListOptions struct { // placeholder for future optional parameters } +// AzureKeyVaultKms - Azure Key Vault key management service settings for the security profile. +type AzureKeyVaultKms struct { + // Whether to enable Azure Key Vault key management service. The default is false. + Enabled *bool `json:"enabled,omitempty"` + + // Identifier of Azure Key Vault key. See key identifier format [https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name] + // for more details. + // When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When + // Azure Key Vault key management service is disabled, leave the field empty. + KeyID *string `json:"keyId,omitempty"` + + // Network access of key vault. The possible values are Public and Private. Public means the key vault allows public access + // from all networks. Private means the key vault disables public access and + // enables private link. The default value is Public. + KeyVaultNetworkAccess *KeyVaultNetworkAccessTypes `json:"keyVaultNetworkAccess,omitempty"` + + // Resource ID of key vault. When keyVaultNetworkAccess is Private, this field is required and must be a valid resource ID. + // When keyVaultNetworkAccess is Public, leave the field empty. + KeyVaultResourceID *string `json:"keyVaultResourceId,omitempty"` +} + // CloudError - An error response from the Container service. type CloudError struct { // Details about the error. @@ -468,9 +491,16 @@ type ManagedClusterAPIServerAccessProfile struct { // Whether to create additional public FQDN for private cluster or not. EnablePrivateClusterPublicFQDN *bool `json:"enablePrivateClusterPublicFQDN,omitempty"` + // Whether to enable apiserver vnet integration for the cluster or not. + EnableVnetIntegration *bool `json:"enableVnetIntegration,omitempty"` + // The default is System. For more details see configure private DNS zone [https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone]. // Allowed values are 'system' and 'none'. PrivateDNSZone *string `json:"privateDNSZone,omitempty"` + + // It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet + // integration. + SubnetID *string `json:"subnetId,omitempty"` } // ManagedClusterAccessProfile - Managed cluster Access Profile. @@ -529,6 +559,9 @@ type ManagedClusterAgentPoolProfile struct { // The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. AvailabilityZones []*string `json:"availabilityZones,omitempty"` + // AKS will associate the specified agent pool with the Capacity Reservation Group. + CapacityReservationGroupID *string `json:"capacityReservationGroupID,omitempty"` + // Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user // pools and in the range of 1 to 1000 (inclusive) for system pools. The default // value is 1. @@ -540,6 +573,10 @@ type ManagedClusterAgentPoolProfile struct { // Whether to enable auto-scaler EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + // When set to true, AKS deploys a daemonset and host services to sync custom certificate authorities from a user-provided + // config map into node trust stores. Defaults to false. + EnableCustomCATrust *bool `json:"enableCustomCATrust,omitempty"` + // This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption EnableEncryptionAtHost *bool `json:"enableEncryptionAtHost,omitempty"` @@ -560,6 +597,11 @@ type ManagedClusterAgentPoolProfile struct { // GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. GpuInstanceProfile *GPUInstanceProfile `json:"gpuInstanceProfile,omitempty"` + // This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + // For more information see Azure dedicated hosts + // [https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts]. + HostGroupID *string `json:"hostGroupID,omitempty"` + // The Kubelet configuration on the agent pool nodes. KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"` @@ -575,6 +617,11 @@ type ManagedClusterAgentPoolProfile struct { // The maximum number of pods that can run on a node. MaxPods *int32 `json:"maxPods,omitempty"` + // A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of + // the day for Linux nodes. It must not be specified for Windows nodes. It must be a + // static string (i.e., will be printed raw and not be executed as a script). + MessageOfTheDay *string `json:"messageOfTheDay,omitempty"` + // The minimum number of nodes for auto-scaling MinCount *int32 `json:"minCount,omitempty"` @@ -600,19 +647,21 @@ 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. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + // OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 + // after Windows2019 is deprecated. OSSKU *OSSKU `json:"osSKU,omitempty"` // The operating system type. The default is Linux. OSType *OSType `json:"osType,omitempty"` - // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version - // is chosen automatically. Updating the cluster with the same once it has been - // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, - // you should upgrade all node pools in an AKS cluster to the same Kubernetes - // version. The node pool version must have the same major version as the control plane. The node pool minor version must - // be within two minor versions of the control plane version. The node pool version - // cannot be greater than the control plane version. For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. + // Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating + // the agent pool with the same once it has been created will not trigger an + // upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster + // to the same Kubernetes version. The node pool version must have the same + // major version as the control plane. The node pool minor version must be within two minor versions of the control plane + // version. The node pool version cannot be greater than the control plane version. + // For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` // If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: @@ -663,8 +712,8 @@ type ManagedClusterAgentPoolProfile struct { // Determines the type of workload a node can run. WorkloadRuntime *WorkloadRuntime `json:"workloadRuntime,omitempty"` - // READ-ONLY; If orchestratorVersion is a fully specified version , this field will be exactly equal to it. If orchestratorVersion - // is , this field will contain the full version being used. + // READ-ONLY; If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion + // was , this field will contain the full version being used. CurrentOrchestratorVersion *string `json:"currentOrchestratorVersion,omitempty" azure:"ro"` // READ-ONLY; The version of node image @@ -679,6 +728,9 @@ type ManagedClusterAgentPoolProfileProperties struct { // The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. AvailabilityZones []*string `json:"availabilityZones,omitempty"` + // AKS will associate the specified agent pool with the Capacity Reservation Group. + CapacityReservationGroupID *string `json:"capacityReservationGroupID,omitempty"` + // Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user // pools and in the range of 1 to 1000 (inclusive) for system pools. The default // value is 1. @@ -690,6 +742,10 @@ type ManagedClusterAgentPoolProfileProperties struct { // Whether to enable auto-scaler EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + // When set to true, AKS deploys a daemonset and host services to sync custom certificate authorities from a user-provided + // config map into node trust stores. Defaults to false. + EnableCustomCATrust *bool `json:"enableCustomCATrust,omitempty"` + // This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption EnableEncryptionAtHost *bool `json:"enableEncryptionAtHost,omitempty"` @@ -710,6 +766,11 @@ type ManagedClusterAgentPoolProfileProperties struct { // GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. GpuInstanceProfile *GPUInstanceProfile `json:"gpuInstanceProfile,omitempty"` + // This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + // For more information see Azure dedicated hosts + // [https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts]. + HostGroupID *string `json:"hostGroupID,omitempty"` + // The Kubelet configuration on the agent pool nodes. KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"` @@ -725,6 +786,11 @@ type ManagedClusterAgentPoolProfileProperties struct { // The maximum number of pods that can run on a node. MaxPods *int32 `json:"maxPods,omitempty"` + // A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of + // the day for Linux nodes. It must not be specified for Windows nodes. It must be a + // static string (i.e., will be printed raw and not be executed as a script). + MessageOfTheDay *string `json:"messageOfTheDay,omitempty"` + // The minimum number of nodes for auto-scaling MinCount *int32 `json:"minCount,omitempty"` @@ -750,19 +816,21 @@ 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. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + // OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 + // after Windows2019 is deprecated. OSSKU *OSSKU `json:"osSKU,omitempty"` // The operating system type. The default is Linux. OSType *OSType `json:"osType,omitempty"` - // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version - // is chosen automatically. Updating the cluster with the same once it has been - // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, - // you should upgrade all node pools in an AKS cluster to the same Kubernetes - // version. The node pool version must have the same major version as the control plane. The node pool minor version must - // be within two minor versions of the control plane version. The node pool version - // cannot be greater than the control plane version. For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. + // Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating + // the agent pool with the same once it has been created will not trigger an + // upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster + // to the same Kubernetes version. The node pool version must have the same + // major version as the control plane. The node pool minor version must be within two minor versions of the control plane + // version. The node pool version cannot be greater than the control plane version. + // For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` // If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: @@ -813,8 +881,8 @@ type ManagedClusterAgentPoolProfileProperties struct { // Determines the type of workload a node can run. WorkloadRuntime *WorkloadRuntime `json:"workloadRuntime,omitempty"` - // READ-ONLY; If orchestratorVersion is a fully specified version , this field will be exactly equal to it. If orchestratorVersion - // is , this field will contain the full version being used. + // READ-ONLY; If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion + // was , this field will contain the full version being used. CurrentOrchestratorVersion *string `json:"currentOrchestratorVersion,omitempty" azure:"ro"` // READ-ONLY; The version of node image @@ -843,6 +911,10 @@ type ManagedClusterHTTPProxyConfig struct { // Alternative CA cert to use for connecting to proxy servers. TrustedCa *string `json:"trustedCa,omitempty"` + + // READ-ONLY; A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset + // of noProxy and values injected by AKS. + EffectiveNoProxy []*string `json:"effectiveNoProxy,omitempty" azure:"ro"` } // ManagedClusterIdentity - Identity for the managed cluster. @@ -860,6 +932,21 @@ type ManagedClusterIdentity struct { TenantID *string `json:"tenantId,omitempty" azure:"ro"` } +// ManagedClusterIngressProfile - Ingress profile for the container service cluster. +type ManagedClusterIngressProfile struct { + // Web App Routing settings for the ingress profile. + WebAppRouting *ManagedClusterIngressProfileWebAppRouting `json:"webAppRouting,omitempty"` +} + +// ManagedClusterIngressProfileWebAppRouting - Web App Routing settings for the ingress profile. +type ManagedClusterIngressProfileWebAppRouting struct { + // Resource ID of the DNS Zone to be associated with the web app. Used only when Web App Routing is enabled. + DNSZoneResourceID *string `json:"dnsZoneResourceId,omitempty"` + + // Whether to enable Web App Routing. + Enabled *bool `json:"enabled,omitempty"` +} + // ManagedClusterListResult - The response from the List Managed Clusters operation. type ManagedClusterListResult struct { // The list of managed clusters. @@ -939,6 +1026,15 @@ type ManagedClusterNATGatewayProfile struct { ManagedOutboundIPProfile *ManagedClusterManagedOutboundIPProfile `json:"managedOutboundIPProfile,omitempty"` } +// ManagedClusterOIDCIssuerProfile - The OIDC issuer profile of the Managed Cluster. +type ManagedClusterOIDCIssuerProfile struct { + // Whether the OIDC issuer is enabled. + Enabled *bool `json:"enabled,omitempty"` + + // READ-ONLY; The OIDC issuer url of the Managed Cluster. + IssuerURL *string `json:"issuerURL,omitempty" azure:"ro"` +} + // ManagedClusterPodIdentity - Details about the pod identity assigned to the Managed Cluster. type ManagedClusterPodIdentity struct { // REQUIRED; The user assigned identity details. @@ -1061,6 +1157,9 @@ type ManagedClusterProperties struct { // The auto upgrade configuration. AutoUpgradeProfile *ManagedClusterAutoUpgradeProfile `json:"autoUpgradeProfile,omitempty"` + // CreationData to be used to specify the source Snapshot ID if the cluster will be created/upgraded using a snapshot. + CreationData *CreationData `json:"creationData,omitempty"` + // This cannot be updated once the Managed Cluster has been created. DNSPrefix *string `json:"dnsPrefix,omitempty"` @@ -1072,6 +1171,11 @@ type ManagedClusterProperties struct { // This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' DiskEncryptionSetID *string `json:"diskEncryptionSetID,omitempty"` + // The default value is false. It can be enabled/disabled on creation and updation of the managed cluster. See https://aka.ms/NamespaceARMResource + // [https://aka.ms/NamespaceARMResource] for more details + // on Namespace as a ARM Resource. + EnableNamespaceResources *bool `json:"enableNamespaceResources,omitempty"` + // (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, // 2020. Learn more at aka.ms/aks/azpodpolicy. EnablePodSecurityPolicy *bool `json:"enablePodSecurityPolicy,omitempty"` @@ -1088,13 +1192,13 @@ type ManagedClusterProperties struct { // Identities associated with the cluster. IdentityProfile map[string]*UserAssignedIdentity `json:"identityProfile,omitempty"` - // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version - // is chosen automatically. Updating the cluster with the same once it has been - // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade - // a supported AKS cluster, Kubernetes minor versions cannot be skipped. All - // upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x - // -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See upgrading - // an AKS cluster [https://docs.microsoft.com/azure/aks/upgrade-cluster] for more details. + // Ingress profile for the managed cluster. + IngressProfile *ManagedClusterIngressProfile `json:"ingressProfile,omitempty"` + + // When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially + // by major version number. For example, upgrades between 1.14.x -> + // 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See upgrading an AKS cluster [https://docs.microsoft.com/azure/aks/upgrade-cluster] + // for more details. KubernetesVersion *string `json:"kubernetesVersion,omitempty"` // The profile for Linux VMs in the Managed Cluster. @@ -1106,6 +1210,9 @@ type ManagedClusterProperties struct { // The name of the resource group containing agent pool nodes. NodeResourceGroup *string `json:"nodeResourceGroup,omitempty"` + // The OIDC issuer profile of the Managed Cluster. + OidcIssuerProfile *ManagedClusterOIDCIssuerProfile `json:"oidcIssuerProfile,omitempty"` + // See use AAD pod identity [https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity] for more details on AAD pod identity // integration. PodIdentityProfile *ManagedClusterPodIdentityProfile `json:"podIdentityProfile,omitempty"` @@ -1128,13 +1235,15 @@ type ManagedClusterProperties struct { // The profile for Windows VMs in the Managed Cluster. WindowsProfile *ManagedClusterWindowsProfile `json:"windowsProfile,omitempty"` + // Workload Auto-scaler profile for the container service cluster. + WorkloadAutoScalerProfile *ManagedClusterWorkloadAutoScalerProfile `json:"workloadAutoScalerProfile,omitempty"` + // READ-ONLY; The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, // which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, // allowing the Azure Portal to function properly. AzurePortalFQDN *string `json:"azurePortalFQDN,omitempty" azure:"ro"` - // READ-ONLY; If kubernetesVersion was a fully specified version , this field will be exactly equal to it. If kubernetesVersion - // was , this field will contain the full version being used. + // READ-ONLY; The version of Kubernetes the Managed Cluster is running. CurrentKubernetesVersion *string `json:"currentKubernetesVersion,omitempty" azure:"ro"` // READ-ONLY; The FQDN of the master pool. @@ -1212,6 +1321,21 @@ type ManagedClusterPropertiesAutoScalerProfile struct { SkipNodesWithSystemPods *string `json:"skip-nodes-with-system-pods,omitempty"` } +// ManagedClusterPropertiesForSnapshot - managed cluster properties for snapshot, these properties are read only. +type ManagedClusterPropertiesForSnapshot struct { + // Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + EnableRbac *bool `json:"enableRbac,omitempty"` + + // The current kubernetes version. + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + + // The current managed cluster sku. + SKU *ManagedClusterSKU `json:"sku,omitempty"` + + // READ-ONLY; The current network profile. + NetworkProfile *NetworkProfileForSnapshot `json:"networkProfile,omitempty" azure:"ro"` +} + // ManagedClusterSKU - The SKU of a Managed Cluster. type ManagedClusterSKU struct { // The name of a managed cluster SKU. @@ -1223,19 +1347,38 @@ type ManagedClusterSKU struct { // ManagedClusterSecurityProfile - Security profile for the container service cluster. type ManagedClusterSecurityProfile struct { - // Azure Defender settings for the security profile. - AzureDefender *ManagedClusterSecurityProfileAzureDefender `json:"azureDefender,omitempty"` + // Azure Key Vault key management service [https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/] settings for + // the security profile. + AzureKeyVaultKms *AzureKeyVaultKms `json:"azureKeyVaultKms,omitempty"` + + // Microsoft Defender settings for the security profile. + Defender *ManagedClusterSecurityProfileDefender `json:"defender,omitempty"` + + // Workload Identity [https://azure.github.io/azure-workload-identity/docs/] settings for the security profile. + WorkloadIdentity *ManagedClusterSecurityProfileWorkloadIdentity `json:"workloadIdentity,omitempty"` } -// ManagedClusterSecurityProfileAzureDefender - Azure Defender settings for the security profile. -type ManagedClusterSecurityProfileAzureDefender struct { - // Whether to enable Azure Defender +// ManagedClusterSecurityProfileDefender - Microsoft Defender settings for the security profile. +type ManagedClusterSecurityProfileDefender struct { + // Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + // this field is required and must be a valid workspace resource ID. When + // Microsoft Defender is disabled, leave the field empty. + LogAnalyticsWorkspaceResourceID *string `json:"logAnalyticsWorkspaceResourceId,omitempty"` + + // Microsoft Defender threat detection for Cloud settings for the security profile. + SecurityMonitoring *ManagedClusterSecurityProfileDefenderSecurityMonitoring `json:"securityMonitoring,omitempty"` +} + +// ManagedClusterSecurityProfileDefenderSecurityMonitoring - Microsoft Defender settings for the security profile threat detection. +type ManagedClusterSecurityProfileDefenderSecurityMonitoring struct { + // Whether to enable Defender threat detection Enabled *bool `json:"enabled,omitempty"` +} - // Resource ID of the Log Analytics workspace to be associated with Azure Defender. When Azure Defender is enabled, this field - // is required and must be a valid workspace resource ID. When Azure Defender - // is disabled, leave the field empty. - LogAnalyticsWorkspaceResourceID *string `json:"logAnalyticsWorkspaceResourceId,omitempty"` +// ManagedClusterSecurityProfileWorkloadIdentity - Workload Identity settings for the security profile. +type ManagedClusterSecurityProfileWorkloadIdentity struct { + // Whether to enable Workload Identity + Enabled *bool `json:"enabled,omitempty"` } // ManagedClusterServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating @@ -1248,8 +1391,90 @@ type ManagedClusterServicePrincipalProfile struct { Secret *string `json:"secret,omitempty"` } +// ManagedClusterSnapshot - A managed cluster snapshot resource. +type ManagedClusterSnapshot struct { + // REQUIRED; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Properties of a managed cluster snapshot. + Properties *ManagedClusterSnapshotProperties `json:"properties,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedClusterSnapshotListResult - The response from the List Managed Cluster Snapshots operation. +type ManagedClusterSnapshotListResult struct { + // The list of managed cluster snapshots. + Value []*ManagedClusterSnapshot `json:"value,omitempty"` + + // READ-ONLY; The URL to get the next set of managed cluster snapshot results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// ManagedClusterSnapshotProperties - Properties for a managed cluster snapshot. +type ManagedClusterSnapshotProperties struct { + // CreationData to be used to specify the source resource ID to create this snapshot. + CreationData *CreationData `json:"creationData,omitempty"` + + // The type of a snapshot. The default is NodePool. + SnapshotType *SnapshotType `json:"snapshotType,omitempty"` + + // READ-ONLY; What the properties will be showed when getting managed cluster snapshot. Those properties are read-only. + ManagedClusterPropertiesReadOnly *ManagedClusterPropertiesForSnapshot `json:"managedClusterPropertiesReadOnly,omitempty" azure:"ro"` +} + +// ManagedClusterSnapshotsClientCreateOrUpdateOptions contains the optional parameters for the ManagedClusterSnapshotsClient.CreateOrUpdate +// method. +type ManagedClusterSnapshotsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientDeleteOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Delete +// method. +type ManagedClusterSnapshotsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientGetOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Get method. +type ManagedClusterSnapshotsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientListByResourceGroupOptions contains the optional parameters for the ManagedClusterSnapshotsClient.ListByResourceGroup +// method. +type ManagedClusterSnapshotsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientListOptions contains the optional parameters for the ManagedClusterSnapshotsClient.List method. +type ManagedClusterSnapshotsClientListOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientUpdateTagsOptions contains the optional parameters for the ManagedClusterSnapshotsClient.UpdateTags +// method. +type ManagedClusterSnapshotsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + // ManagedClusterStorageProfile - Storage profile for the container service cluster. type ManagedClusterStorageProfile struct { + // AzureBlob CSI Driver settings for the storage profile. + BlobCSIDriver *ManagedClusterStorageProfileBlobCSIDriver `json:"blobCSIDriver,omitempty"` + // AzureDisk CSI Driver settings for the storage profile. DiskCSIDriver *ManagedClusterStorageProfileDiskCSIDriver `json:"diskCSIDriver,omitempty"` @@ -1260,10 +1485,19 @@ type ManagedClusterStorageProfile struct { SnapshotController *ManagedClusterStorageProfileSnapshotController `json:"snapshotController,omitempty"` } +// ManagedClusterStorageProfileBlobCSIDriver - AzureBlob CSI Driver settings for the storage profile. +type ManagedClusterStorageProfileBlobCSIDriver struct { + // Whether to enable AzureBlob CSI Driver. The default value is false. + Enabled *bool `json:"enabled,omitempty"` +} + // ManagedClusterStorageProfileDiskCSIDriver - AzureDisk CSI Driver settings for the storage profile. type ManagedClusterStorageProfileDiskCSIDriver struct { // Whether to enable AzureDisk CSI Driver. The default value is true. Enabled *bool `json:"enabled,omitempty"` + + // The version of AzureDisk CSI Driver. The default value is v1. + Version *string `json:"version,omitempty"` } // ManagedClusterStorageProfileFileCSIDriver - AzureFile CSI Driver settings for the storage profile. @@ -1336,6 +1570,19 @@ type ManagedClusterWindowsProfile struct { LicenseType *LicenseType `json:"licenseType,omitempty"` } +// ManagedClusterWorkloadAutoScalerProfile - Workload Auto-scaler profile for the container service cluster. +type ManagedClusterWorkloadAutoScalerProfile struct { + // KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + Keda *ManagedClusterWorkloadAutoScalerProfileKeda `json:"keda,omitempty"` +} + +// ManagedClusterWorkloadAutoScalerProfileKeda - KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler +// profile. +type ManagedClusterWorkloadAutoScalerProfileKeda struct { + // REQUIRED; Whether to enable KEDA. + Enabled *bool `json:"enabled,omitempty"` +} + // ManagedClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedClustersClient.BeginCreateOrUpdate // method. type ManagedClustersClientBeginCreateOrUpdateOptions struct { @@ -1345,6 +1592,8 @@ type ManagedClustersClientBeginCreateOrUpdateOptions struct { // ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete method. type ManagedClustersClientBeginDeleteOptions struct { + // ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + IgnorePodDisruptionBudget *bool // Resumes the LRO from the provided token. ResumeToken string } @@ -1370,6 +1619,13 @@ type ManagedClustersClientBeginRotateClusterCertificatesOptions struct { ResumeToken string } +// ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions contains the optional parameters for the ManagedClustersClient.BeginRotateServiceAccountSigningKeys +// method. +type ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ManagedClustersClientBeginRunCommandOptions contains the optional parameters for the ManagedClustersClient.BeginRunCommand // method. type ManagedClustersClientBeginRunCommandOptions struct { @@ -1534,6 +1790,9 @@ type NetworkProfile struct { // Network plugin used for building the Kubernetes network. NetworkPlugin *NetworkPlugin `json:"networkPlugin,omitempty"` + // Network plugin mode used for building the Kubernetes network. + NetworkPluginMode *NetworkPluginMode `json:"networkPluginMode,omitempty"` + // Network policy used for building the Kubernetes network. NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"` @@ -1556,6 +1815,24 @@ type NetworkProfile struct { ServiceCidrs []*string `json:"serviceCidrs,omitempty"` } +// NetworkProfileForSnapshot - network profile for managed cluster snapshot, these properties are read only. +type NetworkProfileForSnapshot struct { + // loadBalancerSku for managed cluster snapshot. + LoadBalancerSKU *LoadBalancerSKU `json:"loadBalancerSku,omitempty"` + + // networkMode for managed cluster snapshot. + NetworkMode *NetworkMode `json:"networkMode,omitempty"` + + // networkPlugin for managed cluster snapshot. + NetworkPlugin *NetworkPlugin `json:"networkPlugin,omitempty"` + + // NetworkPluginMode for managed cluster snapshot. + NetworkPluginMode *NetworkPluginMode `json:"networkPluginMode,omitempty"` + + // networkPolicy for managed cluster snapshot. + NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"` +} + // OSOptionProfile - The OS option profile. type OSOptionProfile struct { // REQUIRED; The list of OS options. @@ -1864,7 +2141,9 @@ 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. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 + // if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 + // after Windows2019 is deprecated. OSSKU *OSSKU `json:"osSku,omitempty" azure:"ro"` // READ-ONLY; The operating system type. The default is Linux. @@ -2073,6 +2352,113 @@ type TrackedResource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// TrustedAccessRole - Trusted access role definition. +type TrustedAccessRole struct { + // READ-ONLY; Name of role, name is unique under a source resource type + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; List of rules for the role. This maps to 'rules' property of Kubernetes Cluster Role [https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole]. + Rules []*TrustedAccessRoleRule `json:"rules,omitempty" azure:"ro"` + + // READ-ONLY; Resource type of Azure resource + SourceResourceType *string `json:"sourceResourceType,omitempty" azure:"ro"` +} + +// TrustedAccessRoleBinding - Defines binding between a resource and role +type TrustedAccessRoleBinding struct { + // REQUIRED; Properties for trusted access role binding + Properties *TrustedAccessRoleBindingProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// TrustedAccessRoleBindingListResult - List of trusted access role bindings +type TrustedAccessRoleBindingListResult struct { + // Role binding list + Value []*TrustedAccessRoleBinding `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// TrustedAccessRoleBindingProperties - Properties for trusted access role binding +type TrustedAccessRoleBindingProperties struct { + // REQUIRED; A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. + Roles []*string `json:"roles,omitempty"` + + // REQUIRED; The ARM resource ID of source resource that trusted access is configured for. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + + // READ-ONLY; The current provisioning state of trusted access role binding. + ProvisioningState *TrustedAccessRoleBindingProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// TrustedAccessRoleBindingsClientCreateOrUpdateOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.CreateOrUpdate +// method. +type TrustedAccessRoleBindingsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// TrustedAccessRoleBindingsClientDeleteOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.Delete +// method. +type TrustedAccessRoleBindingsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// TrustedAccessRoleBindingsClientGetOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.Get +// method. +type TrustedAccessRoleBindingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// TrustedAccessRoleBindingsClientListOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.List +// method. +type TrustedAccessRoleBindingsClientListOptions struct { + // placeholder for future optional parameters +} + +// TrustedAccessRoleListResult - List of trusted access roles +type TrustedAccessRoleListResult struct { + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Role list + Value []*TrustedAccessRole `json:"value,omitempty" azure:"ro"` +} + +// TrustedAccessRoleRule - Rule for trusted access role +type TrustedAccessRoleRule struct { + // READ-ONLY; List of allowed apiGroups + APIGroups []*string `json:"apiGroups,omitempty" azure:"ro"` + + // READ-ONLY; List of allowed nonResourceURLs + NonResourceURLs []*string `json:"nonResourceURLs,omitempty" azure:"ro"` + + // READ-ONLY; List of allowed names + ResourceNames []*string `json:"resourceNames,omitempty" azure:"ro"` + + // READ-ONLY; List of allowed resources + Resources []*string `json:"resources,omitempty" azure:"ro"` + + // READ-ONLY; List of allowed verbs + Verbs []*string `json:"verbs,omitempty" azure:"ro"` +} + +// TrustedAccessRolesClientListOptions contains the optional parameters for the TrustedAccessRolesClient.List method. +type TrustedAccessRolesClientListOptions struct { + // placeholder for future optional parameters +} + // UserAssignedIdentity - Details about a user assigned identity. type UserAssignedIdentity struct { // The client ID of the user assigned identity. diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models_serde.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models_serde.go index b7ae31961f81..573021309ba1 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models_serde.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_models_serde.go @@ -162,7 +162,9 @@ func (m ManagedClusterAPIServerAccessProfile) MarshalJSON() ([]byte, error) { populate(objectMap, "disableRunCommand", m.DisableRunCommand) populate(objectMap, "enablePrivateCluster", m.EnablePrivateCluster) populate(objectMap, "enablePrivateClusterPublicFQDN", m.EnablePrivateClusterPublicFQDN) + populate(objectMap, "enableVnetIntegration", m.EnableVnetIntegration) populate(objectMap, "privateDNSZone", m.PrivateDNSZone) + populate(objectMap, "subnetId", m.SubnetID) return json.Marshal(objectMap) } @@ -192,20 +194,24 @@ func (m ManagedClusterAddonProfile) MarshalJSON() ([]byte, error) { func (m ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "availabilityZones", m.AvailabilityZones) + populate(objectMap, "capacityReservationGroupID", m.CapacityReservationGroupID) populate(objectMap, "count", m.Count) populate(objectMap, "creationData", m.CreationData) populate(objectMap, "currentOrchestratorVersion", m.CurrentOrchestratorVersion) populate(objectMap, "enableAutoScaling", m.EnableAutoScaling) + populate(objectMap, "enableCustomCATrust", m.EnableCustomCATrust) populate(objectMap, "enableEncryptionAtHost", m.EnableEncryptionAtHost) populate(objectMap, "enableFIPS", m.EnableFIPS) populate(objectMap, "enableNodePublicIP", m.EnableNodePublicIP) populate(objectMap, "enableUltraSSD", m.EnableUltraSSD) populate(objectMap, "gpuInstanceProfile", m.GpuInstanceProfile) + populate(objectMap, "hostGroupID", m.HostGroupID) populate(objectMap, "kubeletConfig", m.KubeletConfig) populate(objectMap, "kubeletDiskType", m.KubeletDiskType) populate(objectMap, "linuxOSConfig", m.LinuxOSConfig) populate(objectMap, "maxCount", m.MaxCount) populate(objectMap, "maxPods", m.MaxPods) + populate(objectMap, "messageOfTheDay", m.MessageOfTheDay) populate(objectMap, "minCount", m.MinCount) populate(objectMap, "mode", m.Mode) populate(objectMap, "name", m.Name) @@ -239,20 +245,24 @@ func (m ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { func (m ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "availabilityZones", m.AvailabilityZones) + populate(objectMap, "capacityReservationGroupID", m.CapacityReservationGroupID) populate(objectMap, "count", m.Count) populate(objectMap, "creationData", m.CreationData) populate(objectMap, "currentOrchestratorVersion", m.CurrentOrchestratorVersion) populate(objectMap, "enableAutoScaling", m.EnableAutoScaling) + populate(objectMap, "enableCustomCATrust", m.EnableCustomCATrust) populate(objectMap, "enableEncryptionAtHost", m.EnableEncryptionAtHost) populate(objectMap, "enableFIPS", m.EnableFIPS) populate(objectMap, "enableNodePublicIP", m.EnableNodePublicIP) populate(objectMap, "enableUltraSSD", m.EnableUltraSSD) populate(objectMap, "gpuInstanceProfile", m.GpuInstanceProfile) + populate(objectMap, "hostGroupID", m.HostGroupID) populate(objectMap, "kubeletConfig", m.KubeletConfig) populate(objectMap, "kubeletDiskType", m.KubeletDiskType) populate(objectMap, "linuxOSConfig", m.LinuxOSConfig) populate(objectMap, "maxCount", m.MaxCount) populate(objectMap, "maxPods", m.MaxPods) + populate(objectMap, "messageOfTheDay", m.MessageOfTheDay) populate(objectMap, "minCount", m.MinCount) populate(objectMap, "mode", m.Mode) populate(objectMap, "nodeImageVersion", m.NodeImageVersion) @@ -284,6 +294,7 @@ func (m ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) // MarshalJSON implements the json.Marshaller interface for type ManagedClusterHTTPProxyConfig. func (m ManagedClusterHTTPProxyConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "effectiveNoProxy", m.EffectiveNoProxy) populate(objectMap, "httpProxy", m.HTTPProxy) populate(objectMap, "httpsProxy", m.HTTPSProxy) populate(objectMap, "noProxy", m.NoProxy) @@ -376,21 +387,25 @@ func (m ManagedClusterProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "autoScalerProfile", m.AutoScalerProfile) populate(objectMap, "autoUpgradeProfile", m.AutoUpgradeProfile) populate(objectMap, "azurePortalFQDN", m.AzurePortalFQDN) + populate(objectMap, "creationData", m.CreationData) populate(objectMap, "currentKubernetesVersion", m.CurrentKubernetesVersion) populate(objectMap, "dnsPrefix", m.DNSPrefix) populate(objectMap, "disableLocalAccounts", m.DisableLocalAccounts) populate(objectMap, "diskEncryptionSetID", m.DiskEncryptionSetID) + populate(objectMap, "enableNamespaceResources", m.EnableNamespaceResources) populate(objectMap, "enablePodSecurityPolicy", m.EnablePodSecurityPolicy) populate(objectMap, "enableRBAC", m.EnableRBAC) populate(objectMap, "fqdn", m.Fqdn) populate(objectMap, "fqdnSubdomain", m.FqdnSubdomain) populate(objectMap, "httpProxyConfig", m.HTTPProxyConfig) populate(objectMap, "identityProfile", m.IdentityProfile) + populate(objectMap, "ingressProfile", m.IngressProfile) populate(objectMap, "kubernetesVersion", m.KubernetesVersion) populate(objectMap, "linuxProfile", m.LinuxProfile) populate(objectMap, "maxAgentPools", m.MaxAgentPools) populate(objectMap, "networkProfile", m.NetworkProfile) populate(objectMap, "nodeResourceGroup", m.NodeResourceGroup) + populate(objectMap, "oidcIssuerProfile", m.OidcIssuerProfile) populate(objectMap, "podIdentityProfile", m.PodIdentityProfile) populate(objectMap, "powerState", m.PowerState) populate(objectMap, "privateFQDN", m.PrivateFQDN) @@ -401,6 +416,20 @@ func (m ManagedClusterProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "servicePrincipalProfile", m.ServicePrincipalProfile) populate(objectMap, "storageProfile", m.StorageProfile) populate(objectMap, "windowsProfile", m.WindowsProfile) + populate(objectMap, "workloadAutoScalerProfile", m.WorkloadAutoScalerProfile) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterSnapshot. +func (m ManagedClusterSnapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } @@ -415,6 +444,7 @@ func (n NetworkProfile) MarshalJSON() ([]byte, error) { populate(objectMap, "natGatewayProfile", n.NatGatewayProfile) populate(objectMap, "networkMode", n.NetworkMode) populate(objectMap, "networkPlugin", n.NetworkPlugin) + populate(objectMap, "networkPluginMode", n.NetworkPluginMode) populate(objectMap, "networkPolicy", n.NetworkPolicy) populate(objectMap, "outboundType", n.OutboundType) populate(objectMap, "podCidr", n.PodCidr) @@ -561,6 +591,15 @@ func (t TrackedResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type TrustedAccessRoleBindingProperties. +func (t TrustedAccessRoleBindingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provisioningState", t.ProvisioningState) + populate(objectMap, "roles", t.Roles) + populate(objectMap, "sourceResourceId", t.SourceResourceID) + return json.Marshal(objectMap) +} + func populate(m map[string]interface{}, k string, v interface{}) { if v == nil { return diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_operations_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_operations_client.go index f4fadc813216..97c67f9c24d4 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_operations_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_operations_client.go @@ -50,7 +50,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-04-01 +// Generated from API version 2022-05-02-preview // 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]{ @@ -82,7 +82,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privateendpointconnections_client.go index 195e785a02d3..9da12d00dfa1 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privateendpointconnections_client.go @@ -56,7 +56,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -76,7 +76,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-04-01 +// Generated from API version 2022-05-02-preview 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 { @@ -116,7 +116,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,7 +124,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -169,7 +169,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +186,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List @@ -226,7 +226,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -243,7 +243,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -289,7 +289,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") 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/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privatelinkresources_client.go index 9a56af654430..eb50609c9365 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_privatelinkresources_client.go @@ -56,7 +56,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List @@ -96,7 +96,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_resolveprivatelinkserviceid_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_resolveprivatelinkserviceid_client.go index 019f97de5e02..fc5cb1c478d9 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_resolveprivatelinkserviceid_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_resolveprivatelinkserviceid_client.go @@ -56,7 +56,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - Parameters required in order to resolve a private link service ID. @@ -97,7 +97,7 @@ func (client *ResolvePrivateLinkServiceIDClient) postCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") 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/zz_generated_response_types.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_response_types.go index 101ccd178a45..5fd03953b58e 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_response_types.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_response_types.go @@ -63,6 +63,36 @@ type MaintenanceConfigurationsClientListByManagedClusterResponse struct { MaintenanceConfigurationListResult } +// ManagedClusterSnapshotsClientCreateOrUpdateResponse contains the response from method ManagedClusterSnapshotsClient.CreateOrUpdate. +type ManagedClusterSnapshotsClientCreateOrUpdateResponse struct { + ManagedClusterSnapshot +} + +// ManagedClusterSnapshotsClientDeleteResponse contains the response from method ManagedClusterSnapshotsClient.Delete. +type ManagedClusterSnapshotsClientDeleteResponse struct { + // placeholder for future response values +} + +// ManagedClusterSnapshotsClientGetResponse contains the response from method ManagedClusterSnapshotsClient.Get. +type ManagedClusterSnapshotsClientGetResponse struct { + ManagedClusterSnapshot +} + +// ManagedClusterSnapshotsClientListByResourceGroupResponse contains the response from method ManagedClusterSnapshotsClient.ListByResourceGroup. +type ManagedClusterSnapshotsClientListByResourceGroupResponse struct { + ManagedClusterSnapshotListResult +} + +// ManagedClusterSnapshotsClientListResponse contains the response from method ManagedClusterSnapshotsClient.List. +type ManagedClusterSnapshotsClientListResponse struct { + ManagedClusterSnapshotListResult +} + +// ManagedClusterSnapshotsClientUpdateTagsResponse contains the response from method ManagedClusterSnapshotsClient.UpdateTags. +type ManagedClusterSnapshotsClientUpdateTagsResponse struct { + ManagedClusterSnapshot +} + // ManagedClustersClientCreateOrUpdateResponse contains the response from method ManagedClustersClient.CreateOrUpdate. type ManagedClustersClientCreateOrUpdateResponse struct { ManagedCluster @@ -143,6 +173,11 @@ type ManagedClustersClientRotateClusterCertificatesResponse struct { // placeholder for future response values } +// ManagedClustersClientRotateServiceAccountSigningKeysResponse contains the response from method ManagedClustersClient.RotateServiceAccountSigningKeys. +type ManagedClustersClientRotateServiceAccountSigningKeysResponse struct { + // placeholder for future response values +} + // ManagedClustersClientRunCommandResponse contains the response from method ManagedClustersClient.RunCommand. type ManagedClustersClientRunCommandResponse struct { RunCommandResult @@ -227,3 +262,28 @@ type SnapshotsClientListResponse struct { type SnapshotsClientUpdateTagsResponse struct { Snapshot } + +// TrustedAccessRoleBindingsClientCreateOrUpdateResponse contains the response from method TrustedAccessRoleBindingsClient.CreateOrUpdate. +type TrustedAccessRoleBindingsClientCreateOrUpdateResponse struct { + TrustedAccessRoleBinding +} + +// TrustedAccessRoleBindingsClientDeleteResponse contains the response from method TrustedAccessRoleBindingsClient.Delete. +type TrustedAccessRoleBindingsClientDeleteResponse struct { + // placeholder for future response values +} + +// TrustedAccessRoleBindingsClientGetResponse contains the response from method TrustedAccessRoleBindingsClient.Get. +type TrustedAccessRoleBindingsClientGetResponse struct { + TrustedAccessRoleBinding +} + +// TrustedAccessRoleBindingsClientListResponse contains the response from method TrustedAccessRoleBindingsClient.List. +type TrustedAccessRoleBindingsClientListResponse struct { + TrustedAccessRoleBindingListResult +} + +// TrustedAccessRolesClientListResponse contains the response from method TrustedAccessRolesClient.List. +type TrustedAccessRolesClientListResponse struct { + TrustedAccessRoleListResult +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_snapshots_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_snapshots_client.go index 909388280c4d..738a3acd53d7 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_snapshots_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_snapshots_client.go @@ -56,7 +56,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The snapshot to create or update. @@ -97,7 +97,7 @@ func (client *SnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -114,7 +114,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - SnapshotsClientDeleteOptions contains the optional parameters for the SnapshotsClient.Delete method. @@ -153,7 +153,7 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -161,7 +161,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. @@ -200,7 +200,7 @@ func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -217,7 +217,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-04-01 +// Generated from API version 2022-05-02-preview // 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]{ @@ -259,7 +259,7 @@ func (client *SnapshotsClient) listCreateRequest(ctx context.Context, options *S return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.ListByResourceGroup // method. @@ -324,7 +324,7 @@ func (client *SnapshotsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -341,7 +341,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-04-01 +// Generated from API version 2022-05-02-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - Parameters supplied to the Update snapshot Tags operation. @@ -381,7 +381,7 @@ func (client *SnapshotsClient) updateTagsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-02-preview") 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/zz_generated_trustedaccessrolebindings_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_trustedaccessrolebindings_client.go new file mode 100644 index 000000000000..9e3bdcb08a8c --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_trustedaccessrolebindings_client.go @@ -0,0 +1,303 @@ +//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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// TrustedAccessRoleBindingsClient contains the methods for the TrustedAccessRoleBindings group. +// Don't use this type directly, use NewTrustedAccessRoleBindingsClient() instead. +type TrustedAccessRoleBindingsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewTrustedAccessRoleBindingsClient creates a new instance of TrustedAccessRoleBindingsClient with the specified values. +// subscriptionID - The ID of the target subscription. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewTrustedAccessRoleBindingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TrustedAccessRoleBindingsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &TrustedAccessRoleBindingsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or update a trusted access role binding +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// trustedAccessRoleBindingName - The name of trusted access role binding. +// trustedAccessRoleBinding - A trusted access role binding +// options - TrustedAccessRoleBindingsClientCreateOrUpdateOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.CreateOrUpdate +// method. +func (client *TrustedAccessRoleBindingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, trustedAccessRoleBinding TrustedAccessRoleBinding, options *TrustedAccessRoleBindingsClientCreateOrUpdateOptions) (TrustedAccessRoleBindingsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, trustedAccessRoleBindingName, trustedAccessRoleBinding, options) + if err != nil { + return TrustedAccessRoleBindingsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return TrustedAccessRoleBindingsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TrustedAccessRoleBindingsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *TrustedAccessRoleBindingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, trustedAccessRoleBinding TrustedAccessRoleBinding, options *TrustedAccessRoleBindingsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if trustedAccessRoleBindingName == "" { + return nil, errors.New("parameter trustedAccessRoleBindingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{trustedAccessRoleBindingName}", url.PathEscape(trustedAccessRoleBindingName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, trustedAccessRoleBinding) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *TrustedAccessRoleBindingsClient) createOrUpdateHandleResponse(resp *http.Response) (TrustedAccessRoleBindingsClientCreateOrUpdateResponse, error) { + result := TrustedAccessRoleBindingsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleBinding); err != nil { + return TrustedAccessRoleBindingsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete a trusted access role binding. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// trustedAccessRoleBindingName - The name of trusted access role binding. +// options - TrustedAccessRoleBindingsClientDeleteOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.Delete +// method. +func (client *TrustedAccessRoleBindingsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientDeleteOptions) (TrustedAccessRoleBindingsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, trustedAccessRoleBindingName, options) + if err != nil { + return TrustedAccessRoleBindingsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return TrustedAccessRoleBindingsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return TrustedAccessRoleBindingsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return TrustedAccessRoleBindingsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *TrustedAccessRoleBindingsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if trustedAccessRoleBindingName == "" { + return nil, errors.New("parameter trustedAccessRoleBindingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{trustedAccessRoleBindingName}", url.PathEscape(trustedAccessRoleBindingName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a trusted access role binding. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// trustedAccessRoleBindingName - The name of trusted access role binding. +// options - TrustedAccessRoleBindingsClientGetOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.Get +// method. +func (client *TrustedAccessRoleBindingsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientGetOptions) (TrustedAccessRoleBindingsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, trustedAccessRoleBindingName, options) + if err != nil { + return TrustedAccessRoleBindingsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return TrustedAccessRoleBindingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TrustedAccessRoleBindingsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *TrustedAccessRoleBindingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if trustedAccessRoleBindingName == "" { + return nil, errors.New("parameter trustedAccessRoleBindingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{trustedAccessRoleBindingName}", url.PathEscape(trustedAccessRoleBindingName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *TrustedAccessRoleBindingsClient) getHandleResponse(resp *http.Response) (TrustedAccessRoleBindingsClientGetResponse, error) { + result := TrustedAccessRoleBindingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleBinding); err != nil { + return TrustedAccessRoleBindingsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List trusted access role bindings. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// resourceName - The name of the managed cluster resource. +// options - TrustedAccessRoleBindingsClientListOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.List +// method. +func (client *TrustedAccessRoleBindingsClient) NewListPager(resourceGroupName string, resourceName string, options *TrustedAccessRoleBindingsClientListOptions) *runtime.Pager[TrustedAccessRoleBindingsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[TrustedAccessRoleBindingsClientListResponse]{ + More: func(page TrustedAccessRoleBindingsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TrustedAccessRoleBindingsClientListResponse) (TrustedAccessRoleBindingsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return TrustedAccessRoleBindingsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return TrustedAccessRoleBindingsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TrustedAccessRoleBindingsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *TrustedAccessRoleBindingsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *TrustedAccessRoleBindingsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *TrustedAccessRoleBindingsClient) listHandleResponse(resp *http.Response) (TrustedAccessRoleBindingsClientListResponse, error) { + result := TrustedAccessRoleBindingsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleBindingListResult); err != nil { + return TrustedAccessRoleBindingsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_trustedaccessroles_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_trustedaccessroles_client.go new file mode 100644 index 000000000000..9669903c9807 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/zz_generated_trustedaccessroles_client.go @@ -0,0 +1,119 @@ +//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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// TrustedAccessRolesClient contains the methods for the TrustedAccessRoles group. +// Don't use this type directly, use NewTrustedAccessRolesClient() instead. +type TrustedAccessRolesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewTrustedAccessRolesClient creates a new instance of TrustedAccessRolesClient with the specified values. +// subscriptionID - The ID of the target subscription. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewTrustedAccessRolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TrustedAccessRolesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &TrustedAccessRolesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - List supported trusted access roles. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-02-preview +// location - The name of Azure region. +// options - TrustedAccessRolesClientListOptions contains the optional parameters for the TrustedAccessRolesClient.List method. +func (client *TrustedAccessRolesClient) NewListPager(location string, options *TrustedAccessRolesClientListOptions) *runtime.Pager[TrustedAccessRolesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[TrustedAccessRolesClientListResponse]{ + More: func(page TrustedAccessRolesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TrustedAccessRolesClientListResponse) (TrustedAccessRolesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, location, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return TrustedAccessRolesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return TrustedAccessRolesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TrustedAccessRolesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *TrustedAccessRolesClient) listCreateRequest(ctx context.Context, location string, options *TrustedAccessRolesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *TrustedAccessRolesClient) listHandleResponse(resp *http.Response) (TrustedAccessRolesClientListResponse, error) { + result := TrustedAccessRolesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleListResult); err != nil { + return TrustedAccessRolesClientListResponse{}, err + } + return result, nil +}