diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md index 0d163220ec01..d3e0178ec38d 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md +++ b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md @@ -1,193 +1,10 @@ # Release History -## 2.1.0-beta.1 (2022-08-22) +## 2.1.0 (2022-08-25) ### Features Added -- New const `FleetMemberProvisioningStateFailed` -- New const `UpdateModeOff` -- New const `FleetMemberProvisioningStateUpdating` -- New const `OSSKUWindows2022` -- New const `TrustedAccessRoleBindingProvisioningStateUpdating` -- New const `FleetProvisioningStateFailed` -- New const `ControlledValuesRequestsAndLimits` -- New const `FleetMemberProvisioningStateCanceled` -- New const `FleetProvisioningStateDeleting` -- New const `SnapshotTypeManagedCluster` -- New const `TrustedAccessRoleBindingProvisioningStateDeleting` -- New const `ControlledValuesRequestsOnly` - New const `OSSKUWindows2019` -- New const `UpdateModeRecreate` -- New const `PublicNetworkAccessSecuredByPerimeter` -- New const `NetworkPluginModeOverlay` -- New const `FleetProvisioningStateCreating` -- New const `FleetProvisioningStateUpdating` -- New const `UpdateModeAuto` -- New const `FleetMemberProvisioningStateJoining` -- New const `FleetProvisioningStateSucceeded` -- New const `FleetMemberProvisioningStateLeaving` -- New const `FleetProvisioningStateCanceled` -- New const `UpdateModeInitial` -- New const `TrustedAccessRoleBindingProvisioningStateFailed` -- New const `TrustedAccessRoleBindingProvisioningStateSucceeded` -- New const `FleetMemberProvisioningStateSucceeded` -- New type alias `NetworkPluginMode` -- New type alias `FleetProvisioningState` -- New type alias `UpdateMode` -- New type alias `ControlledValues` -- New type alias `TrustedAccessRoleBindingProvisioningState` -- New type alias `FleetMemberProvisioningState` -- New function `NewTrustedAccessRoleBindingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TrustedAccessRoleBindingsClient, error)` -- New function `*ManagedClusterSnapshotsClient.Get(context.Context, string, string, *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error)` -- New function `*ManagedClustersClient.BeginRotateServiceAccountSigningKeys(context.Context, string, string, *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*runtime.Poller[ManagedClustersClientRotateServiceAccountSigningKeysResponse], error)` -- New function `*FleetsClient.NewListPager(*FleetsClientListOptions) *runtime.Pager[FleetsClientListResponse]` -- New function `*ManagedClusterSnapshotsClient.Delete(context.Context, string, string, *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error)` -- New function `*FleetsClient.NewListByResourceGroupPager(string, *FleetsClientListByResourceGroupOptions) *runtime.Pager[FleetsClientListByResourceGroupResponse]` -- New function `*ManagedClusterSnapshotsClient.UpdateTags(context.Context, string, string, TagsObject, *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error)` -- New function `*FleetMembersClient.BeginCreateOrUpdate(context.Context, string, string, string, FleetMember, *FleetMembersClientBeginCreateOrUpdateOptions) (*runtime.Poller[FleetMembersClientCreateOrUpdateResponse], error)` -- New function `*ManagedClusterSnapshotsClient.NewListByResourceGroupPager(string, *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse]` -- New function `*FleetMembersClient.Get(context.Context, string, string, string, *FleetMembersClientGetOptions) (FleetMembersClientGetResponse, error)` -- New function `*FleetMembersClient.NewListByFleetPager(string, string, *FleetMembersClientListByFleetOptions) *runtime.Pager[FleetMembersClientListByFleetResponse]` -- New function `*FleetsClient.BeginDelete(context.Context, string, string, *FleetsClientBeginDeleteOptions) (*runtime.Poller[FleetsClientDeleteResponse], error)` -- New function `PossibleUpdateModeValues() []UpdateMode` -- New function `NewManagedClusterSnapshotsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error)` -- New function `PossibleTrustedAccessRoleBindingProvisioningStateValues() []TrustedAccessRoleBindingProvisioningState` -- New function `*AgentPoolsClient.AbortLatestOperation(context.Context, string, string, string, *AgentPoolsClientAbortLatestOperationOptions) (AgentPoolsClientAbortLatestOperationResponse, error)` -- New function `*TrustedAccessRolesClient.NewListPager(string, *TrustedAccessRolesClientListOptions) *runtime.Pager[TrustedAccessRolesClientListResponse]` -- New function `*FleetsClient.ListCredentials(context.Context, string, string, *FleetsClientListCredentialsOptions) (FleetsClientListCredentialsResponse, error)` -- New function `*FleetMembersClient.BeginDelete(context.Context, string, string, string, *FleetMembersClientBeginDeleteOptions) (*runtime.Poller[FleetMembersClientDeleteResponse], error)` -- New function `*FleetsClient.Update(context.Context, string, string, *FleetsClientUpdateOptions) (FleetsClientUpdateResponse, error)` -- New function `PossibleNetworkPluginModeValues() []NetworkPluginMode` -- New function `*ManagedClusterSnapshotsClient.NewListPager(*ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse]` -- New function `NewTrustedAccessRolesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*TrustedAccessRolesClient, error)` -- New function `*TrustedAccessRoleBindingsClient.NewListPager(string, string, *TrustedAccessRoleBindingsClientListOptions) *runtime.Pager[TrustedAccessRoleBindingsClientListResponse]` -- New function `*TrustedAccessRoleBindingsClient.Delete(context.Context, string, string, string, *TrustedAccessRoleBindingsClientDeleteOptions) (TrustedAccessRoleBindingsClientDeleteResponse, error)` -- New function `*TrustedAccessRoleBindingsClient.CreateOrUpdate(context.Context, string, string, string, TrustedAccessRoleBinding, *TrustedAccessRoleBindingsClientCreateOrUpdateOptions) (TrustedAccessRoleBindingsClientCreateOrUpdateResponse, error)` -- New function `*TrustedAccessRoleBindingsClient.Get(context.Context, string, string, string, *TrustedAccessRoleBindingsClientGetOptions) (TrustedAccessRoleBindingsClientGetResponse, error)` -- New function `PossibleFleetProvisioningStateValues() []FleetProvisioningState` -- New function `NewFleetsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FleetsClient, error)` -- New function `NewFleetMembersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FleetMembersClient, error)` -- New function `*ManagedClusterSnapshotsClient.CreateOrUpdate(context.Context, string, string, ManagedClusterSnapshot, *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error)` -- New function `PossibleFleetMemberProvisioningStateValues() []FleetMemberProvisioningState` -- New function `*ManagedClustersClient.AbortLatestOperation(context.Context, string, string, *ManagedClustersClientAbortLatestOperationOptions) (ManagedClustersClientAbortLatestOperationResponse, error)` -- New function `*FleetsClient.Get(context.Context, string, string, *FleetsClientGetOptions) (FleetsClientGetResponse, error)` -- New function `*FleetsClient.BeginCreateOrUpdate(context.Context, string, string, Fleet, *FleetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FleetsClientCreateOrUpdateResponse], error)` -- New function `PossibleControlledValuesValues() []ControlledValues` -- New struct `AgentPoolsClientAbortLatestOperationOptions` -- New struct `AgentPoolsClientAbortLatestOperationResponse` -- New struct `AzureEntityResource` -- New struct `ErrorAdditionalInfo` -- New struct `ErrorDetail` -- New struct `ErrorResponse` -- New struct `Fleet` -- New struct `FleetCredentialResult` -- New struct `FleetCredentialResults` -- New struct `FleetHubProfile` -- New struct `FleetListResult` -- New struct `FleetMember` -- New struct `FleetMemberProperties` -- New struct `FleetMembersClient` -- New struct `FleetMembersClientBeginCreateOrUpdateOptions` -- New struct `FleetMembersClientBeginDeleteOptions` -- New struct `FleetMembersClientCreateOrUpdateResponse` -- New struct `FleetMembersClientDeleteResponse` -- New struct `FleetMembersClientGetOptions` -- New struct `FleetMembersClientGetResponse` -- New struct `FleetMembersClientListByFleetOptions` -- New struct `FleetMembersClientListByFleetResponse` -- New struct `FleetMembersListResult` -- New struct `FleetPatch` -- New struct `FleetProperties` -- New struct `FleetsClient` -- New struct `FleetsClientBeginCreateOrUpdateOptions` -- New struct `FleetsClientBeginDeleteOptions` -- New struct `FleetsClientCreateOrUpdateResponse` -- New struct `FleetsClientDeleteResponse` -- New struct `FleetsClientGetOptions` -- New struct `FleetsClientGetResponse` -- New struct `FleetsClientListByResourceGroupOptions` -- New struct `FleetsClientListByResourceGroupResponse` -- New struct `FleetsClientListCredentialsOptions` -- New struct `FleetsClientListCredentialsResponse` -- New struct `FleetsClientListOptions` -- New struct `FleetsClientListResponse` -- New struct `FleetsClientUpdateOptions` -- New struct `FleetsClientUpdateResponse` -- New struct `ManagedClusterAzureMonitorProfile` -- New struct `ManagedClusterAzureMonitorProfileKubeStateMetrics` -- New struct `ManagedClusterAzureMonitorProfileMetrics` -- New struct `ManagedClusterIngressProfile` -- New struct `ManagedClusterIngressProfileWebAppRouting` -- New struct `ManagedClusterOIDCIssuerProfile` -- New struct `ManagedClusterPropertiesForSnapshot` -- New struct `ManagedClusterSecurityProfileImageCleaner` -- New struct `ManagedClusterSecurityProfileNodeRestriction` -- New struct `ManagedClusterSecurityProfileWorkloadIdentity` -- New struct `ManagedClusterSnapshot` -- New struct `ManagedClusterSnapshotListResult` -- New struct `ManagedClusterSnapshotProperties` -- New struct `ManagedClusterSnapshotsClient` -- 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 `ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler` -- New struct `ManagedClustersClientAbortLatestOperationOptions` -- New struct `ManagedClustersClientAbortLatestOperationResponse` -- New struct `ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions` -- New struct `ManagedClustersClientRotateServiceAccountSigningKeysResponse` -- New struct `NetworkProfileForSnapshot` -- New struct `TrustedAccessRole` -- New struct `TrustedAccessRoleBinding` -- New struct `TrustedAccessRoleBindingListResult` -- New struct `TrustedAccessRoleBindingProperties` -- New struct `TrustedAccessRoleBindingsClient` -- 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 `TrustedAccessRolesClient` -- New struct `TrustedAccessRolesClientListOptions` -- New struct `TrustedAccessRolesClientListResponse` -- New field `IgnorePodDisruptionBudget` in struct `ManagedClustersClientBeginDeleteOptions` -- New field `EffectiveNoProxy` in struct `ManagedClusterHTTPProxyConfig` -- New field `SubnetID` in struct `ManagedClusterAPIServerAccessProfile` -- New field `EnableVnetIntegration` in struct `ManagedClusterAPIServerAccessProfile` -- New field `EnableCustomCATrust` in struct `ManagedClusterAgentPoolProfile` -- New field `CapacityReservationGroupID` in struct `ManagedClusterAgentPoolProfile` -- New field `MessageOfTheDay` in struct `ManagedClusterAgentPoolProfile` -- New field `BlobCSIDriver` in struct `ManagedClusterStorageProfile` -- New field `CapacityReservationGroupID` in struct `ManagedClusterAgentPoolProfileProperties` -- New field `EnableCustomCATrust` in struct `ManagedClusterAgentPoolProfileProperties` -- New field `MessageOfTheDay` in struct `ManagedClusterAgentPoolProfileProperties` -- New field `IgnorePodDisruptionBudget` in struct `AgentPoolsClientBeginDeleteOptions` -- New field `AzureMonitorProfile` in struct `ManagedClusterProperties` -- New field `OidcIssuerProfile` in struct `ManagedClusterProperties` -- New field `WorkloadAutoScalerProfile` in struct `ManagedClusterProperties` -- New field `EnableNamespaceResources` in struct `ManagedClusterProperties` -- New field `CreationData` in struct `ManagedClusterProperties` -- New field `IngressProfile` in struct `ManagedClusterProperties` -- New field `ImageCleaner` in struct `ManagedClusterSecurityProfile` -- New field `NodeRestriction` in struct `ManagedClusterSecurityProfile` -- New field `WorkloadIdentity` in struct `ManagedClusterSecurityProfile` -- New field `Version` in struct `ManagedClusterStorageProfileDiskCSIDriver` -- New field `NetworkPluginMode` in struct `NetworkProfile` +- New const `OSSKUWindows2022` ## 2.0.0 (2022-07-22) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go index d21f76e39fde..f256e329a4c0 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go @@ -20,7 +20,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" - "strconv" "strings" ) @@ -56,65 +55,9 @@ func NewAgentPoolsClient(subscriptionID string, credential azcore.TokenCredentia return client, nil } -// AbortLatestOperation - Aborting last running operation on agent pool. We return a 204 no content code here to indicate -// that the operation has been accepted and an abort will be attempted but is not guaranteed to complete -// successfully. Please look up the provisioning state of the agent pool to keep track of whether it changes to Canceled. -// A canceled provisioning state indicates that the abort was successful -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-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. -// options - AgentPoolsClientAbortLatestOperationOptions contains the optional parameters for the AgentPoolsClient.AbortLatestOperation -// method. -func (client *AgentPoolsClient) AbortLatestOperation(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientAbortLatestOperationOptions) (AgentPoolsClientAbortLatestOperationResponse, error) { - req, err := client.abortLatestOperationCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) - if err != nil { - return AgentPoolsClientAbortLatestOperationResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AgentPoolsClientAbortLatestOperationResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return AgentPoolsClientAbortLatestOperationResponse{}, runtime.NewResponseError(resp) - } - return AgentPoolsClientAbortLatestOperationResponse{}, nil -} - -// abortLatestOperationCreateRequest creates the AbortLatestOperation request. -func (client *AgentPoolsClient) abortLatestOperationCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientAbortLatestOperationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort" - 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 agentPoolName == "" { - return nil, errors.New("parameter agentPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) - 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-07-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - // 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-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -135,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-07-02-preview +// Generated from API version 2022-07-01 func (client *AgentPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool, options *AgentPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, parameters, options) if err != nil { @@ -175,7 +118,7 @@ func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -183,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-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -202,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-07-02-preview +// Generated from API version 2022-07-01 func (client *AgentPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { @@ -242,10 +185,7 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") - if options != nil && options.IgnorePodDisruptionBudget != nil { - reqQP.Set("ignore-pod-disruption-budget", strconv.FormatBool(*options.IgnorePodDisruptionBudget)) - } + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +193,7 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the specified managed cluster agent pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -297,7 +237,7 @@ func (client *AgentPoolsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -315,7 +255,7 @@ func (client *AgentPoolsClient) getHandleResponse(resp *http.Response) (AgentPoo // GetAvailableAgentPoolVersions - See supported Kubernetes versions [https://docs.microsoft.com/azure/aks/supported-kubernetes-versions] // for more details about the version lifecycle. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - AgentPoolsClientGetAvailableAgentPoolVersionsOptions contains the optional parameters for the AgentPoolsClient.GetAvailableAgentPoolVersions @@ -355,7 +295,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -372,7 +312,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsHandleResponse(resp // GetUpgradeProfile - Gets the upgrade profile for an agent pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -417,7 +357,7 @@ func (client *AgentPoolsClient) getUpgradeProfileCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -434,7 +374,7 @@ func (client *AgentPoolsClient) getUpgradeProfileHandleResponse(resp *http.Respo // NewListPager - Gets a list of agent pools in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - AgentPoolsClientListOptions contains the optional parameters for the AgentPoolsClient.List method. @@ -486,7 +426,7 @@ func (client *AgentPoolsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -505,7 +445,7 @@ func (client *AgentPoolsClient) listHandleResponse(resp *http.Response) (AgentPo // to the nodes. AKS provides one new image per week with the latest updates. For more details on node image // versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // agentPoolName - The name of the agent pool. @@ -527,7 +467,7 @@ func (client *AgentPoolsClient) BeginUpgradeNodeImageVersion(ctx context.Context // the nodes. AKS provides one new image per week with the latest updates. For more details on node image // versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 func (client *AgentPoolsClient) upgradeNodeImageVersion(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginUpgradeNodeImageVersionOptions) (*http.Response, error) { req, err := client.upgradeNodeImageVersionCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) if err != nil { @@ -567,7 +507,7 @@ func (client *AgentPoolsClient) upgradeNodeImageVersionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go index 6fdaa649473c..038fe4981077 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go @@ -17,24 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsAbortOperation.json -func ExampleAgentPoolsClient_AbortLatestOperation() { - 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) - } - _, err = client.AbortLatestOperation(ctx, "rg1", "clustername1", "agentpool1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsList.json func ExampleAgentPoolsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -58,7 +41,7 @@ func ExampleAgentPoolsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsGet.json func ExampleAgentPoolsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -77,38 +60,7 @@ func ExampleAgentPoolsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsAssociate_CRG.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_associateAgentPoolWithCapacityReservationGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - 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{ - CapacityReservationGroupID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/CapacityReservationGroups/crg1"), - Count: to.Ptr[int32](3), - OrchestratorVersion: to.Ptr(""), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/preview/2022-07-02-preview/examples/AgentPoolsCreate_Snapshot.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_Snapshot.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolUsingAnAgentPoolSnapshot() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -142,38 +94,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolUsingAnAgentPool _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_EnableCustomCATrust.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithCustomCaTrustEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - 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), - EnableCustomCATrust: to.Ptr(true), - OrchestratorVersion: to.Ptr(""), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/preview/2022-07-02-preview/examples/AgentPoolsCreate_DedicatedHostGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_DedicatedHostGroup.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithDedicatedHostGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -204,7 +125,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithDedicatedHos _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_EnableEncryptionAtHost.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEncryptionAtHostEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -235,7 +156,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEncryptionAt _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_Ephemeral.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_Ephemeral.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEphemeralOsDisk() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -267,7 +188,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEphemeralOsD _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_EnableFIPS.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_EnableFIPS.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithFipsEnabledOs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -298,7 +219,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithFipsEnabledO _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_GPUMIG.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_GPUMIG.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithGpumig() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -352,7 +273,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithGpumig() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_WasmWasi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_WasmWasi.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKrustletAndTheWasiRuntime() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -385,7 +306,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKrustletAndT _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_CustomNodeConfig.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_CustomNodeConfig.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKubeletConfigAndLinuxOsConfig() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -438,40 +359,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKubeletConfi _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_MessageOfTheDay.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithMessageOfTheDay() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - 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), - MessageOfTheDay: to.Ptr("Zm9vCg=="), - Mode: to.Ptr(armcontainerservice.AgentPoolModeUser), - OrchestratorVersion: to.Ptr(""), - OSDiskSizeGB: to.Ptr[int32](64), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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/preview/2022-07-02-preview/examples/AgentPoolsCreate_OSSKU.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_OSSKU.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithOssku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -525,7 +413,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithOssku() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_PPG.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_PPG.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithPpg() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -556,7 +444,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithPpg() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_EnableUltraSSD.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_EnableUltraSSD.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithUltraSsdEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -587,7 +475,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithUltraSsdEnab _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_WindowsOSSKU.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_WindowsOSSKU.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithWindowsOssku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -618,7 +506,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithWindowsOssku _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_Spot.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_Spot.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createSpotAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -658,7 +546,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createSpotAgentPool() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsCreate_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsCreate_Update.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createUpdateAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -699,7 +587,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createUpdateAgentPool() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPools_Start.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPools_Start.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_startAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -728,7 +616,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_startAgentPool() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPools_Stop.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPools_Stop.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_stopAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -757,7 +645,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_stopAgentPool() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPools_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPools_Update.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_updateAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -794,29 +682,8 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_updateAgentPool() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsDelete.json -func ExampleAgentPoolsClient_BeginDelete_deleteAgentPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - 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", &armcontainerservice.AgentPoolsClientBeginDeleteOptions{IgnorePodDisruptionBudget: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsDelete_IgnorePodDisruptionBudget.json -func ExampleAgentPoolsClient_BeginDelete_deleteAgentPoolByIgnoringPodDisruptionBudget() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsDelete.json +func ExampleAgentPoolsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -826,7 +693,7 @@ func ExampleAgentPoolsClient_BeginDelete_deleteAgentPoolByIgnoringPodDisruptionB if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "rg1", "clustername1", "agentpool1", &armcontainerservice.AgentPoolsClientBeginDeleteOptions{IgnorePodDisruptionBudget: nil}) + poller, err := client.BeginDelete(ctx, "rg1", "clustername1", "agentpool1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -836,7 +703,7 @@ func ExampleAgentPoolsClient_BeginDelete_deleteAgentPoolByIgnoringPodDisruptionB } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsGetUpgradeProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsGetUpgradeProfile.json func ExampleAgentPoolsClient_GetUpgradeProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -855,7 +722,7 @@ func ExampleAgentPoolsClient_GetUpgradeProfile() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json func ExampleAgentPoolsClient_GetAvailableAgentPoolVersions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -874,7 +741,7 @@ func ExampleAgentPoolsClient_GetAvailableAgentPoolVersions() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/AgentPoolsUpgradeNodeImageVersion.json func ExampleAgentPoolsClient_BeginUpgradeNodeImageVersion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md b/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md index 104f0be68c34..ffc254593a2d 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/261132757bc9806f4aa90bd5b176ecfa6a447726/specification/containerservice/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/261132757bc9806f4aa90bd5b176ecfa6a447726/specification/containerservice/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/df66d048c82fd136d5a15dea61c3c35bf6da9d43/specification/containerservice/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/df66d048c82fd136d5a15dea61c3c35bf6da9d43/specification/containerservice/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.1.0-beta.1 +module-version: 2.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/constants.go b/sdk/resourcemanager/containerservice/armcontainerservice/constants.go index ddaec6bda018..cca02a243cae 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/constants.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/constants.go @@ -11,7 +11,7 @@ package armcontainerservice const ( moduleName = "armcontainerservice" - moduleVersion = "v2.1.0-beta.1" + moduleVersion = "v2.1.0" ) // AgentPoolMode - A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent @@ -467,24 +467,6 @@ func PossibleContainerServiceVMSizeTypesValues() []ContainerServiceVMSizeTypes { } } -// ControlledValues - Controls which resource value autoscaler will change. Default value is RequestsAndLimits. -type ControlledValues string - -const ( - // ControlledValuesRequestsAndLimits - Autoscaler will control resource requests and limits. - ControlledValuesRequestsAndLimits ControlledValues = "RequestsAndLimits" - // ControlledValuesRequestsOnly - Autoscaler will control resource requests only. - ControlledValuesRequestsOnly ControlledValues = "RequestsOnly" -) - -// PossibleControlledValuesValues returns the possible values for the ControlledValues const type. -func PossibleControlledValuesValues() []ControlledValues { - return []ControlledValues{ - ControlledValuesRequestsAndLimits, - ControlledValuesRequestsOnly, - } -} - // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is // 1. type Count int32 @@ -568,54 +550,6 @@ func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { } } -// FleetMemberProvisioningState - The provisioning state of the last accepted operation. -type FleetMemberProvisioningState string - -const ( - FleetMemberProvisioningStateCanceled FleetMemberProvisioningState = "Canceled" - FleetMemberProvisioningStateFailed FleetMemberProvisioningState = "Failed" - FleetMemberProvisioningStateJoining FleetMemberProvisioningState = "Joining" - FleetMemberProvisioningStateLeaving FleetMemberProvisioningState = "Leaving" - FleetMemberProvisioningStateSucceeded FleetMemberProvisioningState = "Succeeded" - FleetMemberProvisioningStateUpdating FleetMemberProvisioningState = "Updating" -) - -// PossibleFleetMemberProvisioningStateValues returns the possible values for the FleetMemberProvisioningState const type. -func PossibleFleetMemberProvisioningStateValues() []FleetMemberProvisioningState { - return []FleetMemberProvisioningState{ - FleetMemberProvisioningStateCanceled, - FleetMemberProvisioningStateFailed, - FleetMemberProvisioningStateJoining, - FleetMemberProvisioningStateLeaving, - FleetMemberProvisioningStateSucceeded, - FleetMemberProvisioningStateUpdating, - } -} - -// FleetProvisioningState - The provisioning state of the last accepted operation. -type FleetProvisioningState string - -const ( - FleetProvisioningStateCanceled FleetProvisioningState = "Canceled" - FleetProvisioningStateCreating FleetProvisioningState = "Creating" - FleetProvisioningStateDeleting FleetProvisioningState = "Deleting" - FleetProvisioningStateFailed FleetProvisioningState = "Failed" - FleetProvisioningStateSucceeded FleetProvisioningState = "Succeeded" - FleetProvisioningStateUpdating FleetProvisioningState = "Updating" -) - -// PossibleFleetProvisioningStateValues returns the possible values for the FleetProvisioningState const type. -func PossibleFleetProvisioningStateValues() []FleetProvisioningState { - return []FleetProvisioningState{ - FleetProvisioningStateCanceled, - FleetProvisioningStateCreating, - FleetProvisioningStateDeleting, - FleetProvisioningStateFailed, - FleetProvisioningStateSucceeded, - FleetProvisioningStateUpdating, - } -} - type Format string const ( @@ -830,8 +764,8 @@ const ( // NetworkPluginKubenet - Use the Kubenet network plugin. See [Kubenet (basic) networking](https://docs.microsoft.com/azure/aks/concepts-network#kubenet-basic-networking) // for more information. NetworkPluginKubenet NetworkPlugin = "kubenet" - // NetworkPluginNone - Do not use a network plugin. A custom CNI will need to be installed after cluster creation for networking - // functionality. + // NetworkPluginNone - No CNI plugin is pre-installed. See [BYO CNI](https://docs.microsoft.com/en-us/azure/aks/use-byo-cni) + // for more information. NetworkPluginNone NetworkPlugin = "none" ) @@ -844,22 +778,6 @@ func PossibleNetworkPluginValues() []NetworkPlugin { } } -// 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, - } -} - // NetworkPolicy - Network policy used for building the Kubernetes network. type NetworkPolicy string @@ -904,9 +822,8 @@ func PossibleOSDiskTypeValues() []OSDiskType { } } -// OSSKU - Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 -// if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 -// after Windows2019 is deprecated. +// OSSKU - Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 +// when Kubernetes = 1.25 if OSType is Windows. type OSSKU string const ( @@ -996,12 +913,8 @@ func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpoin type PublicNetworkAccess string const ( - // PublicNetworkAccessDisabled - Inbound traffic to managedCluster is disabled, traffic from managedCluster is allowed. PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - // PublicNetworkAccessEnabled - Inbound/Outbound to the managedCluster is allowed. - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" - // PublicNetworkAccessSecuredByPerimeter - Inbound/Outbound traffic is managed by Microsoft.Network/NetworkSecurityPerimeters. - PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" ) // PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. @@ -1009,7 +922,6 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { return []PublicNetworkAccess{ PublicNetworkAccessDisabled, PublicNetworkAccessEnabled, - PublicNetworkAccessSecuredByPerimeter, } } @@ -1102,8 +1014,6 @@ 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" ) @@ -1111,60 +1021,10 @@ 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, - } -} - -// UpdateMode - Each update mode level is a superset of the lower levels. Off 0 - }, - Fetcher: func(ctx context.Context, page *FleetMembersClientListByFleetResponse) (FleetMembersClientListByFleetResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByFleetCreateRequest(ctx, resourceGroupName, fleetName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return FleetMembersClientListByFleetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FleetMembersClientListByFleetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FleetMembersClientListByFleetResponse{}, runtime.NewResponseError(resp) - } - return client.listByFleetHandleResponse(resp) - }, - }) -} - -// listByFleetCreateRequest creates the ListByFleet request. -func (client *FleetMembersClient) listByFleetCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, options *FleetMembersClientListByFleetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members" - 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 fleetName == "" { - return nil, errors.New("parameter fleetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) - 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-07-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByFleetHandleResponse handles the ListByFleet response. -func (client *FleetMembersClient) listByFleetHandleResponse(resp *http.Response) (FleetMembersClientListByFleetResponse, error) { - result := FleetMembersClientListByFleetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FleetMembersListResult); err != nil { - return FleetMembersClientListByFleetResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fleetmembers_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/fleetmembers_client_example_test.go deleted file mode 100644 index 73a95ac26998..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fleetmembers_client_example_test.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/FleetMembers_Create.json -func ExampleFleetMembersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewFleetMembersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "rg1", "fleet-1", "member-1", armcontainerservice.FleetMember{ - Properties: &armcontainerservice.FleetMemberProperties{ - ClusterResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster-1"), - }, - }, &armcontainerservice.FleetMembersClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: 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/preview/2022-07-02-preview/examples/FleetMembers_Get.json -func ExampleFleetMembersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewFleetMembersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "rg1", "fleet-1", "member-1", 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/preview/2022-07-02-preview/examples/FleetMembers_Delete.json -func ExampleFleetMembersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewFleetMembersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "rg1", "fleet-1", "member-1", &armcontainerservice.FleetMembersClientBeginDeleteOptions{IfMatch: 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/preview/2022-07-02-preview/examples/FleetMembers_List.json -func ExampleFleetMembersClient_NewListByFleetPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewFleetMembersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByFleetPager("rg1", "fleet-1", 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/fleets_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/fleets_client.go deleted file mode 100644 index b7eada87075f..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fleets_client.go +++ /dev/null @@ -1,491 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcontainerservice - -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" -) - -// FleetsClient contains the methods for the Fleets group. -// Don't use this type directly, use NewFleetsClient() instead. -type FleetsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewFleetsClient creates a new instance of FleetsClient 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 NewFleetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FleetsClient, 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 := &FleetsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a Fleet. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// fleetName - The name of the Fleet resource. -// parameters - The Fleet to create or update. -// options - FleetsClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetsClient.BeginCreateOrUpdate -// method. -func (client *FleetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, parameters Fleet, options *FleetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FleetsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, fleetName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[FleetsClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[FleetsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates or updates a Fleet. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview -func (client *FleetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, parameters Fleet, options *FleetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, fleetName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *FleetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, parameters Fleet, options *FleetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}" - 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 fleetName == "" { - return nil, errors.New("parameter fleetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) - 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-07-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - if options != nil && options.IfNoneMatch != nil { - req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} - } - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// BeginDelete - Deletes a Fleet. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// fleetName - The name of the Fleet resource. -// options - FleetsClientBeginDeleteOptions contains the optional parameters for the FleetsClient.BeginDelete method. -func (client *FleetsClient) BeginDelete(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientBeginDeleteOptions) (*runtime.Poller[FleetsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, fleetName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[FleetsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[FleetsClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes a Fleet. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview -func (client *FleetsClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, fleetName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *FleetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}" - 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 fleetName == "" { - return nil, errors.New("parameter fleetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) - 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-07-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a Fleet. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// fleetName - The name of the Fleet resource. -// options - FleetsClientGetOptions contains the optional parameters for the FleetsClient.Get method. -func (client *FleetsClient) Get(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientGetOptions) (FleetsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, fleetName, options) - if err != nil { - return FleetsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FleetsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FleetsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *FleetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}" - 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 fleetName == "" { - return nil, errors.New("parameter fleetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) - 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-07-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 *FleetsClient) getHandleResponse(resp *http.Response) (FleetsClientGetResponse, error) { - result := FleetsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Fleet); err != nil { - return FleetsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists fleets in the specified subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview -// options - FleetsClientListOptions contains the optional parameters for the FleetsClient.List method. -func (client *FleetsClient) NewListPager(options *FleetsClientListOptions) *runtime.Pager[FleetsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[FleetsClientListResponse]{ - More: func(page FleetsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *FleetsClientListResponse) (FleetsClientListResponse, 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 FleetsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FleetsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FleetsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *FleetsClient) listCreateRequest(ctx context.Context, options *FleetsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets" - 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-07-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 *FleetsClient) listHandleResponse(resp *http.Response) (FleetsClientListResponse, error) { - result := FleetsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FleetListResult); err != nil { - return FleetsClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists fleets in the specified subscription and resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// options - FleetsClientListByResourceGroupOptions contains the optional parameters for the FleetsClient.ListByResourceGroup -// method. -func (client *FleetsClient) NewListByResourceGroupPager(resourceGroupName string, options *FleetsClientListByResourceGroupOptions) *runtime.Pager[FleetsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[FleetsClientListByResourceGroupResponse]{ - More: func(page FleetsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *FleetsClientListByResourceGroupResponse) (FleetsClientListByResourceGroupResponse, 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 FleetsClientListByResourceGroupResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FleetsClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FleetsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) - }, - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *FleetsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *FleetsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets" - 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-07-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 *FleetsClient) listByResourceGroupHandleResponse(resp *http.Response) (FleetsClientListByResourceGroupResponse, error) { - result := FleetsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FleetListResult); err != nil { - return FleetsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// ListCredentials - Lists the user credentials of a Fleet. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// fleetName - The name of the Fleet resource. -// options - FleetsClientListCredentialsOptions contains the optional parameters for the FleetsClient.ListCredentials method. -func (client *FleetsClient) ListCredentials(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientListCredentialsOptions) (FleetsClientListCredentialsResponse, error) { - req, err := client.listCredentialsCreateRequest(ctx, resourceGroupName, fleetName, options) - if err != nil { - return FleetsClientListCredentialsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FleetsClientListCredentialsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FleetsClientListCredentialsResponse{}, runtime.NewResponseError(resp) - } - return client.listCredentialsHandleResponse(resp) -} - -// listCredentialsCreateRequest creates the ListCredentials request. -func (client *FleetsClient) listCredentialsCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientListCredentialsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials" - 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 fleetName == "" { - return nil, errors.New("parameter fleetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) - 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-07-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listCredentialsHandleResponse handles the ListCredentials response. -func (client *FleetsClient) listCredentialsHandleResponse(resp *http.Response) (FleetsClientListCredentialsResponse, error) { - result := FleetsClientListCredentialsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.FleetCredentialResults); err != nil { - return FleetsClientListCredentialsResponse{}, err - } - return result, nil -} - -// Update - Patches a fleet resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// fleetName - The name of the Fleet resource. -// options - FleetsClientUpdateOptions contains the optional parameters for the FleetsClient.Update method. -func (client *FleetsClient) Update(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientUpdateOptions) (FleetsClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, fleetName, options) - if err != nil { - return FleetsClientUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return FleetsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FleetsClientUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.updateHandleResponse(resp) -} - -// updateCreateRequest creates the Update request. -func (client *FleetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}" - 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 fleetName == "" { - return nil, errors.New("parameter fleetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) - 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-07-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *FleetsClient) updateHandleResponse(resp *http.Response) (FleetsClientUpdateResponse, error) { - result := FleetsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Fleet); err != nil { - return FleetsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fleets_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/fleets_client_example_test.go deleted file mode 100644 index 868897335706..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fleets_client_example_test.go +++ /dev/null @@ -1,187 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/Fleets_CreateOrUpdate.json -func ExampleFleetsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewFleetsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "rg1", "fleet-1", armcontainerservice.Fleet{ - Location: to.Ptr("East US"), - Tags: map[string]*string{ - "archv2": to.Ptr(""), - "tier": to.Ptr("production"), - }, - Properties: &armcontainerservice.FleetProperties{ - HubProfile: &armcontainerservice.FleetHubProfile{ - DNSPrefix: to.Ptr("dnsprefix1"), - }, - }, - }, &armcontainerservice.FleetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: 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/preview/2022-07-02-preview/examples/Fleets_PatchTags.json -func ExampleFleetsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewFleetsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "rg1", "fleet-1", &armcontainerservice.FleetsClientUpdateOptions{IfMatch: to.Ptr("dfjkwelr7384"), - Parameters: &armcontainerservice.FleetPatch{ - Tags: map[string]*string{ - "env": to.Ptr("prod"), - "tier": to.Ptr("secure"), - }, - }, - }) - 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/preview/2022-07-02-preview/examples/Fleets_Get.json -func ExampleFleetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewFleetsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "rg1", "fleet-1", 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/preview/2022-07-02-preview/examples/Fleets_Delete.json -func ExampleFleetsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewFleetsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "rg1", "fleet-1", &armcontainerservice.FleetsClientBeginDeleteOptions{IfMatch: 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/preview/2022-07-02-preview/examples/Fleets_ListByResourceGroup.json -func ExampleFleetsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewFleetsClient("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/preview/2022-07-02-preview/examples/Fleets_ListBySub.json -func ExampleFleetsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewFleetsClient("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/preview/2022-07-02-preview/examples/Fleets_ListCredentialsResult.json -func ExampleFleetsClient_ListCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewFleetsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListCredentials(ctx, "rg1", "fleet", 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/maintenanceconfigurations_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go index 27f6fbf9c8bd..353cc3226ec7 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go @@ -57,7 +57,7 @@ func NewMaintenanceConfigurationsClient(subscriptionID string, credential azcore // CreateOrUpdate - Creates or updates a maintenance configuration in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // configName - The name of the maintenance configuration. @@ -103,7 +103,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +120,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateHandleResponse(resp // Delete - Deletes a maintenance configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // configName - The name of the maintenance configuration. @@ -165,7 +165,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +173,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C // Get - Gets the specified maintenance configuration of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // configName - The name of the maintenance configuration. @@ -218,7 +218,7 @@ func (client *MaintenanceConfigurationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,7 +235,7 @@ func (client *MaintenanceConfigurationsClient) getHandleResponse(resp *http.Resp // NewListByManagedClusterPager - Gets a list of maintenance configurations in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - MaintenanceConfigurationsClientListByManagedClusterOptions contains the optional parameters for the MaintenanceConfigurationsClient.ListByManagedCluster @@ -288,7 +288,7 @@ func (client *MaintenanceConfigurationsClient) listByManagedClusterCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go index addbaa7decb0..3b39d00f3622 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go @@ -19,7 +19,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/MaintenanceConfigurationsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/MaintenanceConfigurationsList.json func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/MaintenanceConfigurationsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/MaintenanceConfigurationsGet.json func ExampleMaintenanceConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,7 +62,7 @@ func ExampleMaintenanceConfigurationsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/MaintenanceConfigurationsCreate_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/MaintenanceConfigurationsCreate_Update.json func ExampleMaintenanceConfigurationsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -96,7 +96,7 @@ func ExampleMaintenanceConfigurationsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/MaintenanceConfigurationsDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/MaintenanceConfigurationsDelete.json func ExampleMaintenanceConfigurationsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go index 62f4a24c509d..754117a7ca6d 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go @@ -20,7 +20,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" - "strconv" "strings" ) @@ -56,61 +55,9 @@ func NewManagedClustersClient(subscriptionID string, credential azcore.TokenCred return client, nil } -// AbortLatestOperation - Aborting last running operation on managed cluster. We return a 204 no content code here to indicate -// that the operation has been accepted and an abort will be attempted but is not guaranteed to -// complete successfully. Please look up the provisioning state of the managed cluster to keep track of whether it changes -// to Canceled. A canceled provisioning state indicates that the abort was -// successful -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// resourceName - The name of the managed cluster resource. -// options - ManagedClustersClientAbortLatestOperationOptions contains the optional parameters for the ManagedClustersClient.AbortLatestOperation -// method. -func (client *ManagedClustersClient) AbortLatestOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientAbortLatestOperationOptions) (ManagedClustersClientAbortLatestOperationResponse, error) { - req, err := client.abortLatestOperationCreateRequest(ctx, resourceGroupName, resourceName, options) - if err != nil { - return ManagedClustersClientAbortLatestOperationResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ManagedClustersClientAbortLatestOperationResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return ManagedClustersClientAbortLatestOperationResponse{}, runtime.NewResponseError(resp) - } - return ManagedClustersClientAbortLatestOperationResponse{}, nil -} - -// abortLatestOperationCreateRequest creates the AbortLatestOperation request. -func (client *ManagedClustersClient) abortLatestOperationCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientAbortLatestOperationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort" - 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-07-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - // BeginCreateOrUpdate - Creates or updates a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The managed cluster to create or update. @@ -130,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-07-02-preview +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster, options *ManagedClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -166,7 +113,7 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -174,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-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete @@ -193,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-07-02-preview +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -229,10 +176,7 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") - if options != nil && options.IgnorePodDisruptionBudget != nil { - reqQP.Set("ignore-pod-disruption-budget", strconv.FormatBool(*options.IgnorePodDisruptionBudget)) - } + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,7 +184,7 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re // Get - Gets a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientGetOptions contains the optional parameters for the ManagedClustersClient.Get method. @@ -279,7 +223,7 @@ func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,7 +242,7 @@ func (client *ManagedClustersClient) getHandleResponse(resp *http.Response) (Man // or ListClusterAdminCredentials // [https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials] . // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // roleName - The name of the role for managed cluster accessProfile resource. @@ -343,7 +287,7 @@ func (client *ManagedClustersClient) getAccessProfileCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -360,7 +304,7 @@ func (client *ManagedClustersClient) getAccessProfileHandleResponse(resp *http.R // GetCommandResult - Gets the results of a command which has been run on the Managed Cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // commandID - Id of the command. @@ -405,7 +349,7 @@ func (client *ManagedClustersClient) getCommandResultCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -422,7 +366,7 @@ func (client *ManagedClustersClient) getCommandResultHandleResponse(resp *http.R // GetOSOptions - Gets supported OS options in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // location - The name of Azure region. // options - ManagedClustersClientGetOSOptionsOptions contains the optional parameters for the ManagedClustersClient.GetOSOptions // method. @@ -457,7 +401,7 @@ func (client *ManagedClustersClient) getOSOptionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.ResourceType != nil { reqQP.Set("resource-type", *options.ResourceType) } @@ -477,7 +421,7 @@ func (client *ManagedClustersClient) getOSOptionsHandleResponse(resp *http.Respo // GetUpgradeProfile - Gets the upgrade profile of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientGetUpgradeProfileOptions contains the optional parameters for the ManagedClustersClient.GetUpgradeProfile @@ -517,7 +461,7 @@ func (client *ManagedClustersClient) getUpgradeProfileCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -534,7 +478,7 @@ func (client *ManagedClustersClient) getUpgradeProfileHandleResponse(resp *http. // NewListPager - Gets a list of managed clusters in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // options - ManagedClustersClientListOptions contains the optional parameters for the ManagedClustersClient.List method. func (client *ManagedClustersClient) NewListPager(options *ManagedClustersClientListOptions) *runtime.Pager[ManagedClustersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedClustersClientListResponse]{ @@ -576,7 +520,7 @@ func (client *ManagedClustersClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -593,7 +537,7 @@ func (client *ManagedClustersClient) listHandleResponse(resp *http.Response) (Ma // NewListByResourceGroupPager - Lists managed clusters in the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - ManagedClustersClientListByResourceGroupOptions contains the optional parameters for the ManagedClustersClient.ListByResourceGroup // method. @@ -641,7 +585,7 @@ func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -658,7 +602,7 @@ func (client *ManagedClustersClient) listByResourceGroupHandleResponse(resp *htt // ListClusterAdminCredentials - Lists the admin credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListClusterAdminCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterAdminCredentials @@ -698,7 +642,7 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -718,7 +662,7 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsHandleResponse(r // ListClusterMonitoringUserCredentials - Lists the cluster monitoring user credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListClusterMonitoringUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterMonitoringUserCredentials @@ -758,7 +702,7 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -778,7 +722,7 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsHandleR // ListClusterUserCredentials - Lists the user credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListClusterUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterUserCredentials @@ -818,7 +762,7 @@ func (client *ManagedClustersClient) listClusterUserCredentialsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -842,7 +786,7 @@ func (client *ManagedClustersClient) listClusterUserCredentialsHandleResponse(re // NewListOutboundNetworkDependenciesEndpointsPager - Gets a list of egress endpoints (network endpoints of all outbound dependencies) // in the specified managed cluster. The operation returns properties of each egress endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the @@ -895,7 +839,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -912,7 +856,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsHan // BeginResetAADProfile - Reset the AAD Profile of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The AAD profile to set on the Managed Cluster @@ -932,7 +876,7 @@ func (client *ManagedClustersClient) BeginResetAADProfile(ctx context.Context, r // ResetAADProfile - Reset the AAD Profile of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) resetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile, options *ManagedClustersClientBeginResetAADProfileOptions) (*http.Response, error) { req, err := client.resetAADProfileCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -968,7 +912,7 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -976,7 +920,7 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co // BeginResetServicePrincipalProfile - This action cannot be performed on a cluster that is not using a service principal // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - The service principal profile to set on the managed cluster. @@ -996,7 +940,7 @@ func (client *ManagedClustersClient) BeginResetServicePrincipalProfile(ctx conte // ResetServicePrincipalProfile - This action cannot be performed on a cluster that is not using a service principal // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) resetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile, options *ManagedClustersClientBeginResetServicePrincipalProfileOptions) (*http.Response, error) { req, err := client.resetServicePrincipalProfileCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -1032,7 +976,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -1041,7 +985,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c // BeginRotateClusterCertificates - See Certificate rotation [https://docs.microsoft.com/azure/aks/certificate-rotation] for // more details about rotating managed cluster certificates. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginRotateClusterCertificatesOptions contains the optional parameters for the ManagedClustersClient.BeginRotateClusterCertificates @@ -1061,7 +1005,7 @@ func (client *ManagedClustersClient) BeginRotateClusterCertificates(ctx context. // RotateClusterCertificates - See Certificate rotation [https://docs.microsoft.com/azure/aks/certificate-rotation] for more // details about rotating managed cluster certificates. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) rotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateClusterCertificatesOptions) (*http.Response, error) { req, err := client.rotateClusterCertificatesCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -1097,70 +1041,7 @@ func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-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-07-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-07-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-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1170,7 +1051,7 @@ func (client *ManagedClustersClient) rotateServiceAccountSigningKeysCreateReques // 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-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // requestPayload - The run command request @@ -1192,7 +1073,7 @@ func (client *ManagedClustersClient) BeginRunCommand(ctx context.Context, resour // see AKS Run Command // [https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview]. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) runCommand(ctx context.Context, resourceGroupName string, resourceName string, requestPayload RunCommandRequest, options *ManagedClustersClientBeginRunCommandOptions) (*http.Response, error) { req, err := client.runCommandCreateRequest(ctx, resourceGroupName, resourceName, requestPayload, options) if err != nil { @@ -1228,7 +1109,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, requestPayload) @@ -1237,7 +1118,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context // BeginStart - See starting a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] for more details about starting // a cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginStartOptions contains the optional parameters for the ManagedClustersClient.BeginStart @@ -1257,7 +1138,7 @@ func (client *ManagedClustersClient) BeginStart(ctx context.Context, resourceGro // Start - See starting a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] for more details about starting // a cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) start(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -1293,7 +1174,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1304,7 +1185,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res // cluster does not accrue charges while it is stopped. See stopping a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] // for more details about stopping a cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // options - ManagedClustersClientBeginStopOptions contains the optional parameters for the ManagedClustersClient.BeginStop @@ -1326,7 +1207,7 @@ func (client *ManagedClustersClient) BeginStop(ctx context.Context, resourceGrou // cluster does not accrue charges while it is stopped. See stopping a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] // for more details about stopping a cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) stop(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -1362,7 +1243,7 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1370,7 +1251,7 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso // BeginUpdateTags - Updates tags on a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the managed cluster resource. // parameters - Parameters supplied to the Update Managed Cluster Tags operation. @@ -1390,7 +1271,7 @@ func (client *ManagedClustersClient) BeginUpdateTags(ctx context.Context, resour // UpdateTags - Updates tags on a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-02-preview +// Generated from API version 2022-07-01 func (client *ManagedClustersClient) updateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClustersClientBeginUpdateTagsOptions) (*http.Response, error) { req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) if err != nil { @@ -1426,7 +1307,7 @@ func (client *ManagedClustersClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-02-preview") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go index 1c29b69f2836..2c258b559398 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ContainerServiceGetOSOptions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ContainerServiceGetOSOptions.json func ExampleManagedClustersClient_GetOSOptions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -36,7 +36,7 @@ func ExampleManagedClustersClient_GetOSOptions() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersList.json func ExampleManagedClustersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -60,7 +60,7 @@ func ExampleManagedClustersClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersListByResourceGroup.json func ExampleManagedClustersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -84,7 +84,7 @@ func ExampleManagedClustersClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersGetUpgradeProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersGetUpgradeProfile.json func ExampleManagedClustersClient_GetUpgradeProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,7 +103,7 @@ func ExampleManagedClustersClient_GetUpgradeProfile() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersGetAccessProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersGetAccessProfile.json func ExampleManagedClustersClient_GetAccessProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -122,7 +122,7 @@ func ExampleManagedClustersClient_GetAccessProfile() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersListClusterCredentialResult.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersListClusterAdminCredentials.json func ExampleManagedClustersClient_ListClusterAdminCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -141,8 +141,8 @@ func ExampleManagedClustersClient_ListClusterAdminCredentials() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersGet.json -func ExampleManagedClustersClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersListClusterUserCredentials.json +func ExampleManagedClustersClient_ListClusterUserCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -152,7 +152,9 @@ func ExampleManagedClustersClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "rg1", "clustername1", nil) + 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) } @@ -160,8 +162,8 @@ func ExampleManagedClustersClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersAssociate_CRG.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_associateManagedClusterWithCapacityReservationGroup() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersListClusterMonitoringUserCredentials.json +func ExampleManagedClustersClient_ListClusterMonitoringUserCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -171,79 +173,16 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_associateManagedClusterWit 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), - CapacityReservationGroupID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/capacityReservationGroups/crg1"), - Count: to.Ptr[int32](3), - EnableNodePublicIP: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(true), - EnableRBAC: to.Ptr(true), - KubernetesVersion: to.Ptr(""), - LinuxProfile: &armcontainerservice.LinuxProfile{ - AdminUsername: to.Ptr("azureuser"), - SSH: &armcontainerservice.SSHConfiguration{ - PublicKeys: []*armcontainerservice.SSHPublicKey{ - { - KeyData: to.Ptr("keydata"), - }}, - }, - }, - NetworkProfile: &armcontainerservice.NetworkProfile{ - LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - Count: to.Ptr[int32](2), - }, - }, - LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - }, - ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - ClientID: to.Ptr("clientid"), - Secret: to.Ptr("secret"), - }, - WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - AdminPassword: to.Ptr("replacePassword1234$"), - AdminUsername: to.Ptr("azureuser"), - }, - }, - SKU: &armcontainerservice.ManagedClusterSKU{ - Name: to.Ptr(armcontainerservice.ManagedClusterSKUNameBasic), - Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), - }, - }, nil) + res, err := client.ListClusterMonitoringUserCredentials(ctx, "rg1", "clustername1", &armcontainerservice.ManagedClustersClientListClusterMonitoringUserCredentialsOptions{ServerFqdn: 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/preview/2022-07-02-preview/examples/ManagedClustersCreate_MCSnapshot.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingAManagedClusterSnapshot() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersGet.json +func ExampleManagedClustersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -253,60 +192,15 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingA 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{ - AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - { - Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - Count: to.Ptr[int32](3), - EnableFIPS: to.Ptr(true), - EnableNodePublicIP: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), - }}, - CreationData: &armcontainerservice.CreationData{ - SourceResourceID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), - }, - DNSPrefix: to.Ptr("dnsprefix1"), - KubernetesVersion: to.Ptr(""), - LinuxProfile: &armcontainerservice.LinuxProfile{ - AdminUsername: to.Ptr("azureuser"), - SSH: &armcontainerservice.SSHConfiguration{ - PublicKeys: []*armcontainerservice.SSHPublicKey{ - { - KeyData: to.Ptr("keydata"), - }}, - }, - }, - ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - ClientID: to.Ptr("clientid"), - Secret: to.Ptr("secret"), - }, - }, - SKU: &armcontainerservice.ManagedClusterSKU{ - Name: to.Ptr(armcontainerservice.ManagedClusterSKUNameBasic), - Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), - }, - }, nil) + res, err := client.Get(ctx, "rg1", "clustername1", 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/preview/2022-07-02-preview/examples/ManagedClustersCreate_Snapshot.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_Snapshot.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingAnAgentPoolSnapshot() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -391,7 +285,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingA _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_ManagedNATGateway.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_ManagedNATGateway.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAksManagedNatGatewayAsOutboundType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -472,7 +366,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAk _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAzureKeyVaultSecretsProviderAddon() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -561,89 +455,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAz _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_EnableCustomCATrust.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCustomCaTrustEnabled() { - 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), - EnableCustomCATrust: to.Ptr(true), - EnableNodePublicIP: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(true), - EnableRBAC: to.Ptr(true), - KubernetesVersion: to.Ptr(""), - LinuxProfile: &armcontainerservice.LinuxProfile{ - AdminUsername: to.Ptr("azureuser"), - SSH: &armcontainerservice.SSHConfiguration{ - PublicKeys: []*armcontainerservice.SSHPublicKey{ - { - KeyData: to.Ptr("keydata"), - }}, - }, - }, - NetworkProfile: &armcontainerservice.NetworkProfile{ - LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - Count: to.Ptr[int32](2), - }, - }, - LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - }, - 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/preview/2022-07-02-preview/examples/ManagedClustersCreate_DedicatedHostGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_DedicatedHostGroup.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDedicatedHostGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -724,7 +536,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDe _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_EnableEncryptionAtHost.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEncryptionAtHostEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -806,7 +618,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEn _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_EnabledFIPS.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_EnabledFIPS.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFipsEnabledOs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -888,7 +700,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFi _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_GPUMIG.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_GPUMIG.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGpumig() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -978,7 +790,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGp _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_HTTPProxy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_HTTPProxy.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHttpProxyConfigured() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1067,7 +879,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHt _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_NodePublicIPPrefix.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNodePublicIpPrefix() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1149,7 +961,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNo _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_OSSKU.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_OSSKU.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOssku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1239,7 +1051,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOs _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_PPG.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_PPG.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPpg() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1321,7 +1133,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPp _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_PodIdentity.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_PodIdentity.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPodIdentityEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1406,7 +1218,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPo _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_DisableRunCommand.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_DisableRunCommand.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithRunCommandDisabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1490,7 +1302,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithRu _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_SecurityProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_SecurityProfile.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSecurityProfileConfigured() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1563,7 +1375,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSe _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_EnableUltraSSD.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_EnableUltraSSD.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUltraSsdEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1645,78 +1457,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUl _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithWebAppRoutingIngressProfileConfigured() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - 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{ - AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ - { - Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - Count: to.Ptr[int32](3), - EnableNodePublicIP: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), - }}, - DNSPrefix: to.Ptr("dnsprefix1"), - IngressProfile: &armcontainerservice.ManagedClusterIngressProfile{ - WebAppRouting: &armcontainerservice.ManagedClusterIngressProfileWebAppRouting{ - DNSZoneResourceID: to.Ptr("/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME"), - Enabled: to.Ptr(true), - }, - }, - KubernetesVersion: to.Ptr(""), - LinuxProfile: &armcontainerservice.LinuxProfile{ - AdminUsername: to.Ptr("azureuser"), - SSH: &armcontainerservice.SSHConfiguration{ - PublicKeys: []*armcontainerservice.SSHPublicKey{ - { - KeyData: to.Ptr("keydata"), - }}, - }, - }, - NetworkProfile: &armcontainerservice.NetworkProfile{ - LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - Count: to.Ptr[int32](2), - }, - }, - LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - }, - }, - SKU: &armcontainerservice.ManagedClusterSKU{ - Name: to.Ptr(armcontainerservice.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/preview/2022-07-02-preview/examples/ManagedClustersCreate_UserAssignedNATGateway.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUserAssignedNatGatewayAsOutboundType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1792,7 +1533,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUs _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateClusterWithPublicFqdnSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1877,7 +1618,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateClusterWithFqdnSubdomainSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1962,7 +1703,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClusterWithEnableAzureRbac() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2051,7 +1792,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClus _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_Update.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2148,7 +1889,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_UpdateWithAHUB.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_UpdateWithAHUB.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithEnableAhub() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2240,93 +1981,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_UpdateWithEnableNamespaceResources.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithEnableNamespaceResources() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - 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), - AvailabilityZones: []*string{ - to.Ptr("1"), - to.Ptr("2"), - to.Ptr("3")}, - Count: to.Ptr[int32](3), - EnableNodePublicIP: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS1_v2"), - Name: to.Ptr("nodepool1"), - }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnableNamespaceResources: to.Ptr(true), - EnablePodSecurityPolicy: to.Ptr(true), - EnableRBAC: to.Ptr(true), - KubernetesVersion: to.Ptr(""), - LinuxProfile: &armcontainerservice.LinuxProfile{ - AdminUsername: to.Ptr("azureuser"), - SSH: &armcontainerservice.SSHConfiguration{ - PublicKeys: []*armcontainerservice.SSHPublicKey{ - { - KeyData: to.Ptr("keydata"), - }}, - }, - }, - NetworkProfile: &armcontainerservice.NetworkProfile{ - LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ - ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ - Count: to.Ptr[int32](2), - }, - }, - LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - }, - ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - ClientID: to.Ptr("clientid"), - Secret: to.Ptr("secret"), - }, - WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - AdminPassword: to.Ptr("replacePassword1234$"), - AdminUsername: to.Ptr("azureuser"), - }, - }, - SKU: &armcontainerservice.ManagedClusterSKU{ - Name: to.Ptr(armcontainerservice.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/preview/2022-07-02-preview/examples/ManagedClustersCreate_UpdateWindowsGmsa.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithWindowsGMsaEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2420,7 +2075,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersCreate_DualStackNetworking.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersCreate_DualStackNetworking.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithDualStackNetworking() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2520,7 +2175,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersUpdateTags.json func ExampleManagedClustersClient_BeginUpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2548,7 +2203,7 @@ func ExampleManagedClustersClient_BeginUpdateTags() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersDelete.json func ExampleManagedClustersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2559,7 +2214,7 @@ func ExampleManagedClustersClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "rg1", "clustername1", &armcontainerservice.ManagedClustersClientBeginDeleteOptions{IgnorePodDisruptionBudget: nil}) + poller, err := client.BeginDelete(ctx, "rg1", "clustername1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -2569,7 +2224,7 @@ func ExampleManagedClustersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersResetServicePrincipalProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersResetServicePrincipalProfile.json func ExampleManagedClustersClient_BeginResetServicePrincipalProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2593,7 +2248,7 @@ func ExampleManagedClustersClient_BeginResetServicePrincipalProfile() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersResetAADProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersResetAADProfile.json func ExampleManagedClustersClient_BeginResetAADProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2619,24 +2274,7 @@ func ExampleManagedClustersClient_BeginResetAADProfile() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersAbortOperation.json -func ExampleManagedClustersClient_AbortLatestOperation() { - 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) - } - _, err = client.AbortLatestOperation(ctx, "rg1", "clustername1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersRotateClusterCertificates.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersRotateClusterCertificates.json func ExampleManagedClustersClient_BeginRotateClusterCertificates() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2657,28 +2295,7 @@ func ExampleManagedClustersClient_BeginRotateClusterCertificates() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersRotateServiceAccountSigningKeys.json -func ExampleManagedClustersClient_BeginRotateServiceAccountSigningKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewManagedClustersClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRotateServiceAccountSigningKeys(ctx, "rg1", "clustername1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersStop.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersStop.json func ExampleManagedClustersClient_BeginStop() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2699,7 +2316,7 @@ func ExampleManagedClustersClient_BeginStop() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClustersStart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/ManagedClustersStart.json func ExampleManagedClustersClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2720,7 +2337,7 @@ func ExampleManagedClustersClient_BeginStart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/RunCommandRequest.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/RunCommandRequest.json func ExampleManagedClustersClient_BeginRunCommand() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2747,7 +2364,7 @@ func ExampleManagedClustersClient_BeginRunCommand() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/RunCommandResultFailed.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/RunCommandResultFailed.json func ExampleManagedClustersClient_GetCommandResult_commandFailedResult() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2766,7 +2383,7 @@ func ExampleManagedClustersClient_GetCommandResult_commandFailedResult() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/RunCommandResultSucceed.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/RunCommandResultSucceed.json func ExampleManagedClustersClient_GetCommandResult_commandSucceedResult() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2785,7 +2402,7 @@ func ExampleManagedClustersClient_GetCommandResult_commandSucceedResult() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/OutboundNetworkDependenciesEndpointsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-07-01/examples/OutboundNetworkDependenciesEndpointsList.json func ExampleManagedClustersClient_NewListOutboundNetworkDependenciesEndpointsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go deleted file mode 100644 index f814bff98be7..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go +++ /dev/null @@ -1,402 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcontainerservice - -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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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/managedclustersnapshots_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client_example_test.go deleted file mode 100644 index dbf5a3484cea..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client_example_test.go +++ /dev/null @@ -1,156 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/ManagedClusterSnapshotsList.json -func ExampleManagedClusterSnapshotsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewManagedClusterSnapshotsClient("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/preview/2022-07-02-preview/examples/ManagedClusterSnapshotsListByResourceGroup.json -func ExampleManagedClusterSnapshotsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewManagedClusterSnapshotsClient("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/preview/2022-07-02-preview/examples/ManagedClusterSnapshotsGet.json -func ExampleManagedClusterSnapshotsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewManagedClusterSnapshotsClient("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/preview/2022-07-02-preview/examples/ManagedClusterSnapshotsCreate.json -func ExampleManagedClusterSnapshotsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewManagedClusterSnapshotsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "rg1", "snapshot1", armcontainerservice.ManagedClusterSnapshot{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - "key2": to.Ptr("val2"), - }, - Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ - CreationData: &armcontainerservice.CreationData{ - SourceResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // 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/preview/2022-07-02-preview/examples/ManagedClusterSnapshotsUpdateTags.json -func ExampleManagedClusterSnapshotsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewManagedClusterSnapshotsClient("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/preview/2022-07-02-preview/examples/ManagedClusterSnapshotsDelete.json -func ExampleManagedClusterSnapshotsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewManagedClusterSnapshotsClient("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/models.go b/sdk/resourcemanager/containerservice/armcontainerservice/models.go index 1f2c528bcce0..5211b6379970 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/models.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/models.go @@ -121,12 +121,6 @@ type AgentPoolUpgradeSettings struct { MaxSurge *string `json:"maxSurge,omitempty"` } -// AgentPoolsClientAbortLatestOperationOptions contains the optional parameters for the AgentPoolsClient.AbortLatestOperation -// method. -type AgentPoolsClientAbortLatestOperationOptions struct { - // placeholder for future optional parameters -} - // AgentPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginCreateOrUpdate // method. type AgentPoolsClientBeginCreateOrUpdateOptions struct { @@ -136,8 +130,6 @@ type AgentPoolsClientBeginCreateOrUpdateOptions struct { // AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method. type AgentPoolsClientBeginDeleteOptions struct { - // ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget - IgnorePodDisruptionBudget *bool // Resumes the LRO from the provided token. ResumeToken string } @@ -170,24 +162,6 @@ type AgentPoolsClientListOptions struct { // placeholder for future optional parameters } -// AzureEntityResource - The resource model definition for an Azure Resource Manager resource with an etag. -type AzureEntityResource struct { - // READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // 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"` -} - // 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. @@ -302,40 +276,6 @@ type EndpointDetail struct { Protocol *string `json:"protocol,omitempty"` } -// ErrorAdditionalInfo - The resource management error additional info. -type ErrorAdditionalInfo struct { - // READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty" azure:"ro"` - - // READ-ONLY; The additional info type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ErrorDetail - The error detail. -type ErrorDetail struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` - - // READ-ONLY; The error code. - Code *string `json:"code,omitempty" azure:"ro"` - - // READ-ONLY; The error details. - Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` - - // READ-ONLY; The error message. - Message *string `json:"message,omitempty" azure:"ro"` - - // READ-ONLY; The error target. - Target *string `json:"target,omitempty" azure:"ro"` -} - -// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. -// (This also follows the OData error response format.). -type ErrorResponse struct { - // The error object. - Error *ErrorDetail `json:"error,omitempty"` -} - // ExtendedLocation - The complex type of the extended location. type ExtendedLocation struct { // The name of the extended location. @@ -345,206 +285,6 @@ type ExtendedLocation struct { Type *ExtendedLocationTypes `json:"type,omitempty"` } -// Fleet - The Fleet resource which contains multiple Kubernetes clusters as its members. -type Fleet struct { - // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` - - // Properties of a Fleet. - Properties *FleetProperties `json:"properties,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - - // READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // 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"` -} - -// FleetCredentialResult - The credential result response. -type FleetCredentialResult struct { - // READ-ONLY; The name of the credential. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Base64-encoded Kubernetes configuration file. - Value []byte `json:"value,omitempty" azure:"ro"` -} - -// FleetCredentialResults - The list credential result response. -type FleetCredentialResults struct { - // READ-ONLY; Base64-encoded Kubernetes configuration file. - Kubeconfigs []*FleetCredentialResult `json:"kubeconfigs,omitempty" azure:"ro"` -} - -// FleetHubProfile - The FleetHubProfile configures the fleet hub. -type FleetHubProfile struct { - // DNS prefix used to create the FQDN for the Fleet hub. - DNSPrefix *string `json:"dnsPrefix,omitempty"` - - // READ-ONLY; The FQDN of the Fleet hub. - Fqdn *string `json:"fqdn,omitempty" azure:"ro"` - - // READ-ONLY; The Kubernetes version of the Fleet hub. - KubernetesVersion *string `json:"kubernetesVersion,omitempty" azure:"ro"` -} - -// FleetListResult - The response from the List Fleets operation. -type FleetListResult struct { - // The list of Fleets. - Value []*Fleet `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next page of Fleets. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// FleetMember - A member of the Fleet. It contains a reference to an existing Kubernetes cluster on Azure. -type FleetMember struct { - // Properties of a Fleet member. - Properties *FleetMemberProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty" azure:"ro"` - - // 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"` -} - -// FleetMemberProperties - Properties of a Fleet member. -type FleetMemberProperties struct { - // The ARM resource id of the cluster that joins the Fleet. Must be a valid Azure resource id. e.g.: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{clusterName}'. - ClusterResourceID *string `json:"clusterResourceId,omitempty"` - - // READ-ONLY; The provisioning state of the last accepted operation. - ProvisioningState *FleetMemberProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// FleetMembersClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetMembersClient.BeginCreateOrUpdate -// method. -type FleetMembersClientBeginCreateOrUpdateOptions struct { - // Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting - // concurrent changes. - IfMatch *string - // Set to '*' to allow a new resource to be created and prevent updating an existing resource. Other values will result in - // a 412 Pre-condition Failed response. - IfNoneMatch *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FleetMembersClientBeginDeleteOptions contains the optional parameters for the FleetMembersClient.BeginDelete method. -type FleetMembersClientBeginDeleteOptions struct { - // Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting - // concurrent changes. - IfMatch *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FleetMembersClientGetOptions contains the optional parameters for the FleetMembersClient.Get method. -type FleetMembersClientGetOptions struct { - // placeholder for future optional parameters -} - -// FleetMembersClientListByFleetOptions contains the optional parameters for the FleetMembersClient.ListByFleet method. -type FleetMembersClientListByFleetOptions struct { - // placeholder for future optional parameters -} - -// FleetMembersListResult - The response from the List FleetMembers operation. -type FleetMembersListResult struct { - // The list of members in a given Fleet. - Value []*FleetMember `json:"value,omitempty"` - - // READ-ONLY; The URL to get the next page of Fleet members. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// FleetPatch - Properties of a Fleet that can be patched. -type FleetPatch struct { - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` -} - -// FleetProperties - Properties of a Fleet. -type FleetProperties struct { - // The FleetHubProfile configures the Fleet's hub. - HubProfile *FleetHubProfile `json:"hubProfile,omitempty"` - - // READ-ONLY; The provisioning state of the last accepted operation. - ProvisioningState *FleetProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// FleetsClientBeginCreateOrUpdateOptions contains the optional parameters for the FleetsClient.BeginCreateOrUpdate method. -type FleetsClientBeginCreateOrUpdateOptions struct { - // Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting - // concurrent changes. - IfMatch *string - // Set to '*' to allow a new resource to be created and prevent updating an existing resource. Other values will result in - // a 412 Pre-condition Failed response. - IfNoneMatch *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FleetsClientBeginDeleteOptions contains the optional parameters for the FleetsClient.BeginDelete method. -type FleetsClientBeginDeleteOptions struct { - // Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting - // concurrent changes. - IfMatch *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FleetsClientGetOptions contains the optional parameters for the FleetsClient.Get method. -type FleetsClientGetOptions struct { - // placeholder for future optional parameters -} - -// FleetsClientListByResourceGroupOptions contains the optional parameters for the FleetsClient.ListByResourceGroup method. -type FleetsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// FleetsClientListCredentialsOptions contains the optional parameters for the FleetsClient.ListCredentials method. -type FleetsClientListCredentialsOptions struct { - // placeholder for future optional parameters -} - -// FleetsClientListOptions contains the optional parameters for the FleetsClient.List method. -type FleetsClientListOptions struct { - // placeholder for future optional parameters -} - -// FleetsClientUpdateOptions contains the optional parameters for the FleetsClient.Update method. -type FleetsClientUpdateOptions struct { - // Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting - // concurrent changes. - IfMatch *string - // The properties of a Fleet to update. - Parameters *FleetPatch -} - // KubeletConfig - See AKS custom node configuration [https://docs.microsoft.com/azure/aks/custom-node-configuration] for // more details. type KubeletConfig struct { @@ -750,16 +490,9 @@ 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. @@ -818,9 +551,6 @@ type ManagedClusterAgentPoolProfile struct { // The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. AvailabilityZones []*string `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. @@ -832,10 +562,6 @@ 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"` @@ -876,11 +602,6 @@ 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"` @@ -906,21 +627,20 @@ type ManagedClusterAgentPoolProfile struct { // see Ephemeral OS [https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os]. OSDiskType *OSDiskType `json:"osDiskType,omitempty"` - // Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if - // OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 - // after Windows2019 is deprecated. + // Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when + // Kubernetes = 1.25 if OSType is Windows. OSSKU *OSSKU `json:"osSKU,omitempty"` // The operating system type. The default is Linux. OSType *OSType `json:"osType,omitempty"` - // Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating - // the agent pool with the same once it has been created will not trigger an - // upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster - // to the same Kubernetes version. The node pool version must have the same - // major version as the control plane. The node pool minor version must be within two minor versions of the control plane - // version. The node pool version cannot be greater than the control plane version. - // For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. + // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version + // is chosen automatically. Updating the cluster with the same once it has been + // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, + // you should upgrade all node pools in an AKS cluster to the same Kubernetes + // version. The node pool version must have the same major version as the control plane. The node pool minor version must + // be within two minor versions of the control plane version. The node pool version + // cannot be greater than the control plane version. For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` // If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: @@ -971,8 +691,8 @@ type ManagedClusterAgentPoolProfile struct { // Determines the type of workload a node can run. WorkloadRuntime *WorkloadRuntime `json:"workloadRuntime,omitempty"` - // READ-ONLY; If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion - // was , this field will contain the full version being used. + // READ-ONLY; If orchestratorVersion is a fully specified version , this field will be exactly equal to it. If orchestratorVersion + // is , this field will contain the full version being used. CurrentOrchestratorVersion *string `json:"currentOrchestratorVersion,omitempty" azure:"ro"` // READ-ONLY; The version of node image @@ -987,9 +707,6 @@ type ManagedClusterAgentPoolProfileProperties struct { // The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. AvailabilityZones []*string `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. @@ -1001,10 +718,6 @@ 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"` @@ -1045,11 +758,6 @@ 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"` @@ -1075,21 +783,20 @@ type ManagedClusterAgentPoolProfileProperties struct { // see Ephemeral OS [https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os]. OSDiskType *OSDiskType `json:"osDiskType,omitempty"` - // Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if - // OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 - // after Windows2019 is deprecated. + // Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when + // Kubernetes = 1.25 if OSType is Windows. OSSKU *OSSKU `json:"osSKU,omitempty"` // The operating system type. The default is Linux. OSType *OSType `json:"osType,omitempty"` - // Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating - // the agent pool with the same once it has been created will not trigger an - // upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster - // to the same Kubernetes version. The node pool version must have the same - // major version as the control plane. The node pool minor version must be within two minor versions of the control plane - // version. The node pool version cannot be greater than the control plane version. - // For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. + // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version + // is chosen automatically. Updating the cluster with the same once it has been + // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, + // you should upgrade all node pools in an AKS cluster to the same Kubernetes + // version. The node pool version must have the same major version as the control plane. The node pool minor version must + // be within two minor versions of the control plane version. The node pool version + // cannot be greater than the control plane version. For more information see upgrading a node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` // If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: @@ -1140,8 +847,8 @@ type ManagedClusterAgentPoolProfileProperties struct { // Determines the type of workload a node can run. WorkloadRuntime *WorkloadRuntime `json:"workloadRuntime,omitempty"` - // READ-ONLY; If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion - // was , this field will contain the full version being used. + // READ-ONLY; If orchestratorVersion is a fully specified version , this field will be exactly equal to it. If orchestratorVersion + // is , this field will contain the full version being used. CurrentOrchestratorVersion *string `json:"currentOrchestratorVersion,omitempty" azure:"ro"` // READ-ONLY; The version of node image @@ -1157,31 +864,6 @@ type ManagedClusterAutoUpgradeProfile struct { UpgradeChannel *UpgradeChannel `json:"upgradeChannel,omitempty"` } -// ManagedClusterAzureMonitorProfile - Prometheus addon profile for the container service cluster -type ManagedClusterAzureMonitorProfile struct { - // Metrics profile for the prometheus service addon - Metrics *ManagedClusterAzureMonitorProfileMetrics `json:"metrics,omitempty"` -} - -// ManagedClusterAzureMonitorProfileKubeStateMetrics - Kube State Metrics for prometheus addon profile for the container service -// cluster -type ManagedClusterAzureMonitorProfileKubeStateMetrics struct { - // Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. - MetricAnnotationsAllowList *string `json:"metricAnnotationsAllowList,omitempty"` - - // Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. - MetricLabelsAllowlist *string `json:"metricLabelsAllowlist,omitempty"` -} - -// ManagedClusterAzureMonitorProfileMetrics - Metrics profile for the prometheus service addon -type ManagedClusterAzureMonitorProfileMetrics struct { - // REQUIRED; Whether to enable the Prometheus collector - Enabled *bool `json:"enabled,omitempty"` - - // Kube State Metrics for prometheus addon profile for the container service cluster - KubeStateMetrics *ManagedClusterAzureMonitorProfileKubeStateMetrics `json:"kubeStateMetrics,omitempty"` -} - // ManagedClusterHTTPProxyConfig - Cluster HTTP proxy configuration. type ManagedClusterHTTPProxyConfig struct { // The HTTP proxy server endpoint to use. @@ -1195,10 +877,6 @@ 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. @@ -1216,21 +894,6 @@ 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. @@ -1310,15 +973,6 @@ 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. @@ -1441,12 +1095,6 @@ type ManagedClusterProperties struct { // The auto upgrade configuration. AutoUpgradeProfile *ManagedClusterAutoUpgradeProfile `json:"autoUpgradeProfile,omitempty"` - // Prometheus addon profile for the container service cluster - AzureMonitorProfile *ManagedClusterAzureMonitorProfile `json:"azureMonitorProfile,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"` @@ -1458,11 +1106,6 @@ 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"` @@ -1479,13 +1122,13 @@ type ManagedClusterProperties struct { // Identities associated with the cluster. IdentityProfile map[string]*UserAssignedIdentity `json:"identityProfile,omitempty"` - // 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. + // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version + // is chosen automatically. Updating the cluster with the same once it has been + // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade + // a supported AKS cluster, Kubernetes minor versions cannot be skipped. All + // upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x + // -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See upgrading + // an AKS cluster [https://docs.microsoft.com/azure/aks/upgrade-cluster] for more details. KubernetesVersion *string `json:"kubernetesVersion,omitempty"` // The profile for Linux VMs in the Managed Cluster. @@ -1497,9 +1140,6 @@ 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"` @@ -1522,15 +1162,13 @@ 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; The version of Kubernetes the Managed Cluster is running. + // READ-ONLY; If kubernetesVersion was a fully specified version , this field will be exactly equal to it. If kubernetesVersion + // was , this field will contain the full version being used. CurrentKubernetesVersion *string `json:"currentKubernetesVersion,omitempty" azure:"ro"` // READ-ONLY; The FQDN of the master pool. @@ -1608,21 +1246,6 @@ 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. @@ -1640,16 +1263,6 @@ type ManagedClusterSecurityProfile struct { // Microsoft Defender settings for the security profile. Defender *ManagedClusterSecurityProfileDefender `json:"defender,omitempty"` - - // ImageCleaner settings for the security profile. - ImageCleaner *ManagedClusterSecurityProfileImageCleaner `json:"imageCleaner,omitempty"` - - // Node Restriction [https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#noderestriction] settings - // for the security profile. - NodeRestriction *ManagedClusterSecurityProfileNodeRestriction `json:"nodeRestriction,omitempty"` - - // Workload Identity [https://azure.github.io/azure-workload-identity/docs/] settings for the security profile. - WorkloadIdentity *ManagedClusterSecurityProfileWorkloadIdentity `json:"workloadIdentity,omitempty"` } // ManagedClusterSecurityProfileDefender - Microsoft Defender settings for the security profile. @@ -1669,28 +1282,6 @@ type ManagedClusterSecurityProfileDefenderSecurityMonitoring struct { Enabled *bool `json:"enabled,omitempty"` } -// ManagedClusterSecurityProfileImageCleaner - ImageCleaner removes unused images from nodes, freeing up disk space and helping -// to reduce attack surface area. Here are settings for the security profile. -type ManagedClusterSecurityProfileImageCleaner struct { - // Whether to enable ImageCleaner on AKS cluster. - Enabled *bool `json:"enabled,omitempty"` - - // ImageCleaner scanning interval. - IntervalHours *int32 `json:"intervalHours,omitempty"` -} - -// ManagedClusterSecurityProfileNodeRestriction - Node Restriction settings for the security profile. -type ManagedClusterSecurityProfileNodeRestriction struct { - // Whether to enable Node Restriction - Enabled *bool `json:"enabled,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 // Azure APIs. type ManagedClusterServicePrincipalProfile struct { @@ -1701,90 +1292,8 @@ 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"` @@ -1795,19 +1304,10 @@ 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. @@ -1880,39 +1380,6 @@ 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"` - VerticalPodAutoscaler *ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler `json:"verticalPodAutoscaler,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"` -} - -type ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler struct { - // REQUIRED; Controls which resource value autoscaler will change. Default value is RequestsAndLimits. - ControlledValues *ControlledValues `json:"controlledValues,omitempty"` - - // REQUIRED; Whether to enable VPA. Default value is false. - Enabled *bool `json:"enabled,omitempty"` - - // REQUIRED; Each update mode level is a superset of the lower levels. Off 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-07-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *TrustedAccessRoleBindingsClient) listHandleResponse(resp *http.Response) (TrustedAccessRoleBindingsClientListResponse, error) { - result := TrustedAccessRoleBindingsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleBindingListResult); err != nil { - return TrustedAccessRoleBindingsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client_example_test.go deleted file mode 100644 index ea4fab2282b5..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client_example_test.go +++ /dev/null @@ -1,104 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/TrustedAccessRoleBindings_List.json -func ExampleTrustedAccessRoleBindingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewTrustedAccessRoleBindingsClient("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/preview/2022-07-02-preview/examples/TrustedAccessRoleBindings_Get.json -func ExampleTrustedAccessRoleBindingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewTrustedAccessRoleBindingsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "rg1", "clustername1", "binding1", 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/preview/2022-07-02-preview/examples/TrustedAccessRoleBindings_CreateOrUpdate.json -func ExampleTrustedAccessRoleBindingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewTrustedAccessRoleBindingsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "rg1", "clustername1", "binding1", armcontainerservice.TrustedAccessRoleBinding{ - Properties: &armcontainerservice.TrustedAccessRoleBindingProperties{ - Roles: []*string{ - to.Ptr("Microsoft.MachineLearningServices/workspaces/reader"), - to.Ptr("Microsoft.MachineLearningServices/workspaces/writer")}, - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/b/providers/Microsoft.MachineLearningServices/workspaces/c"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // 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/preview/2022-07-02-preview/examples/TrustedAccessRoleBindings_Delete.json -func ExampleTrustedAccessRoleBindingsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewTrustedAccessRoleBindingsClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "rg1", "clustername1", "binding1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go deleted file mode 100644 index 7f8b3fbfbceb..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcontainerservice - -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-07-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-07-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *TrustedAccessRolesClient) listHandleResponse(resp *http.Response) (TrustedAccessRolesClientListResponse, error) { - result := TrustedAccessRolesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TrustedAccessRoleListResult); err != nil { - return TrustedAccessRolesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client_example_test.go deleted file mode 100644 index 5c4650b9106a..000000000000 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerservice_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-07-02-preview/examples/TrustedAccessRoles_List.json -func ExampleTrustedAccessRolesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcontainerservice.NewTrustedAccessRolesClient("subid1", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("westus2", 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 - } - } -}