From 300585ee73500afb2bad2219c79bea5d69fdbeb4 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 24 Nov 2022 02:36:19 +0000 Subject: [PATCH] CodeGen from PR 21439 in Azure/azure-rest-api-specs Review request for Microsoft.ContainerService to add version 2022-10-02-preview (#21439) * Adds base for updating Microsoft.ContainerService from version preview/2022-09-02-preview to version 2022-10-02-preview * Updates readme * Updates API version in new specs and examples * Pmiller/nodeosupgradechannel (#21326) * missed working comment * matthew comments * unpatched is a word * Add MaintenanceWindow into MaintenanceConfigurationProperties (#21337) * Add MaintenanceWindow into MaintenanceConfigurationProperties * Fx PrettierCheck * Fix ARM ID format for samples (#21402) * Fix Swagger Model Validation for the 2022-10-02-preview dev branch of container service (#21373) * fix API version * fix INVALID_FORMAT byte * fix INVALID_FORMAT arm-id * fix missing resource id * fix LRO_RESPONSE_HEADER * Update readmes for the 2022-10-02-preview dev branch of container service (#21366) * update readmes * remove fleets * Updating abort apis response to make it long running (#21362) * Updating response abort abort apis * Updating abort AP and MC examples * Changes per CI checks * Adding x-ms-long-running-operation-options * Adding location header Co-authored-by: InduSridhar * fix 202 location header * fix ProvisioningState validation * add x-ms-long-running-operation-options * fix ResourceNameRestriction * Fix abort location url in example (#21446) * Updating response abort abort apis * Updating abort AP and MC examples * Changes per CI checks * Adding x-ms-long-running-operation-options * Adding location header * Fixing location url in abort examples Co-authored-by: InduSridhar * Abort api response fix (#21559) * Updating response abort abort apis * Updating abort AP and MC examples * Changes per CI checks * Adding x-ms-long-running-operation-options * Adding location header * Fixing location url in abort examples * Fixing headers and body for abort response * Linter fix * Lint fix * Updating managedclusters.json responses Co-authored-by: InduSridhar * Node os upgrade desc fix (#21636) * Updating response abort abort apis * Updating abort AP and MC examples * Changes per CI checks * Adding x-ms-long-running-operation-options * Adding location header * Fixing location url in abort examples * Fixing headers and body for abort response * Linter fix * Lint fix * Updating managedclusters.json responses * Minor edit to node os upgrade description based on ARM review Co-authored-by: InduSridhar Co-authored-by: Paul Miller Co-authored-by: Thalia Wang <58485997+wenxuan0923@users.noreply.github.com> Co-authored-by: Matthew Christopher Co-authored-by: InduSridhar Co-authored-by: InduSridhar --- .../arm-containerservice/CHANGELOG.md | 69 ++- .../arm-containerservice/_meta.json | 8 +- .../arm-containerservice/package.json | 17 +- .../review/arm-containerservice.api.md | 203 +++++++- .../src/containerServiceClient.ts | 47 +- .../arm-containerservice/src/index.ts | 1 - .../arm-containerservice/src/models/index.ts | 291 +++++++++++- .../src/models/mappers.ts | 442 ++++++++++++++++++ .../src/models/parameters.ts | 33 +- .../src/operations/agentPools.ts | 174 +++++-- .../src/operations/fleetMembers.ts | 42 +- .../src/operations/fleets.ts | 81 ++-- .../operations/maintenanceConfigurations.ts | 38 +- .../src/operations/managedClusterSnapshots.ts | 61 +-- .../src/operations/managedClusters.ts | 372 ++++++++++----- .../src/operations/operations.ts | 15 +- .../src/operations/snapshots.ts | 61 +-- .../operations/trustedAccessRoleBindings.ts | 34 +- .../src/operations/trustedAccessRoles.ts | 29 +- .../src/operationsInterfaces/agentPools.ts | 42 +- .../operationsInterfaces/managedClusters.ts | 83 +++- .../arm-containerservice/src/pagingHelper.ts | 39 -- .../arm-containerservice/test/sampleTest.ts | 43 ++ .../arm-containerservice/tsconfig.json | 10 +- 24 files changed, 1624 insertions(+), 611 deletions(-) delete mode 100644 sdk/containerservice/arm-containerservice/src/pagingHelper.ts create mode 100644 sdk/containerservice/arm-containerservice/test/sampleTest.ts diff --git a/sdk/containerservice/arm-containerservice/CHANGELOG.md b/sdk/containerservice/arm-containerservice/CHANGELOG.md index 841b05c9eb3d..46286429b4ee 100644 --- a/sdk/containerservice/arm-containerservice/CHANGELOG.md +++ b/sdk/containerservice/arm-containerservice/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 17.2.0-beta.1 (2022-11-07) +## 18.0.0-beta.3 (2022-11-24) **Features** @@ -9,16 +9,21 @@ - Added operation group ManagedClusterSnapshots - Added operation group TrustedAccessRoleBindings - Added operation group TrustedAccessRoles - - Added operation AgentPools.abortLatestOperation - - Added operation ManagedClusters.abortLatestOperation - - Added operation ManagedClusters.beginRotateServiceAccountSigningKeys - - Added operation ManagedClusters.beginRotateServiceAccountSigningKeysAndWait + - Added operation AgentPools.beginAbortLatestOperation + - Added operation AgentPools.beginAbortLatestOperationAndWait + - Added operation ManagedClusters.beginAbortLatestOperation + - Added operation ManagedClusters.beginAbortLatestOperationAndWait + - Added Interface AbsoluteMonthlySchedule - Added Interface AgentPoolNetworkProfile + - Added Interface AgentPoolsAbortLatestOperationHeaders - Added Interface AgentPoolsAbortLatestOperationOptionalParams + - Added Interface AgentPoolsDeleteHeaders - Added Interface AgentPoolWindowsProfile - Added Interface AzureEntityResource - Added Interface ContainerServiceNetworkProfileKubeProxyConfig - Added Interface ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + - Added Interface DailySchedule + - Added Interface DateSpan - Added Interface ErrorAdditionalInfo - Added Interface ErrorDetail - Added Interface ErrorResponse @@ -48,17 +53,20 @@ - Added Interface FleetsUpdateOptionalParams - Added Interface GuardrailsProfile - Added Interface IPTag + - Added Interface MaintenanceWindow - Added Interface ManagedClusterAzureMonitorProfile - Added Interface ManagedClusterAzureMonitorProfileKubeStateMetrics - Added Interface ManagedClusterAzureMonitorProfileMetrics - Added Interface ManagedClusterIngressProfile - Added Interface ManagedClusterIngressProfileWebAppRouting - - Added Interface ManagedClusterOidcIssuerProfile - Added Interface ManagedClusterPropertiesForSnapshot + - Added Interface ManagedClustersAbortLatestOperationHeaders - Added Interface ManagedClustersAbortLatestOperationOptionalParams + - Added Interface ManagedClustersDeleteHeaders - Added Interface ManagedClusterSecurityProfileImageCleaner - Added Interface ManagedClusterSecurityProfileNodeRestriction - Added Interface ManagedClusterSecurityProfileWorkloadIdentity + - Added Interface ManagedClustersGetCommandResultHeaders - Added Interface ManagedClusterSnapshot - Added Interface ManagedClusterSnapshotListResult - Added Interface ManagedClusterSnapshotsCreateOrUpdateOptionalParams @@ -69,13 +77,19 @@ - Added Interface ManagedClusterSnapshotsListNextOptionalParams - Added Interface ManagedClusterSnapshotsListOptionalParams - Added Interface ManagedClusterSnapshotsUpdateTagsOptionalParams - - Added Interface ManagedClustersRotateServiceAccountSigningKeysOptionalParams - - Added Interface ManagedClusterStorageProfileBlobCSIDriver + - Added Interface ManagedClustersResetAADProfileHeaders + - Added Interface ManagedClustersResetServicePrincipalProfileHeaders + - Added Interface ManagedClustersRotateClusterCertificatesHeaders + - Added Interface ManagedClustersRunCommandHeaders + - Added Interface ManagedClustersStartHeaders + - Added Interface ManagedClustersStopHeaders - Added Interface ManagedClusterWorkloadAutoScalerProfile - Added Interface ManagedClusterWorkloadAutoScalerProfileKeda - Added Interface ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler - Added Interface NetworkProfileForSnapshot - Added Interface PortRange + - Added Interface RelativeMonthlySchedule + - Added Interface Schedule - Added Interface TrustedAccessRole - Added Interface TrustedAccessRoleBinding - Added Interface TrustedAccessRoleBindingListResult @@ -88,6 +102,9 @@ - Added Interface TrustedAccessRoleRule - Added Interface TrustedAccessRolesListNextOptionalParams - Added Interface TrustedAccessRolesListOptionalParams + - Added Interface WeeklySchedule + - Added Type Alias AgentPoolsAbortLatestOperationResponse + - Added Type Alias AgentPoolsDeleteResponse - Added Type Alias BackendPoolType - Added Type Alias ControlledValues - Added Type Alias EbpfDataplane @@ -107,6 +124,8 @@ - Added Type Alias FleetsUpdateResponse - Added Type Alias IpvsScheduler - Added Type Alias Level + - Added Type Alias ManagedClustersAbortLatestOperationResponse + - Added Type Alias ManagedClustersDeleteResponse - Added Type Alias ManagedClusterSnapshotsCreateOrUpdateResponse - Added Type Alias ManagedClusterSnapshotsGetResponse - Added Type Alias ManagedClusterSnapshotsListByResourceGroupNextResponse @@ -114,8 +133,12 @@ - Added Type Alias ManagedClusterSnapshotsListNextResponse - Added Type Alias ManagedClusterSnapshotsListResponse - Added Type Alias ManagedClusterSnapshotsUpdateTagsResponse + - Added Type Alias ManagedClustersRotateClusterCertificatesResponse + - Added Type Alias ManagedClustersStartResponse + - Added Type Alias ManagedClustersStopResponse - Added Type Alias Mode - Added Type Alias NetworkPluginMode + - Added Type Alias NodeOSUpgradeChannel - Added Type Alias Protocol - Added Type Alias TrustedAccessRoleBindingProvisioningState - Added Type Alias TrustedAccessRoleBindingsCreateOrUpdateResponse @@ -124,6 +147,7 @@ - Added Type Alias TrustedAccessRoleBindingsListResponse - Added Type Alias TrustedAccessRolesListNextResponse - Added Type Alias TrustedAccessRolesListResponse + - Added Type Alias Type - Added Type Alias UpdateMode - Interface AgentPool has a new optional parameter capacityReservationGroupID - Interface AgentPool has a new optional parameter enableCustomCATrust @@ -134,12 +158,12 @@ - Interface ContainerServiceNetworkProfile has a new optional parameter ebpfDataplane - Interface ContainerServiceNetworkProfile has a new optional parameter kubeProxyConfig - Interface ContainerServiceNetworkProfile has a new optional parameter networkPluginMode + - Interface MaintenanceConfiguration has a new optional parameter maintenanceWindow - Interface ManagedCluster has a new optional parameter azureMonitorProfile - Interface ManagedCluster has a new optional parameter creationData - Interface ManagedCluster has a new optional parameter enableNamespaceResources - Interface ManagedCluster has a new optional parameter guardrailsProfile - Interface ManagedCluster has a new optional parameter ingressProfile - - Interface ManagedCluster has a new optional parameter oidcIssuerProfile - Interface ManagedCluster has a new optional parameter workloadAutoScalerProfile - Interface ManagedClusterAgentPoolProfileProperties has a new optional parameter capacityReservationGroupID - Interface ManagedClusterAgentPoolProfileProperties has a new optional parameter enableCustomCATrust @@ -148,6 +172,7 @@ - Interface ManagedClusterAgentPoolProfileProperties has a new optional parameter windowsProfile - Interface ManagedClusterAPIServerAccessProfile has a new optional parameter enableVnetIntegration - Interface ManagedClusterAPIServerAccessProfile has a new optional parameter subnetId + - Interface ManagedClusterAutoUpgradeProfile has a new optional parameter nodeOSUpgradeChannel - Interface ManagedClusterHttpProxyConfig has a new optional parameter effectiveNoProxy - Interface ManagedClusterLoadBalancerProfile has a new optional parameter backendPoolType - Interface ManagedClustersDeleteOptionalParams has a new optional parameter ignorePodDisruptionBudget @@ -155,7 +180,6 @@ - Interface ManagedClusterSecurityProfile has a new optional parameter imageCleaner - Interface ManagedClusterSecurityProfile has a new optional parameter nodeRestriction - Interface ManagedClusterSecurityProfile has a new optional parameter workloadIdentity - - Interface ManagedClusterStorageProfile has a new optional parameter blobCSIDriver - Interface ManagedClusterStorageProfileDiskCSIDriver has a new optional parameter version - Class ContainerServiceClient has a new parameter fleetMembers - Class ContainerServiceClient has a new parameter fleets @@ -171,12 +195,37 @@ - Added Enum KnownLevel - Added Enum KnownMode - Added Enum KnownNetworkPluginMode + - Added Enum KnownNodeOSUpgradeChannel - Added Enum KnownProtocol - Added Enum KnownTrustedAccessRoleBindingProvisioningState + - Added Enum KnownType - Added Enum KnownUpdateMode + - Enum KnownManagedClusterPodIdentityProvisioningState has a new value Canceled + - Enum KnownManagedClusterPodIdentityProvisioningState has a new value Succeeded - Enum KnownOssku has a new value Mariner + - Enum KnownPrivateEndpointConnectionProvisioningState has a new value Canceled - Enum KnownPublicNetworkAccess has a new value SecuredByPerimeter - Enum KnownSnapshotType has a new value ManagedCluster + +**Breaking Changes** + + - Interface ContainerServiceClientOptionalParams no longer has parameter apiVersion + - Class ContainerServiceClient no longer has parameter apiVersion + + +## 17.2.0 (2022-11-02) + +**Features** + + - Added operation ManagedClusters.beginRotateServiceAccountSigningKeys + - Added operation ManagedClusters.beginRotateServiceAccountSigningKeysAndWait + - Added Interface ManagedClusterOidcIssuerProfile + - Added Interface ManagedClustersRotateServiceAccountSigningKeysHeaders + - Added Interface ManagedClustersRotateServiceAccountSigningKeysOptionalParams + - Added Interface ManagedClusterStorageProfileBlobCSIDriver + - Added Type Alias ManagedClustersRotateServiceAccountSigningKeysResponse + - Interface ManagedCluster has a new optional parameter oidcIssuerProfile + - Interface ManagedClusterStorageProfile has a new optional parameter blobCSIDriver ## 17.1.0 (2022-08-25) diff --git a/sdk/containerservice/arm-containerservice/_meta.json b/sdk/containerservice/arm-containerservice/_meta.json index 2890104fd8e9..b1c54678532d 100644 --- a/sdk/containerservice/arm-containerservice/_meta.json +++ b/sdk/containerservice/arm-containerservice/_meta.json @@ -1,8 +1,8 @@ { - "commit": "ae9cb5a65ff4dba1d626ed0a1bb4e94dd17583e8", + "commit": "c583b05741fadfdca116be3b9ccb1c4be8a73258", "readme": "specification/containerservice/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\containerservice\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221103.1 --generate-sample=true", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/containerservice/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.2", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221103.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.1", + "use": "@autorest/typescript@6.0.0-rc.2" } \ No newline at end of file diff --git a/sdk/containerservice/arm-containerservice/package.json b/sdk/containerservice/arm-containerservice/package.json index 19cc2539c052..d92587e86ead 100644 --- a/sdk/containerservice/arm-containerservice/package.json +++ b/sdk/containerservice/arm-containerservice/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ContainerServiceClient.", - "version": "17.2.0-beta.1", + "version": "18.0.0-beta.3", "engines": { "node": ">=14.0.0" }, @@ -11,7 +11,7 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.5.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -46,7 +46,6 @@ "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", - "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/containerservice/arm-containerservice", @@ -110,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-containerservice?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md b/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md index 65e8dd588f1e..bea6863e3719 100644 --- a/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md +++ b/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md @@ -10,6 +10,12 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; +// @public +export interface AbsoluteMonthlySchedule { + dayOfMonth: number; + intervalMonths: number; +} + // @public export interface AgentPool extends SubResource { availabilityZones?: string[]; @@ -97,11 +103,12 @@ export interface AgentPoolNetworkProfile { // @public export interface AgentPools { - abortLatestOperation(resourceGroupName: string, resourceName: string, agentPoolName: string, options?: AgentPoolsAbortLatestOperationOptionalParams): Promise; + beginAbortLatestOperation(resourceGroupName: string, resourceName: string, agentPoolName: string, options?: AgentPoolsAbortLatestOperationOptionalParams): Promise, AgentPoolsAbortLatestOperationResponse>>; + beginAbortLatestOperationAndWait(resourceGroupName: string, resourceName: string, agentPoolName: string, options?: AgentPoolsAbortLatestOperationOptionalParams): Promise; beginCreateOrUpdate(resourceGroupName: string, resourceName: string, agentPoolName: string, parameters: AgentPool, options?: AgentPoolsCreateOrUpdateOptionalParams): Promise, AgentPoolsCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, agentPoolName: string, parameters: AgentPool, options?: AgentPoolsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, resourceName: string, agentPoolName: string, options?: AgentPoolsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, resourceName: string, agentPoolName: string, options?: AgentPoolsDeleteOptionalParams): Promise; + beginDelete(resourceGroupName: string, resourceName: string, agentPoolName: string, options?: AgentPoolsDeleteOptionalParams): Promise, AgentPoolsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, resourceName: string, agentPoolName: string, options?: AgentPoolsDeleteOptionalParams): Promise; beginUpgradeNodeImageVersion(resourceGroupName: string, resourceName: string, agentPoolName: string, options?: AgentPoolsUpgradeNodeImageVersionOptionalParams): Promise, void>>; beginUpgradeNodeImageVersionAndWait(resourceGroupName: string, resourceName: string, agentPoolName: string, options?: AgentPoolsUpgradeNodeImageVersionOptionalParams): Promise; get(resourceGroupName: string, resourceName: string, agentPoolName: string, options?: AgentPoolsGetOptionalParams): Promise; @@ -110,10 +117,21 @@ export interface AgentPools { list(resourceGroupName: string, resourceName: string, options?: AgentPoolsListOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface AgentPoolsAbortLatestOperationHeaders { + azureAsyncOperation?: string; + location?: string; +} + // @public export interface AgentPoolsAbortLatestOperationOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } +// @public +export type AgentPoolsAbortLatestOperationResponse = AgentPoolsAbortLatestOperationHeaders; + // @public export interface AgentPoolsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -123,6 +141,11 @@ export interface AgentPoolsCreateOrUpdateOptionalParams extends coreClient.Opera // @public export type AgentPoolsCreateOrUpdateResponse = AgentPool; +// @public +export interface AgentPoolsDeleteHeaders { + location?: string; +} + // @public export interface AgentPoolsDeleteOptionalParams extends coreClient.OperationOptions { ignorePodDisruptionBudget?: boolean; @@ -130,6 +153,9 @@ export interface AgentPoolsDeleteOptionalParams extends coreClient.OperationOpti updateIntervalInMs?: number; } +// @public +export type AgentPoolsDeleteResponse = AgentPoolsDeleteHeaders; + // @public export interface AgentPoolsGetAvailableAgentPoolVersionsOptionalParams extends coreClient.OperationOptions { } @@ -249,8 +275,6 @@ export class ContainerServiceClient extends coreClient.ServiceClient { // (undocumented) agentPools: AgentPools; // (undocumented) - apiVersion: string; - // (undocumented) fleetMembers: FleetMembers; // (undocumented) fleets: Fleets; @@ -281,7 +305,6 @@ export class ContainerServiceClient extends coreClient.ServiceClient { // @public export interface ContainerServiceClientOptionalParams extends coreClient.ServiceClientOptions { $host?: string; - apiVersion?: string; endpoint?: string; } @@ -391,6 +414,17 @@ export interface CredentialResults { readonly kubeconfigs?: CredentialResult[]; } +// @public +export interface DailySchedule { + intervalDays: number; +} + +// @public +export interface DateSpan { + end: Date; + start: Date; +} + // @public export type EbpfDataplane = string; @@ -642,9 +676,6 @@ export type FleetsUpdateResponse = Fleet; // @public export type Format = string; -// @public -export function getContinuationToken(page: unknown): string | undefined; - // @public export type GPUInstanceProfile = string; @@ -1000,8 +1031,10 @@ export enum KnownLoadBalancerSku { // @public export enum KnownManagedClusterPodIdentityProvisioningState { Assigned = "Assigned", + Canceled = "Canceled", Deleting = "Deleting", Failed = "Failed", + Succeeded = "Succeeded", Updating = "Updating" } @@ -1046,6 +1079,14 @@ export enum KnownNetworkPolicy { Calico = "calico" } +// @public +export enum KnownNodeOSUpgradeChannel { + NodeImage = "NodeImage", + None = "None", + SecurityPatch = "SecurityPatch", + Unmanaged = "Unmanaged" +} + // @public export enum KnownOSDiskType { Ephemeral = "Ephemeral", @@ -1077,6 +1118,7 @@ export enum KnownOutboundType { // @public export enum KnownPrivateEndpointConnectionProvisioningState { + Canceled = "Canceled", Creating = "Creating", Deleting = "Deleting", Failed = "Failed", @@ -1122,12 +1164,22 @@ export enum KnownSnapshotType { // @public export enum KnownTrustedAccessRoleBindingProvisioningState { + Canceled = "Canceled", Deleting = "Deleting", Failed = "Failed", Succeeded = "Succeeded", Updating = "Updating" } +// @public +export enum KnownType { + First = "First", + Fourth = "Fourth", + Last = "Last", + Second = "Second", + Third = "Third" +} + // @public export enum KnownUpdateMode { Auto = "Auto", @@ -1199,6 +1251,7 @@ export type LoadBalancerSku = string; // @public export interface MaintenanceConfiguration extends SubResource { + maintenanceWindow?: MaintenanceWindow; notAllowedTime?: TimeSpan[]; readonly systemData?: SystemData; timeInWeek?: TimeInWeek[]; @@ -1250,6 +1303,16 @@ export interface MaintenanceConfigurationsListByManagedClusterOptionalParams ext // @public export type MaintenanceConfigurationsListByManagedClusterResponse = MaintenanceConfigurationListResult; +// @public +export interface MaintenanceWindow { + durationHours: number; + notAllowedDates?: DateSpan[]; + schedule: Schedule; + startDate?: Date; + startTime: string; + utcOffset?: string; +} + // @public export interface ManagedCluster extends TrackedResource { aadProfile?: ManagedClusterAADProfile; @@ -1401,6 +1464,7 @@ export interface ManagedClusterAPIServerAccessProfile { // @public export interface ManagedClusterAutoUpgradeProfile { + nodeOSUpgradeChannel?: NodeOSUpgradeChannel; upgradeChannel?: UpgradeChannel; } @@ -1596,25 +1660,26 @@ export interface ManagedClusterPropertiesForSnapshot { // @public export interface ManagedClusters { - abortLatestOperation(resourceGroupName: string, resourceName: string, options?: ManagedClustersAbortLatestOperationOptionalParams): Promise; + beginAbortLatestOperation(resourceGroupName: string, resourceName: string, options?: ManagedClustersAbortLatestOperationOptionalParams): Promise, ManagedClustersAbortLatestOperationResponse>>; + beginAbortLatestOperationAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersAbortLatestOperationOptionalParams): Promise; beginCreateOrUpdate(resourceGroupName: string, resourceName: string, parameters: ManagedCluster, options?: ManagedClustersCreateOrUpdateOptionalParams): Promise, ManagedClustersCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, parameters: ManagedCluster, options?: ManagedClustersCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, resourceName: string, options?: ManagedClustersDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersDeleteOptionalParams): Promise; + beginDelete(resourceGroupName: string, resourceName: string, options?: ManagedClustersDeleteOptionalParams): Promise, ManagedClustersDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersDeleteOptionalParams): Promise; beginResetAADProfile(resourceGroupName: string, resourceName: string, parameters: ManagedClusterAADProfile, options?: ManagedClustersResetAADProfileOptionalParams): Promise, void>>; beginResetAADProfileAndWait(resourceGroupName: string, resourceName: string, parameters: ManagedClusterAADProfile, options?: ManagedClustersResetAADProfileOptionalParams): Promise; beginResetServicePrincipalProfile(resourceGroupName: string, resourceName: string, parameters: ManagedClusterServicePrincipalProfile, options?: ManagedClustersResetServicePrincipalProfileOptionalParams): Promise, void>>; beginResetServicePrincipalProfileAndWait(resourceGroupName: string, resourceName: string, parameters: ManagedClusterServicePrincipalProfile, options?: ManagedClustersResetServicePrincipalProfileOptionalParams): Promise; - beginRotateClusterCertificates(resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateClusterCertificatesOptionalParams): Promise, void>>; - beginRotateClusterCertificatesAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateClusterCertificatesOptionalParams): Promise; - beginRotateServiceAccountSigningKeys(resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams): Promise, void>>; - beginRotateServiceAccountSigningKeysAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams): Promise; + beginRotateClusterCertificates(resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateClusterCertificatesOptionalParams): Promise, ManagedClustersRotateClusterCertificatesResponse>>; + beginRotateClusterCertificatesAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateClusterCertificatesOptionalParams): Promise; + beginRotateServiceAccountSigningKeys(resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams): Promise, ManagedClustersRotateServiceAccountSigningKeysResponse>>; + beginRotateServiceAccountSigningKeysAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams): Promise; beginRunCommand(resourceGroupName: string, resourceName: string, requestPayload: RunCommandRequest, options?: ManagedClustersRunCommandOptionalParams): Promise, ManagedClustersRunCommandResponse>>; beginRunCommandAndWait(resourceGroupName: string, resourceName: string, requestPayload: RunCommandRequest, options?: ManagedClustersRunCommandOptionalParams): Promise; - beginStart(resourceGroupName: string, resourceName: string, options?: ManagedClustersStartOptionalParams): Promise, void>>; - beginStartAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersStartOptionalParams): Promise; - beginStop(resourceGroupName: string, resourceName: string, options?: ManagedClustersStopOptionalParams): Promise, void>>; - beginStopAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersStopOptionalParams): Promise; + beginStart(resourceGroupName: string, resourceName: string, options?: ManagedClustersStartOptionalParams): Promise, ManagedClustersStartResponse>>; + beginStartAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersStartOptionalParams): Promise; + beginStop(resourceGroupName: string, resourceName: string, options?: ManagedClustersStopOptionalParams): Promise, ManagedClustersStopResponse>>; + beginStopAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersStopOptionalParams): Promise; beginUpdateTags(resourceGroupName: string, resourceName: string, parameters: TagsObject, options?: ManagedClustersUpdateTagsOptionalParams): Promise, ManagedClustersUpdateTagsResponse>>; beginUpdateTagsAndWait(resourceGroupName: string, resourceName: string, parameters: TagsObject, options?: ManagedClustersUpdateTagsOptionalParams): Promise; get(resourceGroupName: string, resourceName: string, options?: ManagedClustersGetOptionalParams): Promise; @@ -1630,10 +1695,21 @@ export interface ManagedClusters { listOutboundNetworkDependenciesEndpoints(resourceGroupName: string, resourceName: string, options?: ManagedClustersListOutboundNetworkDependenciesEndpointsOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface ManagedClustersAbortLatestOperationHeaders { + azureAsyncOperation?: string; + location?: string; +} + // @public export interface ManagedClustersAbortLatestOperationOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } +// @public +export type ManagedClustersAbortLatestOperationResponse = ManagedClustersAbortLatestOperationHeaders; + // @public export interface ManagedClustersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -1643,6 +1719,11 @@ export interface ManagedClustersCreateOrUpdateOptionalParams extends coreClient. // @public export type ManagedClustersCreateOrUpdateResponse = ManagedCluster; +// @public +export interface ManagedClustersDeleteHeaders { + location?: string; +} + // @public export interface ManagedClustersDeleteOptionalParams extends coreClient.OperationOptions { ignorePodDisruptionBudget?: boolean; @@ -1650,6 +1731,9 @@ export interface ManagedClustersDeleteOptionalParams extends coreClient.Operatio updateIntervalInMs?: number; } +// @public +export type ManagedClustersDeleteResponse = ManagedClustersDeleteHeaders; + // @public export interface ManagedClusterSecurityProfile { azureKeyVaultKms?: AzureKeyVaultKms; @@ -1700,6 +1784,11 @@ export interface ManagedClustersGetAccessProfileOptionalParams extends coreClien // @public export type ManagedClustersGetAccessProfileResponse = ManagedClusterAccessProfile; +// @public +export interface ManagedClustersGetCommandResultHeaders { + location?: string; +} + // @public export interface ManagedClustersGetCommandResultOptionalParams extends coreClient.OperationOptions { } @@ -1884,30 +1973,61 @@ export interface ManagedClusterSnapshotsUpdateTagsOptionalParams extends coreCli // @public export type ManagedClusterSnapshotsUpdateTagsResponse = ManagedClusterSnapshot; +// @public +export interface ManagedClustersResetAADProfileHeaders { + location?: string; +} + // @public export interface ManagedClustersResetAADProfileOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export interface ManagedClustersResetServicePrincipalProfileHeaders { + location?: string; +} + // @public export interface ManagedClustersResetServicePrincipalProfileOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export interface ManagedClustersRotateClusterCertificatesHeaders { + location?: string; +} + // @public export interface ManagedClustersRotateClusterCertificatesOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export type ManagedClustersRotateClusterCertificatesResponse = ManagedClustersRotateClusterCertificatesHeaders; + +// @public +export interface ManagedClustersRotateServiceAccountSigningKeysHeaders { + location?: string; +} + // @public export interface ManagedClustersRotateServiceAccountSigningKeysOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export type ManagedClustersRotateServiceAccountSigningKeysResponse = ManagedClustersRotateServiceAccountSigningKeysHeaders; + +// @public +export interface ManagedClustersRunCommandHeaders { + location?: string; +} + // @public export interface ManagedClustersRunCommandOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -1917,18 +2037,34 @@ export interface ManagedClustersRunCommandOptionalParams extends coreClient.Oper // @public export type ManagedClustersRunCommandResponse = RunCommandResult; +// @public +export interface ManagedClustersStartHeaders { + location?: string; +} + // @public export interface ManagedClustersStartOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export type ManagedClustersStartResponse = ManagedClustersStartHeaders; + +// @public +export interface ManagedClustersStopHeaders { + location?: string; +} + // @public export interface ManagedClustersStopOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export type ManagedClustersStopResponse = ManagedClustersStopHeaders; + // @public export interface ManagedClusterStorageProfile { blobCSIDriver?: ManagedClusterStorageProfileBlobCSIDriver; @@ -2034,6 +2170,9 @@ export interface NetworkProfileForSnapshot { networkPolicy?: NetworkPolicy; } +// @public +export type NodeOSUpgradeChannel = string; + // @public export interface OperationListResult { readonly value?: OperationValue[]; @@ -2209,6 +2348,13 @@ export type Protocol = string; // @public export type PublicNetworkAccess = string; +// @public +export interface RelativeMonthlySchedule { + dayOfWeek: WeekDay; + intervalMonths: number; + weekIndex: Type; +} + // @public export interface ResolvePrivateLinkServiceId { post(resourceGroupName: string, resourceName: string, parameters: PrivateLinkResource, options?: ResolvePrivateLinkServiceIdPostOptionalParams): Promise; @@ -2264,6 +2410,14 @@ export type ScaleSetEvictionPolicy = string; // @public export type ScaleSetPriority = string; +// @public +export interface Schedule { + absoluteMonthly?: AbsoluteMonthlySchedule; + daily?: DailySchedule; + relativeMonthly?: RelativeMonthlySchedule; + weekly?: WeeklySchedule; +} + // @public export interface Snapshot extends TrackedResource { creationData?: CreationData; @@ -2521,6 +2675,9 @@ export interface TrustedAccessRolesListOptionalParams extends coreClient.Operati // @public export type TrustedAccessRolesListResponse = TrustedAccessRoleListResult; +// @public +export type Type = string; + // @public export type UpdateMode = string; @@ -2537,6 +2694,12 @@ export interface UserAssignedIdentity { // @public export type WeekDay = string; +// @public +export interface WeeklySchedule { + dayOfWeek: WeekDay; + intervalWeeks: number; +} + // @public export interface WindowsGmsaProfile { dnsServer?: string; diff --git a/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts b/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts index c792bcce242c..ee4fa9032730 100644 --- a/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts +++ b/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts @@ -8,11 +8,6 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import { - PipelineRequest, - PipelineResponse, - SendRequest -} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, @@ -48,7 +43,6 @@ import { ContainerServiceClientOptionalParams } from "./models"; export class ContainerServiceClient extends coreClient.ServiceClient { $host: string; - apiVersion: string; subscriptionId: string; /** @@ -78,19 +72,22 @@ export class ContainerServiceClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-containerservice/17.2.0-beta.1`; + const packageDetails = `azsdk-js-arm-containerservice/18.0.0-beta.3`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } const optionsWithDefaults = { ...defaults, ...options, userAgentOptions: { userAgentPrefix }, - endpoint: + baseUri: options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); @@ -116,9 +113,7 @@ export class ContainerServiceClient extends coreClient.ServiceClient { this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, - scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + scopes: `${optionsWithDefaults.credentialScopes}`, challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge @@ -131,7 +126,6 @@ export class ContainerServiceClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-09-02-preview"; this.operations = new OperationsImpl(this); this.managedClusters = new ManagedClustersImpl(this); this.maintenanceConfigurations = new MaintenanceConfigurationsImpl(this); @@ -147,35 +141,6 @@ export class ContainerServiceClient extends coreClient.ServiceClient { this.trustedAccessRoleBindings = new TrustedAccessRoleBindingsImpl(this); this.fleets = new FleetsImpl(this); this.fleetMembers = new FleetMembersImpl(this); - this.addCustomApiVersionPolicy(options.apiVersion); - } - - /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ - private addCustomApiVersionPolicy(apiVersion?: string) { - if (!apiVersion) { - return; - } - const apiVersionPolicy = { - name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest - ): Promise { - const param = request.url.split("?"); - if (param.length > 1) { - const newParams = param[1].split("&").map((item) => { - if (item.indexOf("api-version") > -1) { - return "api-version=" + apiVersion; - } else { - return item; - } - }); - request.url = param[0] + "?" + newParams.join("&"); - } - return next(request); - } - }; - this.pipeline.addPolicy(apiVersionPolicy); } operations: Operations; diff --git a/sdk/containerservice/arm-containerservice/src/index.ts b/sdk/containerservice/arm-containerservice/src/index.ts index 8d9b9b071b00..741fa14af5e8 100644 --- a/sdk/containerservice/arm-containerservice/src/index.ts +++ b/sdk/containerservice/arm-containerservice/src/index.ts @@ -7,7 +7,6 @@ */ /// -export { getContinuationToken } from "./pagingHelper"; export * from "./models"; export { ContainerServiceClient } from "./containerServiceClient"; export * from "./operationsInterfaces"; diff --git a/sdk/containerservice/arm-containerservice/src/models/index.ts b/sdk/containerservice/arm-containerservice/src/models/index.ts index 488c339fc3af..23482670b47b 100644 --- a/sdk/containerservice/arm-containerservice/src/models/index.ts +++ b/sdk/containerservice/arm-containerservice/src/models/index.ts @@ -707,6 +707,8 @@ export interface ManagedClusterAADProfile { export interface ManagedClusterAutoUpgradeProfile { /** For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). */ upgradeChannel?: UpgradeChannel; + /** The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. */ + nodeOSUpgradeChannel?: NodeOSUpgradeChannel; } /** Parameters to be applied to the cluster-autoscaler when enabled */ @@ -1112,6 +1114,74 @@ export interface TimeSpan { end?: Date; } +/** Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. */ +export interface MaintenanceWindow { + /** Recurrence schedule for the maintenance window. */ + schedule: Schedule; + /** Length of maintenance window range from 4 to 24 hours. */ + durationHours: number; + /** The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'. */ + utcOffset?: string; + /** The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. If not specified, the maintenance window will be active right away. */ + startDate?: Date; + /** The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. */ + startTime: string; + /** Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. */ + notAllowedDates?: DateSpan[]; +} + +/** One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', 'absoluteMonthly' or 'relativeMonthly' for your maintenance schedule. */ +export interface Schedule { + /** For schedules like: 'recur every day' or 'recur every 3 days'. */ + daily?: DailySchedule; + /** For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. */ + weekly?: WeeklySchedule; + /** For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. */ + absoluteMonthly?: AbsoluteMonthlySchedule; + /** For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. */ + relativeMonthly?: RelativeMonthlySchedule; +} + +/** For schedules like: 'recur every day' or 'recur every 3 days'. */ +export interface DailySchedule { + /** Specifies the number of days between each set of occurrences. */ + intervalDays: number; +} + +/** For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. */ +export interface WeeklySchedule { + /** Specifies the number of weeks between each set of occurrences. */ + intervalWeeks: number; + /** Specifies on which day of the week the maintenance occurs. */ + dayOfWeek: WeekDay; +} + +/** For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. */ +export interface AbsoluteMonthlySchedule { + /** Specifies the number of months between each set of occurrences. */ + intervalMonths: number; + /** The date of the month. */ + dayOfMonth: number; +} + +/** For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. */ +export interface RelativeMonthlySchedule { + /** Specifies the number of months between each set of occurrences. */ + intervalMonths: number; + /** Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. */ + weekIndex: Type; + /** Specifies on which day of the week the maintenance occurs. */ + dayOfWeek: WeekDay; +} + +/** For example, between '2022-12-23' and '2023-01-05'. */ +export interface DateSpan { + /** The start date of the date span. */ + start: Date; + /** The end date of the date span. */ + end: Date; +} + /** Reference to another subresource. */ export interface SubResource { /** @@ -1680,6 +1750,8 @@ export interface MaintenanceConfiguration extends SubResource { timeInWeek?: TimeInWeek[]; /** Time slots on which upgrade is not allowed. */ notAllowedTime?: TimeSpan[]; + /** Maintenance window for the maintenance configuration. */ + maintenanceWindow?: MaintenanceWindow; } /** Agent Pool. */ @@ -1980,6 +2052,82 @@ export interface FleetMember extends AzureEntityResource { readonly provisioningState?: FleetMemberProvisioningState; } +/** Defines headers for ManagedClusters_delete operation. */ +export interface ManagedClustersDeleteHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for ManagedClusters_resetServicePrincipalProfile operation. */ +export interface ManagedClustersResetServicePrincipalProfileHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for ManagedClusters_resetAADProfile operation. */ +export interface ManagedClustersResetAADProfileHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for ManagedClusters_abortLatestOperation operation. */ +export interface ManagedClustersAbortLatestOperationHeaders { + /** URL to query for status of the operation. */ + location?: string; + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for ManagedClusters_rotateClusterCertificates operation. */ +export interface ManagedClustersRotateClusterCertificatesHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for ManagedClusters_rotateServiceAccountSigningKeys operation. */ +export interface ManagedClustersRotateServiceAccountSigningKeysHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for ManagedClusters_stop operation. */ +export interface ManagedClustersStopHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for ManagedClusters_start operation. */ +export interface ManagedClustersStartHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for ManagedClusters_runCommand operation. */ +export interface ManagedClustersRunCommandHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for ManagedClusters_getCommandResult operation. */ +export interface ManagedClustersGetCommandResultHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for AgentPools_abortLatestOperation operation. */ +export interface AgentPoolsAbortLatestOperationHeaders { + /** URL to query for status of the operation. */ + location?: string; + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for AgentPools_delete operation. */ +export interface AgentPoolsDeleteHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + /** Defines headers for AgentPools_upgradeNodeImageVersion operation. */ export interface AgentPoolsUpgradeNodeImageVersionHeaders { /** URL to query for status of the operation. */ @@ -2318,12 +2466,16 @@ export type LicenseType = string; export enum KnownManagedClusterPodIdentityProvisioningState { /** Assigned */ Assigned = "Assigned", - /** Updating */ - Updating = "Updating", + /** Canceled */ + Canceled = "Canceled", /** Deleting */ Deleting = "Deleting", /** Failed */ - Failed = "Failed" + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded", + /** Updating */ + Updating = "Updating" } /** @@ -2332,9 +2484,11 @@ export enum KnownManagedClusterPodIdentityProvisioningState { * this enum contains the known values that the service supports. * ### Known values supported by the service * **Assigned** \ - * **Updating** \ + * **Canceled** \ * **Deleting** \ - * **Failed** + * **Failed** \ + * **Succeeded** \ + * **Updating** */ export type ManagedClusterPodIdentityProvisioningState = string; @@ -2547,7 +2701,7 @@ export enum KnownUpgradeChannel { Stable = "stable", /** Automatically upgrade the cluster to the latest supported patch version when it becomes available while keeping the minor version the same. For example, if a cluster is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded to 1.17.9. */ Patch = "patch", - /** Automatically upgrade the node image to the latest version available. Microsoft provides patches and new images for image nodes frequently (usually weekly), but your running nodes won't get the new images unless you do a node image upgrade. Turning on the node-image channel will automatically update your node images whenever a new version is available. */ + /** Automatically upgrade the node image to the latest version available. Consider using nodeOSUpgradeChannel instead as that allows you to configure node OS patching separate from Kubernetes version patching */ NodeImage = "node-image", /** Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. */ None = "none" @@ -2561,11 +2715,35 @@ export enum KnownUpgradeChannel { * **rapid**: Automatically upgrade the cluster to the latest supported patch release on the latest supported minor version. In cases where the cluster is at a version of Kubernetes that is at an N-2 minor version where N is the latest supported minor version, the cluster first upgrades to the latest supported patch version on N-1 minor version. For example, if a cluster is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster first is upgraded to 1.18.6, then is upgraded to 1.19.1. \ * **stable**: Automatically upgrade the cluster to the latest supported patch release on minor version N-1, where N is the latest supported minor version. For example, if a cluster is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded to 1.18.6. \ * **patch**: Automatically upgrade the cluster to the latest supported patch version when it becomes available while keeping the minor version the same. For example, if a cluster is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded to 1.17.9. \ - * **node-image**: Automatically upgrade the node image to the latest version available. Microsoft provides patches and new images for image nodes frequently (usually weekly), but your running nodes won't get the new images unless you do a node image upgrade. Turning on the node-image channel will automatically update your node images whenever a new version is available. \ + * **node-image**: Automatically upgrade the node image to the latest version available. Consider using nodeOSUpgradeChannel instead as that allows you to configure node OS patching separate from Kubernetes version patching \ * **none**: Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. */ export type UpgradeChannel = string; +/** Known values of {@link NodeOSUpgradeChannel} that the service accepts. */ +export enum KnownNodeOSUpgradeChannel { + /** No attempt to update your machines OS will be made either by OS or by rolling VHDs. This means you are responsible for your security updates */ + None = "None", + /** OS updates will be applied automatically through the OS built-in patching infrastructure. Newly scaled in machines will be unpatched initially, and will be patched at some later time by the OS's infrastructure. Behavior of this option depends on the OS in question. Ubuntu and Mariner apply security patches through unattended upgrade roughly once a day around 06:00 UTC. Windows does not apply security patches automatically and so for them this option is equivalent to None till further notice */ + Unmanaged = "Unmanaged", + /** AKS will update the nodes VHD with patches from the image maintainer labelled "security only" on a regular basis. Where possible, patches will also be applied without reimaging to existing nodes. Some patches, such as kernel patches, cannot be applied to existing nodes without disruption. For such patches, the VHD will be updated, and machines will be rolling reimaged to that VHD following maintenance windows and surge settings. This option incurs the extra cost of hosting the VHDs in your node resource group. */ + SecurityPatch = "SecurityPatch", + /** AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes on a weekly cadence. With the VHD update machines will be rolling reimaged to that VHD following maintenance windows and surge settings. No extra VHD cost is incurred when choosing this option as AKS hosts the images. */ + NodeImage = "NodeImage" +} + +/** + * Defines values for NodeOSUpgradeChannel. \ + * {@link KnownNodeOSUpgradeChannel} can be used interchangeably with NodeOSUpgradeChannel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: No attempt to update your machines OS will be made either by OS or by rolling VHDs. This means you are responsible for your security updates \ + * **Unmanaged**: OS updates will be applied automatically through the OS built-in patching infrastructure. Newly scaled in machines will be unpatched initially, and will be patched at some later time by the OS's infrastructure. Behavior of this option depends on the OS in question. Ubuntu and Mariner apply security patches through unattended upgrade roughly once a day around 06:00 UTC. Windows does not apply security patches automatically and so for them this option is equivalent to None till further notice \ + * **SecurityPatch**: AKS will update the nodes VHD with patches from the image maintainer labelled "security only" on a regular basis. Where possible, patches will also be applied without reimaging to existing nodes. Some patches, such as kernel patches, cannot be applied to existing nodes without disruption. For such patches, the VHD will be updated, and machines will be rolling reimaged to that VHD following maintenance windows and surge settings. This option incurs the extra cost of hosting the VHDs in your node resource group. \ + * **NodeImage**: AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes on a weekly cadence. With the VHD update machines will be rolling reimaged to that VHD following maintenance windows and surge settings. No extra VHD cost is incurred when choosing this option as AKS hosts the images. + */ +export type NodeOSUpgradeChannel = string; + /** Known values of {@link Expander} that the service accepts. */ export enum KnownExpander { /** Selects the node group that will have the least idle CPU (if tied, unused memory) after scale-up. This is useful when you have different classes of nodes, for example, high CPU or high memory nodes, and only want to expand those when there are pending pods that need a lot of those resources. */ @@ -2767,16 +2945,45 @@ export enum KnownWeekDay { */ export type WeekDay = string; +/** Known values of {@link Type} that the service accepts. */ +export enum KnownType { + /** First. */ + First = "First", + /** Second. */ + Second = "Second", + /** Third. */ + Third = "Third", + /** Fourth. */ + Fourth = "Fourth", + /** Last. */ + Last = "Last" +} + +/** + * Defines values for Type. \ + * {@link KnownType} can be used interchangeably with Type, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **First**: First. \ + * **Second**: Second. \ + * **Third**: Third. \ + * **Fourth**: Fourth. \ + * **Last**: Last. + */ +export type Type = string; + /** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ export enum KnownPrivateEndpointConnectionProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", /** Creating */ Creating = "Creating", /** Deleting */ Deleting = "Deleting", /** Failed */ - Failed = "Failed" + Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded" } /** @@ -2784,10 +2991,11 @@ export enum KnownPrivateEndpointConnectionProvisioningState { * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Succeeded** \ + * **Canceled** \ * **Creating** \ * **Deleting** \ - * **Failed** + * **Failed** \ + * **Succeeded** */ export type PrivateEndpointConnectionProvisioningState = string; @@ -2835,14 +3043,16 @@ export type SnapshotType = string; /** Known values of {@link TrustedAccessRoleBindingProvisioningState} that the service accepts. */ export enum KnownTrustedAccessRoleBindingProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded", + /** Canceled */ + Canceled = "Canceled", + /** Deleting */ + Deleting = "Deleting", /** Failed */ Failed = "Failed", + /** Succeeded */ + Succeeded = "Succeeded", /** Updating */ - Updating = "Updating", - /** Deleting */ - Deleting = "Deleting" + Updating = "Updating" } /** @@ -2850,10 +3060,11 @@ export enum KnownTrustedAccessRoleBindingProvisioningState { * {@link KnownTrustedAccessRoleBindingProvisioningState} can be used interchangeably with TrustedAccessRoleBindingProvisioningState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Succeeded** \ + * **Canceled** \ + * **Deleting** \ * **Failed** \ - * **Updating** \ - * **Deleting** + * **Succeeded** \ + * **Updating** */ export type TrustedAccessRoleBindingProvisioningState = string; @@ -3592,6 +3803,9 @@ export interface ManagedClustersDeleteOptionalParams resumeFrom?: string; } +/** Contains response data for the delete operation. */ +export type ManagedClustersDeleteResponse = ManagedClustersDeleteHeaders; + /** Optional parameters. */ export interface ManagedClustersResetServicePrincipalProfileOptionalParams extends coreClient.OperationOptions { @@ -3612,7 +3826,15 @@ export interface ManagedClustersResetAADProfileOptionalParams /** Optional parameters. */ export interface ManagedClustersAbortLatestOperationOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the abortLatestOperation operation. */ +export type ManagedClustersAbortLatestOperationResponse = ManagedClustersAbortLatestOperationHeaders; /** Optional parameters. */ export interface ManagedClustersRotateClusterCertificatesOptionalParams @@ -3623,6 +3845,9 @@ export interface ManagedClustersRotateClusterCertificatesOptionalParams resumeFrom?: string; } +/** Contains response data for the rotateClusterCertificates operation. */ +export type ManagedClustersRotateClusterCertificatesResponse = ManagedClustersRotateClusterCertificatesHeaders; + /** Optional parameters. */ export interface ManagedClustersRotateServiceAccountSigningKeysOptionalParams extends coreClient.OperationOptions { @@ -3632,6 +3857,9 @@ export interface ManagedClustersRotateServiceAccountSigningKeysOptionalParams resumeFrom?: string; } +/** Contains response data for the rotateServiceAccountSigningKeys operation. */ +export type ManagedClustersRotateServiceAccountSigningKeysResponse = ManagedClustersRotateServiceAccountSigningKeysHeaders; + /** Optional parameters. */ export interface ManagedClustersStopOptionalParams extends coreClient.OperationOptions { @@ -3641,6 +3869,9 @@ export interface ManagedClustersStopOptionalParams resumeFrom?: string; } +/** Contains response data for the stop operation. */ +export type ManagedClustersStopResponse = ManagedClustersStopHeaders; + /** Optional parameters. */ export interface ManagedClustersStartOptionalParams extends coreClient.OperationOptions { @@ -3650,6 +3881,9 @@ export interface ManagedClustersStartOptionalParams resumeFrom?: string; } +/** Contains response data for the start operation. */ +export type ManagedClustersStartResponse = ManagedClustersStartHeaders; + /** Optional parameters. */ export interface ManagedClustersRunCommandOptionalParams extends coreClient.OperationOptions { @@ -3731,7 +3965,15 @@ export type MaintenanceConfigurationsListByManagedClusterNextResponse = Maintena /** Optional parameters. */ export interface AgentPoolsAbortLatestOperationOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the abortLatestOperation operation. */ +export type AgentPoolsAbortLatestOperationResponse = AgentPoolsAbortLatestOperationHeaders; /** Optional parameters. */ export interface AgentPoolsListOptionalParams @@ -3770,6 +4012,9 @@ export interface AgentPoolsDeleteOptionalParams resumeFrom?: string; } +/** Contains response data for the delete operation. */ +export type AgentPoolsDeleteResponse = AgentPoolsDeleteHeaders; + /** Optional parameters. */ export interface AgentPoolsGetUpgradeProfileOptionalParams extends coreClient.OperationOptions {} @@ -4128,8 +4373,6 @@ export interface ContainerServiceClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; - /** Api Version */ - apiVersion?: string; /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/containerservice/arm-containerservice/src/models/mappers.ts b/sdk/containerservice/arm-containerservice/src/models/mappers.ts index e3d9fa948738..8323ede79ea1 100644 --- a/sdk/containerservice/arm-containerservice/src/models/mappers.ts +++ b/sdk/containerservice/arm-containerservice/src/models/mappers.ts @@ -2042,6 +2042,12 @@ export const ManagedClusterAutoUpgradeProfile: coreClient.CompositeMapper = { type: { name: "String" } + }, + nodeOSUpgradeChannel: { + serializedName: "nodeOSUpgradeChannel", + type: { + name: "String" + } } } } @@ -3149,6 +3155,243 @@ export const TimeSpan: coreClient.CompositeMapper = { } }; +export const MaintenanceWindow: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MaintenanceWindow", + modelProperties: { + schedule: { + serializedName: "schedule", + type: { + name: "Composite", + className: "Schedule" + } + }, + durationHours: { + defaultValue: 24, + constraints: { + InclusiveMaximum: 24, + InclusiveMinimum: 4 + }, + serializedName: "durationHours", + required: true, + type: { + name: "Number" + } + }, + utcOffset: { + constraints: { + Pattern: new RegExp("^(-|\\+)[0-9]{2}:[0-9]{2}$") + }, + serializedName: "utcOffset", + type: { + name: "String" + } + }, + startDate: { + serializedName: "startDate", + type: { + name: "Date" + } + }, + startTime: { + constraints: { + Pattern: new RegExp("^\\d{2}:\\d{2}$") + }, + serializedName: "startTime", + required: true, + type: { + name: "String" + } + }, + notAllowedDates: { + serializedName: "notAllowedDates", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DateSpan" + } + } + } + } + } + } +}; + +export const Schedule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Schedule", + modelProperties: { + daily: { + serializedName: "daily", + type: { + name: "Composite", + className: "DailySchedule" + } + }, + weekly: { + serializedName: "weekly", + type: { + name: "Composite", + className: "WeeklySchedule" + } + }, + absoluteMonthly: { + serializedName: "absoluteMonthly", + type: { + name: "Composite", + className: "AbsoluteMonthlySchedule" + } + }, + relativeMonthly: { + serializedName: "relativeMonthly", + type: { + name: "Composite", + className: "RelativeMonthlySchedule" + } + } + } + } +}; + +export const DailySchedule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DailySchedule", + modelProperties: { + intervalDays: { + constraints: { + InclusiveMaximum: 7, + InclusiveMinimum: 1 + }, + serializedName: "intervalDays", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const WeeklySchedule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WeeklySchedule", + modelProperties: { + intervalWeeks: { + constraints: { + InclusiveMaximum: 4, + InclusiveMinimum: 1 + }, + serializedName: "intervalWeeks", + required: true, + type: { + name: "Number" + } + }, + dayOfWeek: { + serializedName: "dayOfWeek", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const AbsoluteMonthlySchedule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AbsoluteMonthlySchedule", + modelProperties: { + intervalMonths: { + constraints: { + InclusiveMaximum: 6, + InclusiveMinimum: 1 + }, + serializedName: "intervalMonths", + required: true, + type: { + name: "Number" + } + }, + dayOfMonth: { + constraints: { + InclusiveMaximum: 31, + InclusiveMinimum: 1 + }, + serializedName: "dayOfMonth", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const RelativeMonthlySchedule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RelativeMonthlySchedule", + modelProperties: { + intervalMonths: { + constraints: { + InclusiveMaximum: 6, + InclusiveMinimum: 1 + }, + serializedName: "intervalMonths", + required: true, + type: { + name: "Number" + } + }, + weekIndex: { + serializedName: "weekIndex", + required: true, + type: { + name: "String" + } + }, + dayOfWeek: { + serializedName: "dayOfWeek", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const DateSpan: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DateSpan", + modelProperties: { + start: { + serializedName: "start", + required: true, + type: { + name: "Date" + } + }, + end: { + serializedName: "end", + required: true, + type: { + name: "Date" + } + } + } + } +}; + export const SubResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4483,6 +4726,13 @@ export const MaintenanceConfiguration: coreClient.CompositeMapper = { } } } + }, + maintenanceWindow: { + serializedName: "properties.maintenanceWindow", + type: { + name: "Composite", + className: "MaintenanceWindow" + } } } } @@ -5280,6 +5530,198 @@ export const FleetMember: coreClient.CompositeMapper = { } }; +export const ManagedClustersDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClustersDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedClustersResetServicePrincipalProfileHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClustersResetServicePrincipalProfileHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedClustersResetAADProfileHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClustersResetAADProfileHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedClustersAbortLatestOperationHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClustersAbortLatestOperationHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedClustersRotateClusterCertificatesHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClustersRotateClusterCertificatesHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedClustersRotateServiceAccountSigningKeysHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClustersRotateServiceAccountSigningKeysHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedClustersStopHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClustersStopHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedClustersStartHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClustersStartHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedClustersRunCommandHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClustersRunCommandHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedClustersGetCommandResultHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClustersGetCommandResultHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const AgentPoolsAbortLatestOperationHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPoolsAbortLatestOperationHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const AgentPoolsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPoolsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const AgentPoolsUpgradeNodeImageVersionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/containerservice/arm-containerservice/src/models/parameters.ts b/sdk/containerservice/arm-containerservice/src/models/parameters.ts index 182341fc2715..453561d2b6a1 100644 --- a/sdk/containerservice/arm-containerservice/src/models/parameters.ts +++ b/sdk/containerservice/arm-containerservice/src/models/parameters.ts @@ -56,7 +56,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-09-02-preview", + defaultValue: "2022-10-02-preview", isConstant: true, serializedName: "api-version", type: { @@ -256,6 +256,11 @@ export const parameters4: OperationParameter = { export const agentPoolName: OperationURLParameter = { parameterPath: "agentPoolName", mapper: { + constraints: { + Pattern: new RegExp("^[a-z][a-z0-9]{0,11}$"), + MaxLength: 12, + MinLength: 1 + }, serializedName: "agentPoolName", required: true, type: { @@ -269,6 +274,17 @@ export const parameters5: OperationParameter = { mapper: AgentPoolMapper }; +export const agentPoolName1: OperationURLParameter = { + parameterPath: "agentPoolName", + mapper: { + serializedName: "agentPoolName", + required: true, + type: { + name: "String" + } + } +}; + export const privateEndpointConnectionName: OperationURLParameter = { parameterPath: "privateEndpointConnectionName", mapper: { @@ -304,7 +320,8 @@ export const trustedAccessRoleBindingName: OperationURLParameter = { parameterPath: "trustedAccessRoleBindingName", mapper: { constraints: { - MaxLength: 36, + Pattern: new RegExp("^([A-Za-z0-9-])+$"), + MaxLength: 24, MinLength: 1 }, serializedName: "trustedAccessRoleBindingName", @@ -325,6 +342,18 @@ export const parameters10: OperationParameter = { mapper: FleetMapper }; +export const apiVersion1: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-09-02-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + export const fleetName: OperationURLParameter = { parameterPath: "fleetName", mapper: { diff --git a/sdk/containerservice/arm-containerservice/src/operations/agentPools.ts b/sdk/containerservice/arm-containerservice/src/operations/agentPools.ts index ba8b3d2cbf9a..9b3cc286439d 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/agentPools.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/agentPools.ts @@ -6,8 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { AgentPools } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -19,13 +18,15 @@ import { AgentPool, AgentPoolsListNextOptionalParams, AgentPoolsListOptionalParams, - AgentPoolsListResponse, AgentPoolsAbortLatestOperationOptionalParams, + AgentPoolsAbortLatestOperationResponse, + AgentPoolsListResponse, AgentPoolsGetOptionalParams, AgentPoolsGetResponse, AgentPoolsCreateOrUpdateOptionalParams, AgentPoolsCreateOrUpdateResponse, AgentPoolsDeleteOptionalParams, + AgentPoolsDeleteResponse, AgentPoolsGetUpgradeProfileOptionalParams, AgentPoolsGetUpgradeProfileResponse, AgentPoolsGetAvailableAgentPoolVersionsOptionalParams, @@ -66,16 +67,8 @@ export class AgentPoolsImpl implements AgentPools { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - resourceGroupName, - resourceName, - options, - settings - ); + byPage: () => { + return this.listPagingPage(resourceGroupName, resourceName, options); } }; } @@ -83,18 +76,11 @@ export class AgentPoolsImpl implements AgentPools { private async *listPagingPage( resourceGroupName: string, resourceName: string, - options?: AgentPoolsListOptionalParams, - settings?: PageSettings + options?: AgentPoolsListOptionalParams ): AsyncIterableIterator { - let result: AgentPoolsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, resourceName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._list(resourceGroupName, resourceName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -103,9 +89,7 @@ export class AgentPoolsImpl implements AgentPools { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -124,25 +108,100 @@ export class AgentPoolsImpl implements AgentPools { } /** - * 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 + * Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a + * Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + * completes before cancellation can take place, an error is returned. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the managed cluster resource. * @param agentPoolName The name of the agent pool. * @param options The options parameters. */ - abortLatestOperation( + async beginAbortLatestOperation( resourceGroupName: string, resourceName: string, agentPoolName: string, options?: AgentPoolsAbortLatestOperationOptionalParams - ): Promise { - return this.client.sendOperationRequest( + ): Promise< + PollerLike< + PollOperationState, + AgentPoolsAbortLatestOperationResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { resourceGroupName, resourceName, agentPoolName, options }, abortLatestOperationOperationSpec ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a + * Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + * completes before cancellation can take place, an error is returned. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param options The options parameters. + */ + async beginAbortLatestOperationAndWait( + resourceGroupName: string, + resourceName: string, + agentPoolName: string, + options?: AgentPoolsAbortLatestOperationOptionalParams + ): Promise { + const poller = await this.beginAbortLatestOperation( + resourceGroupName, + resourceName, + agentPoolName, + options + ); + return poller.pollUntilDone(); } /** @@ -290,11 +349,16 @@ export class AgentPoolsImpl implements AgentPools { resourceName: string, agentPoolName: string, options?: AgentPoolsDeleteOptionalParams - ): Promise, void>> { + ): Promise< + PollerLike< + PollOperationState, + AgentPoolsDeleteResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( @@ -355,7 +419,7 @@ export class AgentPoolsImpl implements AgentPools { resourceName: string, agentPoolName: string, options?: AgentPoolsDeleteOptionalParams - ): Promise { + ): Promise { const poller = await this.beginDelete( resourceGroupName, resourceName, @@ -464,7 +528,8 @@ export class AgentPoolsImpl implements AgentPools { ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -521,7 +586,18 @@ const abortLatestOperationOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort", httpMethod: "POST", responses: { - 204: {}, + 200: { + headersMapper: Mappers.AgentPoolsAbortLatestOperationHeaders + }, + 201: { + headersMapper: Mappers.AgentPoolsAbortLatestOperationHeaders + }, + 202: { + headersMapper: Mappers.AgentPoolsAbortLatestOperationHeaders + }, + 204: { + headersMapper: Mappers.AgentPoolsAbortLatestOperationHeaders + }, default: { bodyMapper: Mappers.CloudError } @@ -610,7 +686,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, - Parameters.agentPoolName + Parameters.agentPoolName1 ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -621,10 +697,18 @@ const deleteOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", httpMethod: "DELETE", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + headersMapper: Mappers.AgentPoolsDeleteHeaders + }, + 201: { + headersMapper: Mappers.AgentPoolsDeleteHeaders + }, + 202: { + headersMapper: Mappers.AgentPoolsDeleteHeaders + }, + 204: { + headersMapper: Mappers.AgentPoolsDeleteHeaders + }, default: { bodyMapper: Mappers.CloudError } @@ -638,7 +722,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, - Parameters.agentPoolName + Parameters.agentPoolName1 ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/containerservice/arm-containerservice/src/operations/fleetMembers.ts b/sdk/containerservice/arm-containerservice/src/operations/fleetMembers.ts index bf6ea890bb22..2c5e40acf501 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/fleetMembers.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/fleetMembers.ts @@ -6,8 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { FleetMembers } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -19,12 +18,12 @@ import { FleetMember, FleetMembersListByFleetNextOptionalParams, FleetMembersListByFleetOptionalParams, - FleetMembersListByFleetResponse, FleetMembersCreateOrUpdateOptionalParams, FleetMembersCreateOrUpdateResponse, FleetMembersGetOptionalParams, FleetMembersGetResponse, FleetMembersDeleteOptionalParams, + FleetMembersListByFleetResponse, FleetMembersListByFleetNextResponse } from "../models"; @@ -64,15 +63,11 @@ export class FleetMembersImpl implements FleetMembers { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } + byPage: () => { return this.listByFleetPagingPage( resourceGroupName, fleetName, - options, - settings + options ); } }; @@ -81,18 +76,11 @@ export class FleetMembersImpl implements FleetMembers { private async *listByFleetPagingPage( resourceGroupName: string, fleetName: string, - options?: FleetMembersListByFleetOptionalParams, - settings?: PageSettings + options?: FleetMembersListByFleetOptionalParams ): AsyncIterableIterator { - let result: FleetMembersListByFleetResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByFleet(resourceGroupName, fleetName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listByFleet(resourceGroupName, fleetName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listByFleetNext( resourceGroupName, @@ -101,9 +89,7 @@ export class FleetMembersImpl implements FleetMembers { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -391,7 +377,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters12, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -420,7 +406,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -444,7 +430,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -467,7 +453,7 @@ const listByFleetOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -488,7 +474,7 @@ const listByFleetNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/containerservice/arm-containerservice/src/operations/fleets.ts b/sdk/containerservice/arm-containerservice/src/operations/fleets.ts index 82fb0e4b6f3b..25b8a7a30744 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/fleets.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/fleets.ts @@ -6,8 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { Fleets } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -19,10 +18,8 @@ import { Fleet, FleetsListByResourceGroupNextOptionalParams, FleetsListByResourceGroupOptionalParams, - FleetsListByResourceGroupResponse, FleetsListNextOptionalParams, FleetsListOptionalParams, - FleetsListResponse, FleetsCreateOrUpdateOptionalParams, FleetsCreateOrUpdateResponse, FleetsUpdateOptionalParams, @@ -30,6 +27,8 @@ import { FleetsGetOptionalParams, FleetsGetResponse, FleetsDeleteOptionalParams, + FleetsListByResourceGroupResponse, + FleetsListResponse, FleetsListCredentialsOptionalParams, FleetsListCredentialsResponse, FleetsListByResourceGroupNextResponse, @@ -66,33 +65,19 @@ export class FleetsImpl implements Fleets { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: FleetsListByResourceGroupOptionalParams, - settings?: PageSettings + options?: FleetsListByResourceGroupOptionalParams ): AsyncIterableIterator { - let result: FleetsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -100,9 +85,7 @@ export class FleetsImpl implements Fleets { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -133,34 +116,22 @@ export class FleetsImpl implements Fleets { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); + byPage: () => { + return this.listPagingPage(options); } }; } private async *listPagingPage( - options?: FleetsListOptionalParams, - settings?: PageSettings + options?: FleetsListOptionalParams ): AsyncIterableIterator { - let result: FleetsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -481,7 +452,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters10, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -510,7 +481,7 @@ const updateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters11, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -537,7 +508,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -560,7 +531,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -582,7 +553,7 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -603,7 +574,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -620,7 +591,7 @@ const listCredentialsOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -641,7 +612,7 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -662,7 +633,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/containerservice/arm-containerservice/src/operations/maintenanceConfigurations.ts b/sdk/containerservice/arm-containerservice/src/operations/maintenanceConfigurations.ts index 4df76f11bb1e..3ab63c2b23bb 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/maintenanceConfigurations.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/maintenanceConfigurations.ts @@ -6,8 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { MaintenanceConfigurations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -63,15 +62,11 @@ export class MaintenanceConfigurationsImpl [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } + byPage: () => { return this.listByManagedClusterPagingPage( resourceGroupName, resourceName, - options, - settings + options ); } }; @@ -80,22 +75,15 @@ export class MaintenanceConfigurationsImpl private async *listByManagedClusterPagingPage( resourceGroupName: string, resourceName: string, - options?: MaintenanceConfigurationsListByManagedClusterOptionalParams, - settings?: PageSettings + options?: MaintenanceConfigurationsListByManagedClusterOptionalParams ): AsyncIterableIterator { - let result: MaintenanceConfigurationsListByManagedClusterResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByManagedCluster( - resourceGroupName, - resourceName, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listByManagedCluster( + resourceGroupName, + resourceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listByManagedClusterNext( resourceGroupName, @@ -104,9 +92,7 @@ export class MaintenanceConfigurationsImpl options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } diff --git a/sdk/containerservice/arm-containerservice/src/operations/managedClusterSnapshots.ts b/sdk/containerservice/arm-containerservice/src/operations/managedClusterSnapshots.ts index b56e5fa00887..e6ac26542e18 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/managedClusterSnapshots.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/managedClusterSnapshots.ts @@ -6,8 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { ManagedClusterSnapshots } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -17,9 +16,9 @@ import { ManagedClusterSnapshot, ManagedClusterSnapshotsListNextOptionalParams, ManagedClusterSnapshotsListOptionalParams, - ManagedClusterSnapshotsListResponse, ManagedClusterSnapshotsListByResourceGroupNextOptionalParams, ManagedClusterSnapshotsListByResourceGroupOptionalParams, + ManagedClusterSnapshotsListResponse, ManagedClusterSnapshotsListByResourceGroupResponse, ManagedClusterSnapshotsGetOptionalParams, ManagedClusterSnapshotsGetResponse, @@ -61,34 +60,22 @@ export class ManagedClusterSnapshotsImpl implements ManagedClusterSnapshots { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); + byPage: () => { + return this.listPagingPage(options); } }; } private async *listPagingPage( - options?: ManagedClusterSnapshotsListOptionalParams, - settings?: PageSettings + options?: ManagedClusterSnapshotsListOptionalParams ): AsyncIterableIterator { - let result: ManagedClusterSnapshotsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -117,33 +104,19 @@ export class ManagedClusterSnapshotsImpl implements ManagedClusterSnapshots { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: ManagedClusterSnapshotsListByResourceGroupOptionalParams, - settings?: PageSettings + options?: ManagedClusterSnapshotsListByResourceGroupOptionalParams ): AsyncIterableIterator { - let result: ManagedClusterSnapshotsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -151,9 +124,7 @@ export class ManagedClusterSnapshotsImpl implements ManagedClusterSnapshots { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } diff --git a/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts b/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts index d9a9b7838050..67f23ea325c1 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts @@ -6,8 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { ManagedClusters } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -19,16 +18,15 @@ import { ManagedCluster, ManagedClustersListNextOptionalParams, ManagedClustersListOptionalParams, - ManagedClustersListResponse, ManagedClustersListByResourceGroupNextOptionalParams, ManagedClustersListByResourceGroupOptionalParams, - ManagedClustersListByResourceGroupResponse, OutboundEnvironmentEndpoint, ManagedClustersListOutboundNetworkDependenciesEndpointsNextOptionalParams, ManagedClustersListOutboundNetworkDependenciesEndpointsOptionalParams, - ManagedClustersListOutboundNetworkDependenciesEndpointsResponse, ManagedClustersGetOSOptionsOptionalParams, ManagedClustersGetOSOptionsResponse, + ManagedClustersListResponse, + ManagedClustersListByResourceGroupResponse, ManagedClustersGetUpgradeProfileOptionalParams, ManagedClustersGetUpgradeProfileResponse, ManagedClustersGetAccessProfileOptionalParams, @@ -47,20 +45,27 @@ import { ManagedClustersUpdateTagsOptionalParams, ManagedClustersUpdateTagsResponse, ManagedClustersDeleteOptionalParams, + ManagedClustersDeleteResponse, ManagedClusterServicePrincipalProfile, ManagedClustersResetServicePrincipalProfileOptionalParams, ManagedClusterAADProfile, ManagedClustersResetAADProfileOptionalParams, ManagedClustersAbortLatestOperationOptionalParams, + ManagedClustersAbortLatestOperationResponse, ManagedClustersRotateClusterCertificatesOptionalParams, + ManagedClustersRotateClusterCertificatesResponse, ManagedClustersRotateServiceAccountSigningKeysOptionalParams, + ManagedClustersRotateServiceAccountSigningKeysResponse, ManagedClustersStopOptionalParams, + ManagedClustersStopResponse, ManagedClustersStartOptionalParams, + ManagedClustersStartResponse, RunCommandRequest, ManagedClustersRunCommandOptionalParams, ManagedClustersRunCommandResponse, ManagedClustersGetCommandResultOptionalParams, ManagedClustersGetCommandResultResponse, + ManagedClustersListOutboundNetworkDependenciesEndpointsResponse, ManagedClustersListNextResponse, ManagedClustersListByResourceGroupNextResponse, ManagedClustersListOutboundNetworkDependenciesEndpointsNextResponse @@ -94,34 +99,22 @@ export class ManagedClustersImpl implements ManagedClusters { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); + byPage: () => { + return this.listPagingPage(options); } }; } private async *listPagingPage( - options?: ManagedClustersListOptionalParams, - settings?: PageSettings + options?: ManagedClustersListOptionalParams ): AsyncIterableIterator { - let result: ManagedClustersListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -150,33 +143,19 @@ export class ManagedClustersImpl implements ManagedClusters { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: ManagedClustersListByResourceGroupOptionalParams, - settings?: PageSettings + options?: ManagedClustersListByResourceGroupOptionalParams ): AsyncIterableIterator { - let result: ManagedClustersListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -184,9 +163,7 @@ export class ManagedClustersImpl implements ManagedClusters { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -226,15 +203,11 @@ export class ManagedClustersImpl implements ManagedClusters { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } + byPage: () => { return this.listOutboundNetworkDependenciesEndpointsPagingPage( resourceGroupName, resourceName, - options, - settings + options ); } }; @@ -243,22 +216,15 @@ export class ManagedClustersImpl implements ManagedClusters { private async *listOutboundNetworkDependenciesEndpointsPagingPage( resourceGroupName: string, resourceName: string, - options?: ManagedClustersListOutboundNetworkDependenciesEndpointsOptionalParams, - settings?: PageSettings + options?: ManagedClustersListOutboundNetworkDependenciesEndpointsOptionalParams ): AsyncIterableIterator { - let result: ManagedClustersListOutboundNetworkDependenciesEndpointsResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listOutboundNetworkDependenciesEndpoints( - resourceGroupName, - resourceName, - options - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listOutboundNetworkDependenciesEndpoints( + resourceGroupName, + resourceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listOutboundNetworkDependenciesEndpointsNext( resourceGroupName, @@ -267,9 +233,7 @@ export class ManagedClustersImpl implements ManagedClusters { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -629,11 +593,16 @@ export class ManagedClustersImpl implements ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersDeleteOptionalParams - ): Promise, void>> { + ): Promise< + PollerLike< + PollOperationState, + ManagedClustersDeleteResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( @@ -692,7 +661,7 @@ export class ManagedClustersImpl implements ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersDeleteOptionalParams - ): Promise { + ): Promise { const poller = await this.beginDelete( resourceGroupName, resourceName, @@ -760,7 +729,8 @@ export class ManagedClustersImpl implements ManagedClusters { ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -847,7 +817,8 @@ export class ManagedClustersImpl implements ManagedClusters { ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -876,24 +847,95 @@ export class ManagedClustersImpl implements ManagedClusters { } /** - * 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 + * Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to + * a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + * completes before cancellation can take place, an error is returned. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the managed cluster resource. * @param options The options parameters. */ - abortLatestOperation( + async beginAbortLatestOperation( resourceGroupName: string, resourceName: string, options?: ManagedClustersAbortLatestOperationOptionalParams - ): Promise { - return this.client.sendOperationRequest( + ): Promise< + PollerLike< + PollOperationState, + ManagedClustersAbortLatestOperationResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { resourceGroupName, resourceName, options }, abortLatestOperationOperationSpec ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to + * a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + * completes before cancellation can take place, an error is returned. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param options The options parameters. + */ + async beginAbortLatestOperationAndWait( + resourceGroupName: string, + resourceName: string, + options?: ManagedClustersAbortLatestOperationOptionalParams + ): Promise { + const poller = await this.beginAbortLatestOperation( + resourceGroupName, + resourceName, + options + ); + return poller.pollUntilDone(); } /** @@ -907,11 +949,16 @@ export class ManagedClustersImpl implements ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateClusterCertificatesOptionalParams - ): Promise, void>> { + ): Promise< + PollerLike< + PollOperationState, + ManagedClustersRotateClusterCertificatesResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( @@ -954,7 +1001,8 @@ export class ManagedClustersImpl implements ManagedClusters { ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -971,7 +1019,7 @@ export class ManagedClustersImpl implements ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateClusterCertificatesOptionalParams - ): Promise { + ): Promise { const poller = await this.beginRotateClusterCertificates( resourceGroupName, resourceName, @@ -990,11 +1038,18 @@ export class ManagedClustersImpl implements ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams - ): Promise, void>> { + ): Promise< + PollerLike< + PollOperationState< + ManagedClustersRotateServiceAccountSigningKeysResponse + >, + ManagedClustersRotateServiceAccountSigningKeysResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( @@ -1037,7 +1092,8 @@ export class ManagedClustersImpl implements ManagedClusters { ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -1053,7 +1109,7 @@ export class ManagedClustersImpl implements ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams - ): Promise { + ): Promise { const poller = await this.beginRotateServiceAccountSigningKeys( resourceGroupName, resourceName, @@ -1076,11 +1132,16 @@ export class ManagedClustersImpl implements ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersStopOptionalParams - ): Promise, void>> { + ): Promise< + PollerLike< + PollOperationState, + ManagedClustersStopResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( @@ -1123,7 +1184,8 @@ export class ManagedClustersImpl implements ManagedClusters { ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -1143,7 +1205,7 @@ export class ManagedClustersImpl implements ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersStopOptionalParams - ): Promise { + ): Promise { const poller = await this.beginStop( resourceGroupName, resourceName, @@ -1163,11 +1225,16 @@ export class ManagedClustersImpl implements ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersStartOptionalParams - ): Promise, void>> { + ): Promise< + PollerLike< + PollOperationState, + ManagedClustersStartResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( @@ -1210,7 +1277,8 @@ export class ManagedClustersImpl implements ManagedClusters { ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -1227,7 +1295,7 @@ export class ManagedClustersImpl implements ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersStartOptionalParams - ): Promise { + ): Promise { const poller = await this.beginStart( resourceGroupName, resourceName, @@ -1302,7 +1370,8 @@ export class ManagedClustersImpl implements ManagedClusters { ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -1693,10 +1762,18 @@ const deleteOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", httpMethod: "DELETE", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + headersMapper: Mappers.ManagedClustersDeleteHeaders + }, + 201: { + headersMapper: Mappers.ManagedClustersDeleteHeaders + }, + 202: { + headersMapper: Mappers.ManagedClustersDeleteHeaders + }, + 204: { + headersMapper: Mappers.ManagedClustersDeleteHeaders + }, default: { bodyMapper: Mappers.CloudError } @@ -1769,7 +1846,18 @@ const abortLatestOperationOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort", httpMethod: "POST", responses: { - 204: {}, + 200: { + headersMapper: Mappers.ManagedClustersAbortLatestOperationHeaders + }, + 201: { + headersMapper: Mappers.ManagedClustersAbortLatestOperationHeaders + }, + 202: { + headersMapper: Mappers.ManagedClustersAbortLatestOperationHeaders + }, + 204: { + headersMapper: Mappers.ManagedClustersAbortLatestOperationHeaders + }, default: { bodyMapper: Mappers.CloudError } @@ -1789,10 +1877,18 @@ const rotateClusterCertificatesOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", httpMethod: "POST", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + headersMapper: Mappers.ManagedClustersRotateClusterCertificatesHeaders + }, + 201: { + headersMapper: Mappers.ManagedClustersRotateClusterCertificatesHeaders + }, + 202: { + headersMapper: Mappers.ManagedClustersRotateClusterCertificatesHeaders + }, + 204: { + headersMapper: Mappers.ManagedClustersRotateClusterCertificatesHeaders + }, default: { bodyMapper: Mappers.CloudError } @@ -1812,10 +1908,22 @@ const rotateServiceAccountSigningKeysOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys", httpMethod: "POST", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + headersMapper: + Mappers.ManagedClustersRotateServiceAccountSigningKeysHeaders + }, + 201: { + headersMapper: + Mappers.ManagedClustersRotateServiceAccountSigningKeysHeaders + }, + 202: { + headersMapper: + Mappers.ManagedClustersRotateServiceAccountSigningKeysHeaders + }, + 204: { + headersMapper: + Mappers.ManagedClustersRotateServiceAccountSigningKeysHeaders + }, default: { bodyMapper: Mappers.CloudError } @@ -1835,10 +1943,18 @@ const stopOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop", httpMethod: "POST", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + headersMapper: Mappers.ManagedClustersStopHeaders + }, + 201: { + headersMapper: Mappers.ManagedClustersStopHeaders + }, + 202: { + headersMapper: Mappers.ManagedClustersStopHeaders + }, + 204: { + headersMapper: Mappers.ManagedClustersStopHeaders + }, default: { bodyMapper: Mappers.CloudError } @@ -1858,10 +1974,18 @@ const startOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start", httpMethod: "POST", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + headersMapper: Mappers.ManagedClustersStartHeaders + }, + 201: { + headersMapper: Mappers.ManagedClustersStartHeaders + }, + 202: { + headersMapper: Mappers.ManagedClustersStartHeaders + }, + 204: { + headersMapper: Mappers.ManagedClustersStartHeaders + }, default: { bodyMapper: Mappers.CloudError } @@ -1917,7 +2041,9 @@ const getCommandResultOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.RunCommandResult }, - 202: {}, + 202: { + headersMapper: Mappers.ManagedClustersGetCommandResultHeaders + }, default: { bodyMapper: Mappers.CloudError } diff --git a/sdk/containerservice/arm-containerservice/src/operations/operations.ts b/sdk/containerservice/arm-containerservice/src/operations/operations.ts index 91d06c477e95..4010d8bae11f 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/operations.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/operations.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -46,21 +46,16 @@ export class OperationsImpl implements Operations { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); + byPage: () => { + return this.listPagingPage(options); } }; } private async *listPagingPage( - options?: OperationsListOptionalParams, - _settings?: PageSettings + options?: OperationsListOptionalParams ): AsyncIterableIterator { - let result: OperationsListResponse; - result = await this._list(options); + let result = await this._list(options); yield result.value || []; } diff --git a/sdk/containerservice/arm-containerservice/src/operations/snapshots.ts b/sdk/containerservice/arm-containerservice/src/operations/snapshots.ts index 53201930d673..ee8bc66f14fe 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/snapshots.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/snapshots.ts @@ -6,8 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { Snapshots } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -17,9 +16,9 @@ import { Snapshot, SnapshotsListNextOptionalParams, SnapshotsListOptionalParams, - SnapshotsListResponse, SnapshotsListByResourceGroupNextOptionalParams, SnapshotsListByResourceGroupOptionalParams, + SnapshotsListResponse, SnapshotsListByResourceGroupResponse, SnapshotsGetOptionalParams, SnapshotsGetResponse, @@ -61,34 +60,22 @@ export class SnapshotsImpl implements Snapshots { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); + byPage: () => { + return this.listPagingPage(options); } }; } private async *listPagingPage( - options?: SnapshotsListOptionalParams, - settings?: PageSettings + options?: SnapshotsListOptionalParams ): AsyncIterableIterator { - let result: SnapshotsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } @@ -117,33 +104,19 @@ export class SnapshotsImpl implements Snapshots { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings - ); + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: SnapshotsListByResourceGroupOptionalParams, - settings?: PageSettings + options?: SnapshotsListByResourceGroupOptionalParams ): AsyncIterableIterator { - let result: SnapshotsListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -151,9 +124,7 @@ export class SnapshotsImpl implements Snapshots { options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } diff --git a/sdk/containerservice/arm-containerservice/src/operations/trustedAccessRoleBindings.ts b/sdk/containerservice/arm-containerservice/src/operations/trustedAccessRoleBindings.ts index 2778caac1564..d438aa167fb0 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/trustedAccessRoleBindings.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/trustedAccessRoleBindings.ts @@ -6,8 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { TrustedAccessRoleBindings } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -59,16 +58,8 @@ export class TrustedAccessRoleBindingsImpl [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - resourceGroupName, - resourceName, - options, - settings - ); + byPage: () => { + return this.listPagingPage(resourceGroupName, resourceName, options); } }; } @@ -76,18 +67,11 @@ export class TrustedAccessRoleBindingsImpl private async *listPagingPage( resourceGroupName: string, resourceName: string, - options?: TrustedAccessRoleBindingsListOptionalParams, - settings?: PageSettings + options?: TrustedAccessRoleBindingsListOptionalParams ): AsyncIterableIterator { - let result: TrustedAccessRoleBindingsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, resourceName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._list(resourceGroupName, resourceName, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -96,9 +80,7 @@ export class TrustedAccessRoleBindingsImpl options ); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } diff --git a/sdk/containerservice/arm-containerservice/src/operations/trustedAccessRoles.ts b/sdk/containerservice/arm-containerservice/src/operations/trustedAccessRoles.ts index 10f75dc67b71..f92b063034b9 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/trustedAccessRoles.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/trustedAccessRoles.ts @@ -6,8 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { TrustedAccessRoles } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -51,35 +50,23 @@ export class TrustedAccessRolesImpl implements TrustedAccessRoles { [Symbol.asyncIterator]() { return this; }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(location, options, settings); + byPage: () => { + return this.listPagingPage(location, options); } }; } private async *listPagingPage( location: string, - options?: TrustedAccessRolesListOptionalParams, - settings?: PageSettings + options?: TrustedAccessRolesListOptionalParams ): AsyncIterableIterator { - let result: TrustedAccessRolesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(location, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } + let result = await this._list(location, options); + yield result.value || []; + let continuationToken = result.nextLink; while (continuationToken) { result = await this._listNext(location, continuationToken, options); continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; + yield result.value || []; } } diff --git a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/agentPools.ts b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/agentPools.ts index 9ef428b30853..a7882b727875 100644 --- a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/agentPools.ts +++ b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/agentPools.ts @@ -12,11 +12,13 @@ import { AgentPool, AgentPoolsListOptionalParams, AgentPoolsAbortLatestOperationOptionalParams, + AgentPoolsAbortLatestOperationResponse, AgentPoolsGetOptionalParams, AgentPoolsGetResponse, AgentPoolsCreateOrUpdateOptionalParams, AgentPoolsCreateOrUpdateResponse, AgentPoolsDeleteOptionalParams, + AgentPoolsDeleteResponse, AgentPoolsGetUpgradeProfileOptionalParams, AgentPoolsGetUpgradeProfileResponse, AgentPoolsGetAvailableAgentPoolVersionsOptionalParams, @@ -39,21 +41,40 @@ export interface AgentPools { options?: AgentPoolsListOptionalParams ): PagedAsyncIterableIterator; /** - * 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 + * Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a + * Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + * completes before cancellation can take place, an error is returned. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the managed cluster resource. * @param agentPoolName The name of the agent pool. * @param options The options parameters. */ - abortLatestOperation( + beginAbortLatestOperation( resourceGroupName: string, resourceName: string, agentPoolName: string, options?: AgentPoolsAbortLatestOperationOptionalParams - ): Promise; + ): Promise< + PollerLike< + PollOperationState, + AgentPoolsAbortLatestOperationResponse + > + >; + /** + * Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a + * Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + * completes before cancellation can take place, an error is returned. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param options The options parameters. + */ + beginAbortLatestOperationAndWait( + resourceGroupName: string, + resourceName: string, + agentPoolName: string, + options?: AgentPoolsAbortLatestOperationOptionalParams + ): Promise; /** * Gets the specified managed cluster agent pool. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -114,7 +135,12 @@ export interface AgentPools { resourceName: string, agentPoolName: string, options?: AgentPoolsDeleteOptionalParams - ): Promise, void>>; + ): Promise< + PollerLike< + PollOperationState, + AgentPoolsDeleteResponse + > + >; /** * Deletes an agent pool in the specified managed cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -127,7 +153,7 @@ export interface AgentPools { resourceName: string, agentPoolName: string, options?: AgentPoolsDeleteOptionalParams - ): Promise; + ): Promise; /** * Gets the upgrade profile for an agent pool. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusters.ts b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusters.ts index 46e3c9106d03..5765b11d2892 100644 --- a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusters.ts +++ b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusters.ts @@ -34,15 +34,21 @@ import { ManagedClustersUpdateTagsOptionalParams, ManagedClustersUpdateTagsResponse, ManagedClustersDeleteOptionalParams, + ManagedClustersDeleteResponse, ManagedClusterServicePrincipalProfile, ManagedClustersResetServicePrincipalProfileOptionalParams, ManagedClusterAADProfile, ManagedClustersResetAADProfileOptionalParams, ManagedClustersAbortLatestOperationOptionalParams, + ManagedClustersAbortLatestOperationResponse, ManagedClustersRotateClusterCertificatesOptionalParams, + ManagedClustersRotateClusterCertificatesResponse, ManagedClustersRotateServiceAccountSigningKeysOptionalParams, + ManagedClustersRotateServiceAccountSigningKeysResponse, ManagedClustersStopOptionalParams, + ManagedClustersStopResponse, ManagedClustersStartOptionalParams, + ManagedClustersStartResponse, RunCommandRequest, ManagedClustersRunCommandOptionalParams, ManagedClustersRunCommandResponse, @@ -234,7 +240,12 @@ export interface ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersDeleteOptionalParams - ): Promise, void>>; + ): Promise< + PollerLike< + PollOperationState, + ManagedClustersDeleteResponse + > + >; /** * Deletes a managed cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -245,7 +256,7 @@ export interface ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersDeleteOptionalParams - ): Promise; + ): Promise; /** * This action cannot be performed on a cluster that is not using a service principal * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -299,20 +310,36 @@ export interface ManagedClusters { options?: ManagedClustersResetAADProfileOptionalParams ): Promise; /** - * 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 + * Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to + * a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + * completes before cancellation can take place, an error is returned. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the managed cluster resource. * @param options The options parameters. */ - abortLatestOperation( + beginAbortLatestOperation( resourceGroupName: string, resourceName: string, options?: ManagedClustersAbortLatestOperationOptionalParams - ): Promise; + ): Promise< + PollerLike< + PollOperationState, + ManagedClustersAbortLatestOperationResponse + > + >; + /** + * Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to + * a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + * completes before cancellation can take place, an error is returned. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param options The options parameters. + */ + beginAbortLatestOperationAndWait( + resourceGroupName: string, + resourceName: string, + options?: ManagedClustersAbortLatestOperationOptionalParams + ): Promise; /** * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more * details about rotating managed cluster certificates. @@ -324,7 +351,12 @@ export interface ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateClusterCertificatesOptionalParams - ): Promise, void>>; + ): Promise< + PollerLike< + PollOperationState, + ManagedClustersRotateClusterCertificatesResponse + > + >; /** * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more * details about rotating managed cluster certificates. @@ -336,7 +368,7 @@ export interface ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateClusterCertificatesOptionalParams - ): Promise; + ): Promise; /** * Rotates the service account signing keys of a managed cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -347,7 +379,14 @@ export interface ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams - ): Promise, void>>; + ): Promise< + PollerLike< + PollOperationState< + ManagedClustersRotateServiceAccountSigningKeysResponse + >, + ManagedClustersRotateServiceAccountSigningKeysResponse + > + >; /** * Rotates the service account signing keys of a managed cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -358,7 +397,7 @@ export interface ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams - ): Promise; + ): Promise; /** * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster * stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A @@ -373,7 +412,12 @@ export interface ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersStopOptionalParams - ): Promise, void>>; + ): Promise< + PollerLike< + PollOperationState, + ManagedClustersStopResponse + > + >; /** * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster * stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A @@ -388,7 +432,7 @@ export interface ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersStopOptionalParams - ): Promise; + ): Promise; /** * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details * about starting a cluster. @@ -400,7 +444,12 @@ export interface ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersStartOptionalParams - ): Promise, void>>; + ): Promise< + PollerLike< + PollOperationState, + ManagedClustersStartResponse + > + >; /** * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details * about starting a cluster. @@ -412,7 +461,7 @@ export interface ManagedClusters { resourceGroupName: string, resourceName: string, options?: ManagedClustersStartOptionalParams - ): Promise; + ): Promise; /** * AKS will create a pod to run the command. This is primarily useful for private clusters. For more * information see [AKS Run diff --git a/sdk/containerservice/arm-containerservice/src/pagingHelper.ts b/sdk/containerservice/arm-containerservice/src/pagingHelper.ts deleted file mode 100644 index d85fc13bce1e..000000000000 --- a/sdk/containerservice/arm-containerservice/src/pagingHelper.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export interface PageInfo { - continuationToken?: string; -} - -const pageMap = new WeakMap(); - -/** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from - * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). - */ -export function getContinuationToken(page: unknown): string | undefined { - if (typeof page !== "object" || page === null) { - return undefined; - } - return pageMap.get(page)?.continuationToken; -} - -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined -): void { - if (typeof page !== "object" || page === null || !continuationToken) { - return; - } - const pageInfo = pageMap.get(page) ?? {}; - pageInfo.continuationToken = continuationToken; - pageMap.set(page, pageInfo); -} diff --git a/sdk/containerservice/arm-containerservice/test/sampleTest.ts b/sdk/containerservice/arm-containerservice/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/containerservice/arm-containerservice/tsconfig.json b/sdk/containerservice/arm-containerservice/tsconfig.json index 5bad5556bbfd..3e6ae96443f3 100644 --- a/sdk/containerservice/arm-containerservice/tsconfig.json +++ b/sdk/containerservice/arm-containerservice/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-containerservice": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"