diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3c65773d62a2..14810af8c6b9 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -11095,7 +11095,7 @@ packages: dev: false file:projects/arm-containerservice-1.tgz: - resolution: {integrity: sha512-4rGEnPtnnvd6qO0J7GeggMeF9J4egZJXHQETtgzbj6rOZHNs0dTicn7Mj8QEAYM572CmGeh4D53ESDWzspHXFw==, tarball: file:projects/arm-containerservice-1.tgz} + resolution: {integrity: sha512-bcLRZG3rMY4v/pB1SJf+zmJnYONUusj0KIoHG97zYcu3icnX4f6saT1lnZJMOwioPSef0NRck4mtwK+RhgdzHg==, tarball: file:projects/arm-containerservice-1.tgz} name: '@rush-temp/arm-containerservice-1' version: 0.0.0 dependencies: @@ -11115,7 +11115,7 @@ packages: rollup: 2.77.2 rollup-plugin-sourcemaps: 0.6.3_rollup@2.77.2 tslib: 2.4.0 - typescript: 4.6.4 + typescript: 4.2.4 uglify-js: 3.16.3 transitivePeerDependencies: - '@types/node' diff --git a/sdk/containerservice/arm-containerservice/CHANGELOG.md b/sdk/containerservice/arm-containerservice/CHANGELOG.md index 246ab33dedc6..36510a48642c 100644 --- a/sdk/containerservice/arm-containerservice/CHANGELOG.md +++ b/sdk/containerservice/arm-containerservice/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History - -## 17.1.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 17.1.0-beta.1 (2022-07-25) + +## 17.1.0-beta.2 (2022-08-18) **Features** @@ -19,8 +9,11 @@ - 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 Interface AgentPoolsAbortLatestOperationOptionalParams - Added Interface AzureEntityResource - Added Interface ErrorAdditionalInfo - Added Interface ErrorDetail @@ -47,10 +40,15 @@ - Added Interface FleetsListNextOptionalParams - Added Interface FleetsListOptionalParams - Added Interface FleetsUpdateOptionalParams + - Added Interface ManagedClusterAzureMonitorProfile + - Added Interface ManagedClusterAzureMonitorProfileKubeStateMetrics + - Added Interface ManagedClusterAzureMonitorProfileMetrics - Added Interface ManagedClusterIngressProfile - Added Interface ManagedClusterIngressProfileWebAppRouting - Added Interface ManagedClusterOidcIssuerProfile - Added Interface ManagedClusterPropertiesForSnapshot + - Added Interface ManagedClustersAbortLatestOperationOptionalParams + - Added Interface ManagedClusterSecurityProfileImageCleaner - Added Interface ManagedClusterSecurityProfileNodeRestriction - Added Interface ManagedClusterSecurityProfileWorkloadIdentity - Added Interface ManagedClusterSnapshot @@ -67,6 +65,7 @@ - Added Interface ManagedClusterStorageProfileBlobCSIDriver - Added Interface ManagedClusterWorkloadAutoScalerProfile - Added Interface ManagedClusterWorkloadAutoScalerProfileKeda + - Added Interface ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler - Added Interface NetworkProfileForSnapshot - Added Interface TrustedAccessRole - Added Interface TrustedAccessRoleBinding @@ -80,6 +79,7 @@ - Added Interface TrustedAccessRoleRule - Added Interface TrustedAccessRolesListNextOptionalParams - Added Interface TrustedAccessRolesListOptionalParams + - Added Type Alias ControlledValues - Added Type Alias FleetMemberProvisioningState - Added Type Alias FleetMembersCreateOrUpdateResponse - Added Type Alias FleetMembersGetResponse @@ -109,11 +109,13 @@ - Added Type Alias TrustedAccessRoleBindingsListResponse - Added Type Alias TrustedAccessRolesListNextResponse - Added Type Alias TrustedAccessRolesListResponse + - Added Type Alias UpdateMode - Interface AgentPool has a new optional parameter capacityReservationGroupID - Interface AgentPool has a new optional parameter enableCustomCATrust - Interface AgentPool has a new optional parameter messageOfTheDay - Interface AgentPoolsDeleteOptionalParams has a new optional parameter ignorePodDisruptionBudget - Interface ContainerServiceNetworkProfile has a new optional parameter networkPluginMode + - 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 ingressProfile @@ -126,6 +128,7 @@ - Interface ManagedClusterAPIServerAccessProfile has a new optional parameter subnetId - Interface ManagedClusterHttpProxyConfig has a new optional parameter effectiveNoProxy - Interface ManagedClustersDeleteOptionalParams has a new optional parameter ignorePodDisruptionBudget + - 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 @@ -135,12 +138,15 @@ - Class ContainerServiceClient has a new parameter managedClusterSnapshots - Class ContainerServiceClient has a new parameter trustedAccessRoleBindings - Class ContainerServiceClient has a new parameter trustedAccessRoles + - Added Enum KnownControlledValues - Added Enum KnownFleetMemberProvisioningState - Added Enum KnownFleetProvisioningState - Added Enum KnownNetworkPluginMode - Added Enum KnownTrustedAccessRoleBindingProvisioningState + - Added Enum KnownUpdateMode - Enum KnownOssku has a new value Windows2019 - Enum KnownOssku has a new value Windows2022 + - Enum KnownPublicNetworkAccess has a new value SecuredByPerimeter - Enum KnownSnapshotType has a new value ManagedCluster diff --git a/sdk/containerservice/arm-containerservice/_meta.json b/sdk/containerservice/arm-containerservice/_meta.json index bdb55b5bb107..ab8e9532c41d 100644 --- a/sdk/containerservice/arm-containerservice/_meta.json +++ b/sdk/containerservice/arm-containerservice/_meta.json @@ -1,8 +1,8 @@ { - "commit": "405811c51aa09803caedfe17fd305e110db1ca5e", + "commit": "7a2aa128581acaf122fcd2bda013f89aa1ecd916", "readme": "specification/containerservice/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --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.1.20220720.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.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.0", - "use": "@autorest/typescript@6.0.0-rc.1.20220720.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", + "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/containerservice/arm-containerservice/package.json b/sdk/containerservice/arm-containerservice/package.json index 26c6e8c21d94..ac9b9314c86d 100644 --- a/sdk/containerservice/arm-containerservice/package.json +++ b/sdk/containerservice/arm-containerservice/package.json @@ -36,7 +36,7 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.6.0", + "typescript": "~4.2.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", @@ -109,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 c247d741fe8f..6a3923871671 100644 --- a/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md +++ b/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md @@ -88,6 +88,7 @@ export type AgentPoolMode = string; // @public export interface AgentPools { + abortLatestOperation(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>>; @@ -100,6 +101,10 @@ export interface AgentPools { list(resourceGroupName: string, resourceName: string, options?: AgentPoolsListOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface AgentPoolsAbortLatestOperationOptionalParams extends coreClient.OperationOptions { +} + // @public export interface AgentPoolsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -327,6 +332,9 @@ export interface ContainerServiceVMDiagnostics { // @public export type ContainerServiceVMSizeTypes = string; +// @public +export type ControlledValues = string; + // @public export type Count = 1 | 3 | 5; @@ -804,6 +812,12 @@ export enum KnownContainerServiceVMSizeTypes { StandardNV6 = "Standard_NV6" } +// @public +export enum KnownControlledValues { + RequestsAndLimits = "RequestsAndLimits", + RequestsOnly = "RequestsOnly" +} + // @public export enum KnownCreatedByType { Application = "Application", @@ -972,7 +986,8 @@ export enum KnownPrivateEndpointConnectionProvisioningState { // @public export enum KnownPublicNetworkAccess { Disabled = "Disabled", - Enabled = "Enabled" + Enabled = "Enabled", + SecuredByPerimeter = "SecuredByPerimeter" } // @public @@ -1007,6 +1022,14 @@ export enum KnownTrustedAccessRoleBindingProvisioningState { Updating = "Updating" } +// @public +export enum KnownUpdateMode { + Auto = "Auto", + Initial = "Initial", + Off = "Off", + Recreate = "Recreate" +} + // @public export enum KnownUpgradeChannel { NodeImage = "node-image", @@ -1128,6 +1151,7 @@ export interface ManagedCluster extends TrackedResource { apiServerAccessProfile?: ManagedClusterAPIServerAccessProfile; autoScalerProfile?: ManagedClusterPropertiesAutoScalerProfile; autoUpgradeProfile?: ManagedClusterAutoUpgradeProfile; + azureMonitorProfile?: ManagedClusterAzureMonitorProfile; readonly azurePortalFqdn?: string; creationData?: CreationData; readonly currentKubernetesVersion?: string; @@ -1268,6 +1292,23 @@ export interface ManagedClusterAutoUpgradeProfile { upgradeChannel?: UpgradeChannel; } +// @public +export interface ManagedClusterAzureMonitorProfile { + metrics?: ManagedClusterAzureMonitorProfileMetrics; +} + +// @public +export interface ManagedClusterAzureMonitorProfileKubeStateMetrics { + metricAnnotationsAllowList?: string; + metricLabelsAllowlist?: string; +} + +// @public +export interface ManagedClusterAzureMonitorProfileMetrics { + enabled: boolean; + kubeStateMetrics?: ManagedClusterAzureMonitorProfileKubeStateMetrics; +} + // @public export interface ManagedClusterHttpProxyConfig { readonly effectiveNoProxy?: string[]; @@ -1442,6 +1483,7 @@ export interface ManagedClusterPropertiesForSnapshot { // @public export interface ManagedClusters { + abortLatestOperation(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>>; @@ -1475,6 +1517,10 @@ export interface ManagedClusters { listOutboundNetworkDependenciesEndpoints(resourceGroupName: string, resourceName: string, options?: ManagedClustersListOutboundNetworkDependenciesEndpointsOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface ManagedClustersAbortLatestOperationOptionalParams extends coreClient.OperationOptions { +} + // @public export interface ManagedClustersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -1495,6 +1541,7 @@ export interface ManagedClustersDeleteOptionalParams extends coreClient.Operatio export interface ManagedClusterSecurityProfile { azureKeyVaultKms?: AzureKeyVaultKms; defender?: ManagedClusterSecurityProfileDefender; + imageCleaner?: ManagedClusterSecurityProfileImageCleaner; nodeRestriction?: ManagedClusterSecurityProfileNodeRestriction; workloadIdentity?: ManagedClusterSecurityProfileWorkloadIdentity; } @@ -1510,6 +1557,12 @@ export interface ManagedClusterSecurityProfileDefenderSecurityMonitoring { enabled?: boolean; } +// @public +export interface ManagedClusterSecurityProfileImageCleaner { + enabled?: boolean; + intervalHours?: number; +} + // @public export interface ManagedClusterSecurityProfileNodeRestriction { enabled?: boolean; @@ -1821,6 +1874,8 @@ export interface ManagedClusterWindowsProfile { // @public export interface ManagedClusterWorkloadAutoScalerProfile { keda?: ManagedClusterWorkloadAutoScalerProfileKeda; + // (undocumented) + verticalPodAutoscaler?: ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler; } // @public @@ -1828,6 +1883,13 @@ export interface ManagedClusterWorkloadAutoScalerProfileKeda { enabled: boolean; } +// @public (undocumented) +export interface ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler { + controlledValues: ControlledValues; + enabled: boolean; + updateMode: UpdateMode; +} + // @public (undocumented) export interface ManagedServiceIdentityUserAssignedIdentitiesValue { readonly clientId?: string; @@ -2332,6 +2394,9 @@ export interface TrustedAccessRolesListOptionalParams extends coreClient.Operati // @public export type TrustedAccessRolesListResponse = TrustedAccessRoleListResult; +// @public +export type UpdateMode = string; + // @public export type UpgradeChannel = string; diff --git a/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts b/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts index b349ba1cff98..c845764abdcd 100644 --- a/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts +++ b/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts @@ -98,41 +98,34 @@ export class ContainerServiceClient extends coreClient.ServiceClient { }; super(optionsWithDefaults); - let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - } - if ( - !options || - !options.pipeline || - options.pipeline.getOrderedPolicies().length == 0 || - !bearerTokenAuthenticationPolicyFound - ) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential: credentials, - scopes: `${optionsWithDefaults.credentialScopes}`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); + if (!bearerTokenAuthenticationPolicyFound) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + scopes: `${optionsWithDefaults.baseUri}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } } // Parameter assignments this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-06-02-preview"; + this.apiVersion = options.apiVersion || "2022-07-02-preview"; this.operations = new OperationsImpl(this); this.managedClusters = new ManagedClustersImpl(this); this.maintenanceConfigurations = new MaintenanceConfigurationsImpl(this); diff --git a/sdk/containerservice/arm-containerservice/src/models/index.ts b/sdk/containerservice/arm-containerservice/src/models/index.ts index 78279b36753c..1f86b9933f3b 100644 --- a/sdk/containerservice/arm-containerservice/src/models/index.ts +++ b/sdk/containerservice/arm-containerservice/src/models/index.ts @@ -743,6 +743,8 @@ export interface ManagedClusterSecurityProfile { azureKeyVaultKms?: AzureKeyVaultKms; /** [Workload Identity](https://azure.github.io/azure-workload-identity/docs/) settings for the security profile. */ workloadIdentity?: ManagedClusterSecurityProfileWorkloadIdentity; + /** ImageCleaner settings for the security profile. */ + imageCleaner?: ManagedClusterSecurityProfileImageCleaner; /** [Node Restriction](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#noderestriction) settings for the security profile. */ nodeRestriction?: ManagedClusterSecurityProfileNodeRestriction; } @@ -779,6 +781,14 @@ export interface ManagedClusterSecurityProfileWorkloadIdentity { enabled?: boolean; } +/** ImageCleaner removes unused images from nodes, freeing up disk space and helping to reduce attack surface area. Here are settings for the security profile. */ +export interface ManagedClusterSecurityProfileImageCleaner { + /** Whether to enable ImageCleaner on AKS cluster. */ + enabled?: boolean; + /** ImageCleaner scanning interval. */ + intervalHours?: number; +} + /** Node Restriction settings for the security profile. */ export interface ManagedClusterSecurityProfileNodeRestriction { /** Whether to enable Node Restriction */ @@ -841,6 +851,7 @@ export interface ManagedClusterIngressProfileWebAppRouting { export interface ManagedClusterWorkloadAutoScalerProfile { /** KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. */ keda?: ManagedClusterWorkloadAutoScalerProfileKeda; + verticalPodAutoscaler?: ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler; } /** KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. */ @@ -849,6 +860,37 @@ export interface ManagedClusterWorkloadAutoScalerProfileKeda { enabled: boolean; } +export interface ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler { + /** Whether to enable VPA. Default value is false. */ + enabled: boolean; + /** Controls which resource value autoscaler will change. Default value is RequestsAndLimits. */ + controlledValues: ControlledValues; + /** Each update mode level is a superset of the lower levels. Off { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, agentPoolName, options }, + abortLatestOperationOperationSpec + ); + } + /** * Gets a list of agent pools in the specified managed cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -475,6 +498,27 @@ export class AgentPoolsImpl implements AgentPools { // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const abortLatestOperationOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort", + httpMethod: "POST", + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.agentPoolName + ], + headerParameters: [Parameters.accept], + serializer +}; const listOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools", @@ -611,6 +655,9 @@ const getAvailableAgentPoolVersionsOperationSpec: coreClient.OperationSpec = { responses: { 200: { bodyMapper: Mappers.AgentPoolAvailableVersions + }, + default: { + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], diff --git a/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts b/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts index d5c53c65fd5b..7366d18f574e 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts @@ -49,6 +49,7 @@ import { ManagedClustersResetServicePrincipalProfileOptionalParams, ManagedClusterAADProfile, ManagedClustersResetAADProfileOptionalParams, + ManagedClustersAbortLatestOperationOptionalParams, ManagedClustersRotateClusterCertificatesOptionalParams, ManagedClustersRotateServiceAccountSigningKeysOptionalParams, ManagedClustersStopOptionalParams, @@ -832,6 +833,27 @@ export class ManagedClustersImpl implements ManagedClusters { return poller.pollUntilDone(); } + /** + * 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 + * @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( + resourceGroupName: string, + resourceName: string, + options?: ManagedClustersAbortLatestOperationOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + abortLatestOperationOperationSpec + ); + } + /** * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more * details about rotating managed cluster certificates. @@ -1700,6 +1722,26 @@ const resetAADProfileOperationSpec: coreClient.OperationSpec = { mediaType: "json", serializer }; +const abortLatestOperationOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort", + httpMethod: "POST", + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; const rotateClusterCertificatesOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", diff --git a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/agentPools.ts b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/agentPools.ts index 4e16d6840a5d..9ef428b30853 100644 --- a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/agentPools.ts +++ b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/agentPools.ts @@ -11,6 +11,7 @@ import { PollerLike, PollOperationState } from "@azure/core-lro"; import { AgentPool, AgentPoolsListOptionalParams, + AgentPoolsAbortLatestOperationOptionalParams, AgentPoolsGetOptionalParams, AgentPoolsGetResponse, AgentPoolsCreateOrUpdateOptionalParams, @@ -37,6 +38,22 @@ export interface AgentPools { resourceName: string, 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 + * @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( + 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. diff --git a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusters.ts b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusters.ts index 5d7cb831a154..46e3c9106d03 100644 --- a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusters.ts +++ b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusters.ts @@ -38,6 +38,7 @@ import { ManagedClustersResetServicePrincipalProfileOptionalParams, ManagedClusterAADProfile, ManagedClustersResetAADProfileOptionalParams, + ManagedClustersAbortLatestOperationOptionalParams, ManagedClustersRotateClusterCertificatesOptionalParams, ManagedClustersRotateServiceAccountSigningKeysOptionalParams, ManagedClustersStopOptionalParams, @@ -297,6 +298,21 @@ export interface ManagedClusters { parameters: ManagedClusterAADProfile, 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 + * @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( + 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. 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"