From d303fb004039b2d65a3b557ac38dc54aaa565bb4 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 7 Apr 2022 06:37:03 +0000 Subject: [PATCH] CodeGen from PR 18594 in Azure/azure-rest-api-specs Merge 8e666af020a879c61bca5c987087f8bbdbcdcfae into f6f757faf72ec80fd7850030b913388e86fa0e25 --- common/config/rush/pnpm-lock.yaml | 15 ++-- .../arm-containerservice/CHANGELOG.md | 20 ++--- .../arm-containerservice/README.md | 11 --- .../arm-containerservice/_meta.json | 8 +- .../arm-containerservice/package.json | 34 +++----- .../review/arm-containerservice.api.md | 22 ++++++ .../arm-containerservice/rollup.config.js | 78 +++++++++++++++++-- .../src/containerServiceClient.ts | 7 +- .../arm-containerservice/src/models/index.ts | 28 +++++++ .../src/models/mappers.ts | 75 ++++++++++++++++++ .../src/models/parameters.ts | 2 +- .../src/operations/agentPools.ts | 12 +-- .../src/operations/managedClusters.ts | 36 +++------ .../operations/privateEndpointConnections.ts | 4 +- .../arm-containerservice/test/sampleTest.ts | 48 ++++++++++++ .../arm-containerservice/tsconfig.json | 10 +-- 16 files changed, 294 insertions(+), 116 deletions(-) create mode 100644 sdk/containerservice/arm-containerservice/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 75c010ed6593..a8c2cfc02535 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -9912,28 +9912,27 @@ packages: dev: false file:projects/arm-containerservice.tgz: - resolution: {integrity: sha512-p7RNsvXGprehoIHvHB5ycGU7H32+SE9M9JPEYvwquTmgpEVh58fxHNaNbio9LCNOfSxl/1jlxIEiK56Udxpj2g==, tarball: file:projects/arm-containerservice.tgz} + resolution: {integrity: sha512-xsvax5ejhQf6od++due7jG07ThW9oVYJten5uBhVTIAsUFBcFJqWdisPQRIXccVNlJ+AP4cmE/JZeiKq/3jI0A==, tarball: file:projects/arm-containerservice.tgz} name: '@rush-temp/arm-containerservice' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.20.0 - '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 - '@rollup/plugin-json': 4.1.0_rollup@2.70.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 - '@rollup/plugin-node-resolve': 13.1.3_rollup@2.70.1 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.70.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.3 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color diff --git a/sdk/containerservice/arm-containerservice/CHANGELOG.md b/sdk/containerservice/arm-containerservice/CHANGELOG.md index cd36f3b71591..2933c36a2cd9 100644 --- a/sdk/containerservice/arm-containerservice/CHANGELOG.md +++ b/sdk/containerservice/arm-containerservice/CHANGELOG.md @@ -1,15 +1,15 @@ # Release History + +## 15.3.0 (2022-04-07) + +**Features** -## 15.2.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface ManagedClusterStorageProfile + - Added Interface ManagedClusterStorageProfileDiskCSIDriver + - Added Interface ManagedClusterStorageProfileFileCSIDriver + - Added Interface ManagedClusterStorageProfileSnapshotController + + ## 15.2.0 (2022-03-23) **Features** diff --git a/sdk/containerservice/arm-containerservice/README.md b/sdk/containerservice/arm-containerservice/README.md index e82804d19418..af59cad6e49a 100644 --- a/sdk/containerservice/arm-containerservice/README.md +++ b/sdk/containerservice/arm-containerservice/README.md @@ -16,8 +16,6 @@ The Container Service Client. - [LTS versions of Node.js](https://nodejs.org/about/releases/) - Latest versions of Safari, Chrome, Edge and Firefox. -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. - ### Prerequisites - An [Azure subscription][azure_sub]. @@ -51,17 +49,8 @@ For more information about how to create an Azure AD Application check out [this ```javascript const { ContainerServiceClient } = require("@azure/arm-containerservice"); const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ContainerServiceClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new ContainerServiceClient(credential, subscriptionId); ``` diff --git a/sdk/containerservice/arm-containerservice/_meta.json b/sdk/containerservice/arm-containerservice/_meta.json index 64d0053e6b13..e07fe0a4f01b 100644 --- a/sdk/containerservice/arm-containerservice/_meta.json +++ b/sdk/containerservice/arm-containerservice/_meta.json @@ -1,8 +1,8 @@ { - "commit": "82fdf284eea880a8e027c354911a814999a77178", + "commit": "f4136c4f461a13e3b3076ae1189b58717ebfb63f", "readme": "specification/containerservice/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\containerservice\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-beta.17 --generate-sample=true", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --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-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.0", - "use": "@autorest/typescript@6.0.0-beta.17" + "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/containerservice/arm-containerservice/package.json b/sdk/containerservice/arm-containerservice/package.json index 322ea038c04d..0a471e9ef03f 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": "15.2.1", + "version": "15.3.0", "engines": { "node": ">=12.0.0" }, @@ -29,13 +29,13 @@ "types": "./types/arm-containerservice.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.18.11", - "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-multi-entry": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.1.3", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", "mkdirp": "^1.0.4", - "rollup": "^2.66.1", - "rollup-plugin-sourcemaps": "^0.6.3", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", @@ -98,21 +98,5 @@ "docs": "echo skipped" }, "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/containerServiceClient.ts", - "prefix": "packageDetails" - } - ] - }, - "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 1f56b830651c..541e6f8b4d4a 100644 --- a/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md +++ b/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md @@ -1547,6 +1547,28 @@ export interface ManagedClustersStopOptionalParams extends coreClient.OperationO updateIntervalInMs?: number; } +// @public +export interface ManagedClusterStorageProfile { + diskCSIDriver?: ManagedClusterStorageProfileDiskCSIDriver; + fileCSIDriver?: ManagedClusterStorageProfileFileCSIDriver; + snapshotController?: ManagedClusterStorageProfileSnapshotController; +} + +// @public +export interface ManagedClusterStorageProfileDiskCSIDriver { + enabled?: boolean; +} + +// @public +export interface ManagedClusterStorageProfileFileCSIDriver { + enabled?: boolean; +} + +// @public +export interface ManagedClusterStorageProfileSnapshotController { + enabled?: boolean; +} + // @public export interface ManagedClustersUpdateTagsOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; diff --git a/sdk/containerservice/arm-containerservice/rollup.config.js b/sdk/containerservice/arm-containerservice/rollup.config.js index 3f89d7309da5..9be1955eb7f1 100644 --- a/sdk/containerservice/arm-containerservice/rollup.config.js +++ b/sdk/containerservice/arm-containerservice/rollup.config.js @@ -14,14 +14,62 @@ import json from "@rollup/plugin-json"; import nodeBuiltins from "builtin-modules"; +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + // #region Warning Handler /** - * A function that can determine whether a rollup warning should be ignored. If + * A function that can determine whether a rollupwarning should be ignored. If * the function returns `true`, then the warning will not be displayed. */ -function ignoreNiseSinonEval(warning) { +function ignoreNiseSinonEvalWarnings(warning) { return ( warning.code === "EVAL" && warning.id && @@ -30,14 +78,17 @@ function ignoreNiseSinonEval(warning) { ); } -function ignoreChaiCircularDependency(warning) { +function ignoreChaiCircularDependencyWarnings(warning) { return ( warning.code === "CIRCULAR_DEPENDENCY" && warning.importer && warning.importer.includes("node_modules/chai") === true ); } -const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; /** * Construct a warning handler for the shared rollup configuration @@ -71,7 +122,22 @@ function makeBrowserTestConfig() { nodeResolve({ mainFields: ["module", "browser"] }), - cjs(), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), json(), sourcemaps() //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) @@ -107,7 +173,7 @@ export function makeConfig(pkg, options) { ], output: { file: "dist/index.js", format: "cjs", sourcemap: true }, preserveSymlinks: false, - plugins: [sourcemaps(), nodeResolve()] + plugins: [sourcemaps(), nodeResolve(), cjs()] }; const config = [baseConfig]; diff --git a/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts b/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts index 5f83d89a8bf3..57fd83f074ed 100644 --- a/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts +++ b/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts @@ -62,7 +62,7 @@ export class ContainerServiceClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-containerservice/15.2.1`; + const packageDetails = `azsdk-js-arm-containerservice/15.3.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -77,8 +77,7 @@ export class ContainerServiceClient extends coreClient.ServiceClient { userAgentOptions: { userAgentPrefix }, - baseUri: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + baseUri: options.endpoint || "https://management.azure.com" }; super(optionsWithDefaults); // Parameter assignments @@ -86,7 +85,7 @@ export class ContainerServiceClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-02-01"; + this.apiVersion = options.apiVersion || "2022-03-01"; 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 6d06b7a79713..e0bb4b62ce6f 100644 --- a/sdk/containerservice/arm-containerservice/src/models/index.ts +++ b/sdk/containerservice/arm-containerservice/src/models/index.ts @@ -1143,6 +1143,34 @@ export interface ContainerServiceVMDiagnostics { readonly storageUri?: string; } +/** Storage profile for the container service cluster. */ +export interface ManagedClusterStorageProfile { + /** AzureDisk CSI Driver settings for the storage profile. */ + diskCSIDriver?: ManagedClusterStorageProfileDiskCSIDriver; + /** AzureFile CSI Driver settings for the storage profile. */ + fileCSIDriver?: ManagedClusterStorageProfileFileCSIDriver; + /** Snapshot Controller settings for the storage profile. */ + snapshotController?: ManagedClusterStorageProfileSnapshotController; +} + +/** AzureDisk CSI Driver settings for the storage profile. */ +export interface ManagedClusterStorageProfileDiskCSIDriver { + /** Whether to enable AzureDisk CSI Driver. The default value is true. */ + enabled?: boolean; +} + +/** AzureFile CSI Driver settings for the storage profile. */ +export interface ManagedClusterStorageProfileFileCSIDriver { + /** Whether to enable AzureFile CSI Driver. The default value is true. */ + enabled?: boolean; +} + +/** Snapshot Controller settings for the storage profile. */ +export interface ManagedClusterStorageProfileSnapshotController { + /** Whether to enable Snapshot Controller. The default value is true. */ + enabled?: boolean; +} + /** Profile for the container service agent pool. */ export type ManagedClusterAgentPoolProfile = ManagedClusterAgentPoolProfileProperties & { /** Windows agent pool names must be 6 characters or less. */ diff --git a/sdk/containerservice/arm-containerservice/src/models/mappers.ts b/sdk/containerservice/arm-containerservice/src/models/mappers.ts index 3a9ab68fc97e..6db4a6dd3f91 100644 --- a/sdk/containerservice/arm-containerservice/src/models/mappers.ts +++ b/sdk/containerservice/arm-containerservice/src/models/mappers.ts @@ -3085,6 +3085,81 @@ export const ContainerServiceVMDiagnostics: coreClient.CompositeMapper = { } }; +export const ManagedClusterStorageProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterStorageProfile", + modelProperties: { + diskCSIDriver: { + serializedName: "diskCSIDriver", + type: { + name: "Composite", + className: "ManagedClusterStorageProfileDiskCSIDriver" + } + }, + fileCSIDriver: { + serializedName: "fileCSIDriver", + type: { + name: "Composite", + className: "ManagedClusterStorageProfileFileCSIDriver" + } + }, + snapshotController: { + serializedName: "snapshotController", + type: { + name: "Composite", + className: "ManagedClusterStorageProfileSnapshotController" + } + } + } + } +}; + +export const ManagedClusterStorageProfileDiskCSIDriver: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterStorageProfileDiskCSIDriver", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ManagedClusterStorageProfileFileCSIDriver: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterStorageProfileFileCSIDriver", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ManagedClusterStorageProfileSnapshotController: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterStorageProfileSnapshotController", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + export const ManagedClusterAgentPoolProfile: 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 c28a6033f4e2..e386a546621f 100644 --- a/sdk/containerservice/arm-containerservice/src/models/parameters.ts +++ b/sdk/containerservice/arm-containerservice/src/models/parameters.ts @@ -51,7 +51,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-02-01", + defaultValue: "2022-03-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/containerservice/arm-containerservice/src/operations/agentPools.ts b/sdk/containerservice/arm-containerservice/src/operations/agentPools.ts index a369ccc10c2a..2c9321a35cf2 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/agentPools.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/agentPools.ts @@ -204,12 +204,10 @@ export class AgentPoolsImpl implements AgentPools { { resourceGroupName, resourceName, agentPoolName, parameters, options }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -294,12 +292,10 @@ export class AgentPoolsImpl implements AgentPools { { resourceGroupName, resourceName, agentPoolName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -421,12 +417,10 @@ export class AgentPoolsImpl implements AgentPools { { resourceGroupName, resourceName, agentPoolName, options }, upgradeNodeImageVersionOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** diff --git a/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts b/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts index fee316d8fce4..f7bfe538ce82 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts @@ -453,12 +453,10 @@ export class ManagedClustersImpl implements ManagedClusters { { resourceGroupName, resourceName, parameters, options }, createOrUpdateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -545,12 +543,10 @@ export class ManagedClustersImpl implements ManagedClusters { { resourceGroupName, resourceName, parameters, options }, updateTagsOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -630,12 +626,10 @@ export class ManagedClustersImpl implements ManagedClusters { { resourceGroupName, resourceName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -714,12 +708,10 @@ export class ManagedClustersImpl implements ManagedClusters { { resourceGroupName, resourceName, parameters, options }, resetServicePrincipalProfileOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -801,12 +793,10 @@ export class ManagedClustersImpl implements ManagedClusters { { resourceGroupName, resourceName, parameters, options }, resetAADProfileOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -887,12 +877,10 @@ export class ManagedClustersImpl implements ManagedClusters { { resourceGroupName, resourceName, options }, rotateClusterCertificatesOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -974,12 +962,10 @@ export class ManagedClustersImpl implements ManagedClusters { { resourceGroupName, resourceName, options }, stopOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -1061,12 +1047,10 @@ export class ManagedClustersImpl implements ManagedClusters { { resourceGroupName, resourceName, options }, startOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -1153,12 +1137,10 @@ export class ManagedClustersImpl implements ManagedClusters { { resourceGroupName, resourceName, requestPayload, options }, runCommandOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** diff --git a/sdk/containerservice/arm-containerservice/src/operations/privateEndpointConnections.ts b/sdk/containerservice/arm-containerservice/src/operations/privateEndpointConnections.ts index b79ddd490026..03c9e8935226 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/privateEndpointConnections.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/privateEndpointConnections.ts @@ -167,12 +167,10 @@ export class PrivateEndpointConnectionsImpl }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** diff --git a/sdk/containerservice/arm-containerservice/test/sampleTest.ts b/sdk/containerservice/arm-containerservice/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * 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 { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + 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" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + 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"