From 5128af92a530c0d6eb878b005d5bfc9d88b08980 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 6 Apr 2022 09:51:05 +0000 Subject: [PATCH] CodeGen from PR 18568 in Azure/azure-rest-api-specs Merge 5e717894c3bb5fa66a9a38a8e2b1a25a4f2fdb6f into f6f757faf72ec80fd7850030b913388e86fa0e25 --- common/config/rush/pnpm-lock.yaml | 15 +- .../arm-containerservice/CHANGELOG.md | 24 +- .../arm-containerservice/README.md | 11 - .../arm-containerservice/_meta.json | 8 +- .../arm-containerservice/package.json | 34 +- .../review/arm-containerservice.api.md | 18 +- .../arm-containerservice/rollup.config.js | 78 +- .../src/containerServiceClient.ts | 7 +- .../arm-containerservice/src/models/index.ts | 220 +++--- .../src/models/mappers.ts | 742 +++++++++--------- .../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, 674 insertions(+), 595 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 a119dfec29ba..76de6c6bcd0b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10181,28 +10181,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.19.4 - '@rollup/plugin-commonjs': 21.0.1_rollup@2.67.1 - '@rollup/plugin-json': 4.1.0_rollup@2.67.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.67.1 - '@rollup/plugin-node-resolve': 13.1.3_rollup@2.67.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.67.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.67.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.1 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..d95abc5f863f 100644 --- a/sdk/containerservice/arm-containerservice/CHANGELOG.md +++ b/sdk/containerservice/arm-containerservice/CHANGELOG.md @@ -1,15 +1,23 @@ # Release History + +## 16.0.0 (2022-04-06) + +**Features** -## 15.2.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added Type Alias TrackedResource + - Add parameters of TrackedResource to TypeAlias ManagedCluster + - Add parameters of TrackedResource to TypeAlias ManagedClusterAccessProfile + - Add parameters of TrackedResource to TypeAlias Snapshot -### Other Changes +**Breaking Changes** + - Interface Resource no longer has parameter location + - Interface Resource no longer has parameter tags + - Delete parameters of Resource in TypeAlias ManagedCluster + - Delete parameters of Resource in TypeAlias ManagedClusterAccessProfile + - Delete parameters of Resource in TypeAlias Snapshot + + ## 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..b3dd8817607a 100644 --- a/sdk/containerservice/arm-containerservice/_meta.json +++ b/sdk/containerservice/arm-containerservice/_meta.json @@ -1,8 +1,8 @@ { - "commit": "82fdf284eea880a8e027c354911a814999a77178", + "commit": "f636f937c69c66d8052e42b85dec00afd4cb17a2", "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..7fcd24875a39 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": "16.0.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..39eaa3993046 100644 --- a/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md +++ b/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md @@ -1048,7 +1048,7 @@ export interface MaintenanceConfigurationsListByManagedClusterOptionalParams ext export type MaintenanceConfigurationsListByManagedClusterResponse = MaintenanceConfigurationListResult; // @public -export type ManagedCluster = Resource & { +export type ManagedCluster = TrackedResource & { sku?: ManagedClusterSKU; extendedLocation?: ExtendedLocation; identity?: ManagedClusterIdentity; @@ -1100,7 +1100,7 @@ export interface ManagedClusterAADProfile { } // @public -export type ManagedClusterAccessProfile = Resource & { +export type ManagedClusterAccessProfile = TrackedResource & { kubeConfig?: Uint8Array; }; @@ -1769,12 +1769,8 @@ export type ResolvePrivateLinkServiceIdPostResponse = PrivateLinkResource; // @public export interface Resource { readonly id?: string; - location: string; readonly name?: string; readonly systemData?: SystemData; - tags?: { - [propertyName: string]: string; - }; readonly type?: string; } @@ -1814,7 +1810,7 @@ export type ScaleSetEvictionPolicy = string; export type ScaleSetPriority = string; // @public -export type Snapshot = Resource & { +export type Snapshot = TrackedResource & { creationData?: CreationData; snapshotType?: SnapshotType; readonly kubernetesVersion?: string; @@ -1965,6 +1961,14 @@ export interface TimeSpan { start?: Date; } +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + // @public export type UpgradeChannel = 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..59a79784b9c5 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/16.0.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..c45f3108a17a 100644 --- a/sdk/containerservice/arm-containerservice/src/models/index.ts +++ b/sdk/containerservice/arm-containerservice/src/models/index.ts @@ -736,10 +736,6 @@ export interface Resource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; - /** Resource location */ - location: string; - /** Resource tags */ - tags?: { [propertyName: string]: string }; } /** Metadata pertaining to creation and last modification of the resource. */ @@ -1152,8 +1148,117 @@ export type ManagedClusterAgentPoolProfile = ManagedClusterAgentPoolProfilePrope /** Information of user assigned identity used by this add-on. */ export type ManagedClusterAddonProfileIdentity = UserAssignedIdentity & {}; +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned maintenance. */ +export type MaintenanceConfiguration = SubResource & { + /** + * The system metadata relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. */ + timeInWeek?: TimeInWeek[]; + /** Time slots on which upgrade is not allowed. */ + notAllowedTime?: TimeSpan[]; +}; + +/** Agent Pool. */ +export type AgentPool = SubResource & { + /** Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. */ + count?: number; + /** VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions */ + vmSize?: string; + /** OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. */ + osDiskSizeGB?: number; + /** The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). */ + osDiskType?: OSDiskType; + /** Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. */ + kubeletDiskType?: KubeletDiskType; + /** Determines the type of workload a node can run. */ + workloadRuntime?: WorkloadRuntime; + /** If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} */ + vnetSubnetID?: string; + /** If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} */ + podSubnetID?: string; + /** The maximum number of pods that can run on a node. */ + maxPods?: number; + /** The operating system type. The default is Linux. */ + osType?: OSType; + /** Specifies an OS SKU. This value must not be specified if OSType is Windows. */ + osSKU?: Ossku; + /** The maximum number of nodes for auto-scaling */ + maxCount?: number; + /** The minimum number of nodes for auto-scaling */ + minCount?: number; + /** Whether to enable auto-scaler */ + enableAutoScaling?: boolean; + /** This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. */ + scaleDownMode?: ScaleDownMode; + /** The type of Agent Pool. */ + typePropertiesType?: AgentPoolType; + /** A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools */ + mode?: AgentPoolMode; + /** As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). */ + orchestratorVersion?: string; + /** + * The version of node image + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nodeImageVersion?: string; + /** Settings for upgrading the agentpool */ + upgradeSettings?: AgentPoolUpgradeSettings; + /** + * The current deployment or provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded */ + powerState?: PowerState; + /** The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. */ + availabilityZones?: string[]; + /** Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. */ + enableNodePublicIP?: boolean; + /** This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} */ + nodePublicIPPrefixID?: string; + /** The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. */ + scaleSetPriority?: ScaleSetPriority; + /** This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. */ + scaleSetEvictionPolicy?: ScaleSetEvictionPolicy; + /** Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) */ + spotMaxPrice?: number; + /** The tags to be persisted on the agent pool virtual machine scale set. */ + tags?: { [propertyName: string]: string }; + /** The node labels to be persisted across all nodes in agent pool. */ + nodeLabels?: { [propertyName: string]: string }; + /** The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. */ + nodeTaints?: string[]; + /** The ID for Proximity Placement Group. */ + proximityPlacementGroupID?: string; + /** The Kubelet configuration on the agent pool nodes. */ + kubeletConfig?: KubeletConfig; + /** The OS configuration of Linux agent nodes. */ + linuxOSConfig?: LinuxOSConfig; + /** This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption */ + enableEncryptionAtHost?: boolean; + /** Whether to enable UltraSSD */ + enableUltraSSD?: boolean; + /** See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. */ + enableFips?: boolean; + /** GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. */ + gpuInstanceProfile?: GPUInstanceProfile; + /** CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. */ + creationData?: CreationData; +}; + /** Managed cluster. */ -export type ManagedCluster = Resource & { +export type ManagedCluster = TrackedResource & { /** The managed cluster SKU. */ sku?: ManagedClusterSKU; /** The extended location of the Virtual Machine. */ @@ -1241,13 +1346,13 @@ export type ManagedCluster = Resource & { }; /** Managed cluster Access Profile. */ -export type ManagedClusterAccessProfile = Resource & { +export type ManagedClusterAccessProfile = TrackedResource & { /** Base64-encoded Kubernetes configuration file. */ kubeConfig?: Uint8Array; }; /** A node pool snapshot resource. */ -export type Snapshot = Resource & { +export type Snapshot = TrackedResource & { /** CreationData to be used to specify the source agent pool resource ID to create this snapshot. */ creationData?: CreationData; /** The type of a snapshot. The default is NodePool. */ @@ -1284,107 +1389,6 @@ export type Snapshot = Resource & { readonly enableFips?: boolean; }; -/** See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned maintenance. */ -export type MaintenanceConfiguration = SubResource & { - /** - * The system metadata relating to this resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; - /** If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. */ - timeInWeek?: TimeInWeek[]; - /** Time slots on which upgrade is not allowed. */ - notAllowedTime?: TimeSpan[]; -}; - -/** Agent Pool. */ -export type AgentPool = SubResource & { - /** Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. */ - count?: number; - /** VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions */ - vmSize?: string; - /** OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. */ - osDiskSizeGB?: number; - /** The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). */ - osDiskType?: OSDiskType; - /** Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. */ - kubeletDiskType?: KubeletDiskType; - /** Determines the type of workload a node can run. */ - workloadRuntime?: WorkloadRuntime; - /** If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} */ - vnetSubnetID?: string; - /** If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} */ - podSubnetID?: string; - /** The maximum number of pods that can run on a node. */ - maxPods?: number; - /** The operating system type. The default is Linux. */ - osType?: OSType; - /** Specifies an OS SKU. This value must not be specified if OSType is Windows. */ - osSKU?: Ossku; - /** The maximum number of nodes for auto-scaling */ - maxCount?: number; - /** The minimum number of nodes for auto-scaling */ - minCount?: number; - /** Whether to enable auto-scaler */ - enableAutoScaling?: boolean; - /** This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. */ - scaleDownMode?: ScaleDownMode; - /** The type of Agent Pool. */ - typePropertiesType?: AgentPoolType; - /** A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools */ - mode?: AgentPoolMode; - /** As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). */ - orchestratorVersion?: string; - /** - * The version of node image - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nodeImageVersion?: string; - /** Settings for upgrading the agentpool */ - upgradeSettings?: AgentPoolUpgradeSettings; - /** - * The current deployment or provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded */ - powerState?: PowerState; - /** The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. */ - availabilityZones?: string[]; - /** Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. */ - enableNodePublicIP?: boolean; - /** This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} */ - nodePublicIPPrefixID?: string; - /** The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. */ - scaleSetPriority?: ScaleSetPriority; - /** This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. */ - scaleSetEvictionPolicy?: ScaleSetEvictionPolicy; - /** Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) */ - spotMaxPrice?: number; - /** The tags to be persisted on the agent pool virtual machine scale set. */ - tags?: { [propertyName: string]: string }; - /** The node labels to be persisted across all nodes in agent pool. */ - nodeLabels?: { [propertyName: string]: string }; - /** The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. */ - nodeTaints?: string[]; - /** The ID for Proximity Placement Group. */ - proximityPlacementGroupID?: string; - /** The Kubelet configuration on the agent pool nodes. */ - kubeletConfig?: KubeletConfig; - /** The OS configuration of Linux agent nodes. */ - linuxOSConfig?: LinuxOSConfig; - /** This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption */ - enableEncryptionAtHost?: boolean; - /** Whether to enable UltraSSD */ - enableUltraSSD?: boolean; - /** See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. */ - enableFips?: boolean; - /** GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. */ - gpuInstanceProfile?: GPUInstanceProfile; - /** CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. */ - creationData?: CreationData; -}; - /** Defines headers for AgentPools_upgradeNodeImageVersion operation. */ export interface AgentPoolsUpgradeNodeImageVersionHeaders { /** URL to query for status of the operation. */ diff --git a/sdk/containerservice/arm-containerservice/src/models/mappers.ts b/sdk/containerservice/arm-containerservice/src/models/mappers.ts index 3a9ab68fc97e..ddac4bd4faa0 100644 --- a/sdk/containerservice/arm-containerservice/src/models/mappers.ts +++ b/sdk/containerservice/arm-containerservice/src/models/mappers.ts @@ -2091,20 +2091,6 @@ export const Resource: coreClient.CompositeMapper = { name: "Composite", className: "SystemData" } - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } } } } @@ -3115,642 +3101,666 @@ export const ManagedClusterAddonProfileIdentity: coreClient.CompositeMapper = { } }; -export const ManagedCluster: coreClient.CompositeMapper = { +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagedCluster", + className: "TrackedResource", modelProperties: { ...Resource.type.modelProperties, - sku: { - serializedName: "sku", + tags: { + serializedName: "tags", type: { - name: "Composite", - className: "ManagedClusterSKU" + name: "Dictionary", + value: { type: { name: "String" } } } }, - extendedLocation: { - serializedName: "extendedLocation", + location: { + serializedName: "location", + required: true, type: { - name: "Composite", - className: "ExtendedLocation" + name: "String" } - }, - identity: { - serializedName: "identity", + } + } + } +}; + +export const MaintenanceConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MaintenanceConfiguration", + modelProperties: { + ...SubResource.type.modelProperties, + systemData: { + serializedName: "systemData", type: { name: "Composite", - className: "ManagedClusterIdentity" + className: "SystemData" } }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, + timeInWeek: { + serializedName: "properties.timeInWeek", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TimeInWeek" + } + } } }, - powerState: { - serializedName: "properties.powerState", + notAllowedTime: { + serializedName: "properties.notAllowedTime", type: { - name: "Composite", - className: "PowerState" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TimeSpan" + } + } } - }, - maxAgentPools: { - serializedName: "properties.maxAgentPools", - readOnly: true, + } + } + } +}; + +export const AgentPool: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPool", + modelProperties: { + ...SubResource.type.modelProperties, + count: { + serializedName: "properties.count", type: { name: "Number" } }, - kubernetesVersion: { - serializedName: "properties.kubernetesVersion", + vmSize: { + serializedName: "properties.vmSize", type: { name: "String" } }, - dnsPrefix: { - serializedName: "properties.dnsPrefix", + osDiskSizeGB: { + constraints: { + InclusiveMaximum: 2048, + InclusiveMinimum: 0 + }, + serializedName: "properties.osDiskSizeGB", type: { - name: "String" + name: "Number" } }, - fqdnSubdomain: { - serializedName: "properties.fqdnSubdomain", + osDiskType: { + serializedName: "properties.osDiskType", type: { name: "String" } }, - fqdn: { - serializedName: "properties.fqdn", - readOnly: true, + kubeletDiskType: { + serializedName: "properties.kubeletDiskType", type: { name: "String" } }, - privateFqdn: { - serializedName: "properties.privateFQDN", - readOnly: true, + workloadRuntime: { + serializedName: "properties.workloadRuntime", type: { name: "String" } }, - azurePortalFqdn: { - serializedName: "properties.azurePortalFQDN", - readOnly: true, + vnetSubnetID: { + serializedName: "properties.vnetSubnetID", type: { name: "String" } }, - agentPoolProfiles: { - serializedName: "properties.agentPoolProfiles", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ManagedClusterAgentPoolProfile" - } - } - } - }, - linuxProfile: { - serializedName: "properties.linuxProfile", + podSubnetID: { + serializedName: "properties.podSubnetID", type: { - name: "Composite", - className: "ContainerServiceLinuxProfile" + name: "String" } }, - windowsProfile: { - serializedName: "properties.windowsProfile", + maxPods: { + serializedName: "properties.maxPods", type: { - name: "Composite", - className: "ManagedClusterWindowsProfile" + name: "Number" } }, - servicePrincipalProfile: { - serializedName: "properties.servicePrincipalProfile", + osType: { + defaultValue: "Linux", + serializedName: "properties.osType", type: { - name: "Composite", - className: "ManagedClusterServicePrincipalProfile" + name: "String" } }, - addonProfiles: { - serializedName: "properties.addonProfiles", + osSKU: { + serializedName: "properties.osSKU", type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "ManagedClusterAddonProfile" } - } + name: "String" } }, - podIdentityProfile: { - serializedName: "properties.podIdentityProfile", + maxCount: { + serializedName: "properties.maxCount", type: { - name: "Composite", - className: "ManagedClusterPodIdentityProfile" + name: "Number" } }, - nodeResourceGroup: { - serializedName: "properties.nodeResourceGroup", + minCount: { + serializedName: "properties.minCount", type: { - name: "String" + name: "Number" } }, - enableRbac: { - serializedName: "properties.enableRBAC", + enableAutoScaling: { + serializedName: "properties.enableAutoScaling", type: { name: "Boolean" } }, - enablePodSecurityPolicy: { - serializedName: "properties.enablePodSecurityPolicy", + scaleDownMode: { + serializedName: "properties.scaleDownMode", type: { - name: "Boolean" + name: "String" } }, - networkProfile: { - serializedName: "properties.networkProfile", + typePropertiesType: { + serializedName: "properties.type", type: { - name: "Composite", - className: "ContainerServiceNetworkProfile" + name: "String" } }, - aadProfile: { - serializedName: "properties.aadProfile", + mode: { + serializedName: "properties.mode", type: { - name: "Composite", - className: "ManagedClusterAADProfile" + name: "String" } }, - autoUpgradeProfile: { - serializedName: "properties.autoUpgradeProfile", + orchestratorVersion: { + serializedName: "properties.orchestratorVersion", type: { - name: "Composite", - className: "ManagedClusterAutoUpgradeProfile" + name: "String" } }, - autoScalerProfile: { - serializedName: "properties.autoScalerProfile", + nodeImageVersion: { + serializedName: "properties.nodeImageVersion", + readOnly: true, type: { - name: "Composite", - className: "ManagedClusterPropertiesAutoScalerProfile" + name: "String" } }, - apiServerAccessProfile: { - serializedName: "properties.apiServerAccessProfile", + upgradeSettings: { + serializedName: "properties.upgradeSettings", type: { name: "Composite", - className: "ManagedClusterAPIServerAccessProfile" + className: "AgentPoolUpgradeSettings" } }, - diskEncryptionSetID: { - serializedName: "properties.diskEncryptionSetID", + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } }, - identityProfile: { - serializedName: "properties.identityProfile", + powerState: { + serializedName: "properties.powerState", type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "UserAssignedIdentity" } - } + name: "Composite", + className: "PowerState" } }, - privateLinkResources: { - serializedName: "properties.privateLinkResources", + availabilityZones: { + serializedName: "properties.availabilityZones", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "PrivateLinkResource" + name: "String" } } } }, - disableLocalAccounts: { - serializedName: "properties.disableLocalAccounts", + enableNodePublicIP: { + serializedName: "properties.enableNodePublicIP", type: { name: "Boolean" } }, - httpProxyConfig: { - serializedName: "properties.httpProxyConfig", - type: { - name: "Composite", - className: "ManagedClusterHttpProxyConfig" + nodePublicIPPrefixID: { + serializedName: "properties.nodePublicIPPrefixID", + type: { + name: "String" } }, - securityProfile: { - serializedName: "properties.securityProfile", + scaleSetPriority: { + defaultValue: "Regular", + serializedName: "properties.scaleSetPriority", type: { - name: "Composite", - className: "ManagedClusterSecurityProfile" + name: "String" } }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", + scaleSetEvictionPolicy: { + defaultValue: "Delete", + serializedName: "properties.scaleSetEvictionPolicy", type: { name: "String" } - } - } - } -}; - -export const ManagedClusterAccessProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ManagedClusterAccessProfile", - modelProperties: { - ...Resource.type.modelProperties, - kubeConfig: { - serializedName: "properties.kubeConfig", + }, + spotMaxPrice: { + defaultValue: -1, + serializedName: "properties.spotMaxPrice", type: { - name: "ByteArray" + name: "Number" } - } - } - } -}; - -export const Snapshot: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Snapshot", - modelProperties: { - ...Resource.type.modelProperties, - creationData: { - serializedName: "properties.creationData", + }, + tags: { + serializedName: "properties.tags", type: { - name: "Composite", - className: "CreationData" + name: "Dictionary", + value: { type: { name: "String" } } } }, - snapshotType: { - defaultValue: "NodePool", - serializedName: "properties.snapshotType", + nodeLabels: { + serializedName: "properties.nodeLabels", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - kubernetesVersion: { - serializedName: "properties.kubernetesVersion", - readOnly: true, + nodeTaints: { + serializedName: "properties.nodeTaints", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - nodeImageVersion: { - serializedName: "properties.nodeImageVersion", - readOnly: true, + proximityPlacementGroupID: { + serializedName: "properties.proximityPlacementGroupID", type: { name: "String" } }, - osType: { - defaultValue: "Linux", - serializedName: "properties.osType", - readOnly: true, + kubeletConfig: { + serializedName: "properties.kubeletConfig", type: { - name: "String" + name: "Composite", + className: "KubeletConfig" } }, - osSku: { - serializedName: "properties.osSku", - readOnly: true, + linuxOSConfig: { + serializedName: "properties.linuxOSConfig", type: { - name: "String" + name: "Composite", + className: "LinuxOSConfig" } }, - vmSize: { - serializedName: "properties.vmSize", - readOnly: true, + enableEncryptionAtHost: { + serializedName: "properties.enableEncryptionAtHost", type: { - name: "String" + name: "Boolean" + } + }, + enableUltraSSD: { + serializedName: "properties.enableUltraSSD", + type: { + name: "Boolean" } }, enableFips: { serializedName: "properties.enableFIPS", - readOnly: true, type: { name: "Boolean" } + }, + gpuInstanceProfile: { + serializedName: "properties.gpuInstanceProfile", + type: { + name: "String" + } + }, + creationData: { + serializedName: "properties.creationData", + type: { + name: "Composite", + className: "CreationData" + } } } } }; -export const MaintenanceConfiguration: coreClient.CompositeMapper = { +export const ManagedCluster: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MaintenanceConfiguration", + className: "ManagedCluster", modelProperties: { - ...SubResource.type.modelProperties, - systemData: { - serializedName: "systemData", + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", type: { name: "Composite", - className: "SystemData" + className: "ManagedClusterSKU" } }, - timeInWeek: { - serializedName: "properties.timeInWeek", + extendedLocation: { + serializedName: "extendedLocation", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TimeInWeek" - } - } + name: "Composite", + className: "ExtendedLocation" } }, - notAllowedTime: { - serializedName: "properties.notAllowedTime", + identity: { + serializedName: "identity", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TimeSpan" - } - } + name: "Composite", + className: "ManagedClusterIdentity" } - } - } - } -}; - -export const AgentPool: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AgentPool", - modelProperties: { - ...SubResource.type.modelProperties, - count: { - serializedName: "properties.count", + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { - name: "Number" + name: "String" } }, - vmSize: { - serializedName: "properties.vmSize", + powerState: { + serializedName: "properties.powerState", type: { - name: "String" + name: "Composite", + className: "PowerState" } }, - osDiskSizeGB: { - constraints: { - InclusiveMaximum: 2048, - InclusiveMinimum: 0 - }, - serializedName: "properties.osDiskSizeGB", + maxAgentPools: { + serializedName: "properties.maxAgentPools", + readOnly: true, type: { name: "Number" } }, - osDiskType: { - serializedName: "properties.osDiskType", + kubernetesVersion: { + serializedName: "properties.kubernetesVersion", type: { name: "String" } }, - kubeletDiskType: { - serializedName: "properties.kubeletDiskType", + dnsPrefix: { + serializedName: "properties.dnsPrefix", type: { name: "String" } }, - workloadRuntime: { - serializedName: "properties.workloadRuntime", + fqdnSubdomain: { + serializedName: "properties.fqdnSubdomain", type: { name: "String" } }, - vnetSubnetID: { - serializedName: "properties.vnetSubnetID", + fqdn: { + serializedName: "properties.fqdn", + readOnly: true, type: { name: "String" } }, - podSubnetID: { - serializedName: "properties.podSubnetID", + privateFqdn: { + serializedName: "properties.privateFQDN", + readOnly: true, type: { name: "String" } }, - maxPods: { - serializedName: "properties.maxPods", + azurePortalFqdn: { + serializedName: "properties.azurePortalFQDN", + readOnly: true, type: { - name: "Number" + name: "String" } }, - osType: { - defaultValue: "Linux", - serializedName: "properties.osType", + agentPoolProfiles: { + serializedName: "properties.agentPoolProfiles", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ManagedClusterAgentPoolProfile" + } + } } }, - osSKU: { - serializedName: "properties.osSKU", + linuxProfile: { + serializedName: "properties.linuxProfile", type: { - name: "String" + name: "Composite", + className: "ContainerServiceLinuxProfile" } }, - maxCount: { - serializedName: "properties.maxCount", + windowsProfile: { + serializedName: "properties.windowsProfile", type: { - name: "Number" + name: "Composite", + className: "ManagedClusterWindowsProfile" } }, - minCount: { - serializedName: "properties.minCount", + servicePrincipalProfile: { + serializedName: "properties.servicePrincipalProfile", type: { - name: "Number" + name: "Composite", + className: "ManagedClusterServicePrincipalProfile" } }, - enableAutoScaling: { - serializedName: "properties.enableAutoScaling", + addonProfiles: { + serializedName: "properties.addonProfiles", type: { - name: "Boolean" + name: "Dictionary", + value: { + type: { name: "Composite", className: "ManagedClusterAddonProfile" } + } } }, - scaleDownMode: { - serializedName: "properties.scaleDownMode", + podIdentityProfile: { + serializedName: "properties.podIdentityProfile", type: { - name: "String" + name: "Composite", + className: "ManagedClusterPodIdentityProfile" } }, - typePropertiesType: { - serializedName: "properties.type", + nodeResourceGroup: { + serializedName: "properties.nodeResourceGroup", type: { name: "String" } }, - mode: { - serializedName: "properties.mode", + enableRbac: { + serializedName: "properties.enableRBAC", type: { - name: "String" + name: "Boolean" } }, - orchestratorVersion: { - serializedName: "properties.orchestratorVersion", + enablePodSecurityPolicy: { + serializedName: "properties.enablePodSecurityPolicy", type: { - name: "String" + name: "Boolean" } }, - nodeImageVersion: { - serializedName: "properties.nodeImageVersion", - readOnly: true, + networkProfile: { + serializedName: "properties.networkProfile", type: { - name: "String" + name: "Composite", + className: "ContainerServiceNetworkProfile" } }, - upgradeSettings: { - serializedName: "properties.upgradeSettings", + aadProfile: { + serializedName: "properties.aadProfile", type: { name: "Composite", - className: "AgentPoolUpgradeSettings" + className: "ManagedClusterAADProfile" } }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, + autoUpgradeProfile: { + serializedName: "properties.autoUpgradeProfile", type: { - name: "String" + name: "Composite", + className: "ManagedClusterAutoUpgradeProfile" } }, - powerState: { - serializedName: "properties.powerState", + autoScalerProfile: { + serializedName: "properties.autoScalerProfile", type: { name: "Composite", - className: "PowerState" + className: "ManagedClusterPropertiesAutoScalerProfile" } }, - availabilityZones: { - serializedName: "properties.availabilityZones", + apiServerAccessProfile: { + serializedName: "properties.apiServerAccessProfile", + type: { + name: "Composite", + className: "ManagedClusterAPIServerAccessProfile" + } + }, + diskEncryptionSetID: { + serializedName: "properties.diskEncryptionSetID", + type: { + name: "String" + } + }, + identityProfile: { + serializedName: "properties.identityProfile", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } + } + }, + privateLinkResources: { + serializedName: "properties.privateLinkResources", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "PrivateLinkResource" } } } }, - enableNodePublicIP: { - serializedName: "properties.enableNodePublicIP", + disableLocalAccounts: { + serializedName: "properties.disableLocalAccounts", type: { name: "Boolean" } }, - nodePublicIPPrefixID: { - serializedName: "properties.nodePublicIPPrefixID", + httpProxyConfig: { + serializedName: "properties.httpProxyConfig", type: { - name: "String" + name: "Composite", + className: "ManagedClusterHttpProxyConfig" } }, - scaleSetPriority: { - defaultValue: "Regular", - serializedName: "properties.scaleSetPriority", + securityProfile: { + serializedName: "properties.securityProfile", type: { - name: "String" + name: "Composite", + className: "ManagedClusterSecurityProfile" } }, - scaleSetEvictionPolicy: { - defaultValue: "Delete", - serializedName: "properties.scaleSetEvictionPolicy", + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", type: { name: "String" } - }, - spotMaxPrice: { - defaultValue: -1, - serializedName: "properties.spotMaxPrice", - type: { - name: "Number" - } - }, - tags: { - serializedName: "properties.tags", + } + } + } +}; + +export const ManagedClusterAccessProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterAccessProfile", + modelProperties: { + ...TrackedResource.type.modelProperties, + kubeConfig: { + serializedName: "properties.kubeConfig", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "ByteArray" } - }, - nodeLabels: { - serializedName: "properties.nodeLabels", + } + } + } +}; + +export const Snapshot: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Snapshot", + modelProperties: { + ...TrackedResource.type.modelProperties, + creationData: { + serializedName: "properties.creationData", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "Composite", + className: "CreationData" } }, - nodeTaints: { - serializedName: "properties.nodeTaints", + snapshotType: { + defaultValue: "NodePool", + serializedName: "properties.snapshotType", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - proximityPlacementGroupID: { - serializedName: "properties.proximityPlacementGroupID", + kubernetesVersion: { + serializedName: "properties.kubernetesVersion", + readOnly: true, type: { name: "String" } }, - kubeletConfig: { - serializedName: "properties.kubeletConfig", + nodeImageVersion: { + serializedName: "properties.nodeImageVersion", + readOnly: true, type: { - name: "Composite", - className: "KubeletConfig" + name: "String" } }, - linuxOSConfig: { - serializedName: "properties.linuxOSConfig", + osType: { + defaultValue: "Linux", + serializedName: "properties.osType", + readOnly: true, type: { - name: "Composite", - className: "LinuxOSConfig" + name: "String" } }, - enableEncryptionAtHost: { - serializedName: "properties.enableEncryptionAtHost", + osSku: { + serializedName: "properties.osSku", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - enableUltraSSD: { - serializedName: "properties.enableUltraSSD", + vmSize: { + serializedName: "properties.vmSize", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, enableFips: { serializedName: "properties.enableFIPS", + readOnly: true, type: { name: "Boolean" } - }, - gpuInstanceProfile: { - serializedName: "properties.gpuInstanceProfile", - type: { - name: "String" - } - }, - creationData: { - serializedName: "properties.creationData", - type: { - name: "Composite", - className: "CreationData" - } } } } 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"