diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index c14e15dfd3bf..a3e66c7f9035 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -102,6 +102,7 @@ specifiers: '@rush-temp/arm-healthbot': file:./projects/arm-healthbot.tgz '@rush-temp/arm-healthcareapis': file:./projects/arm-healthcareapis.tgz '@rush-temp/arm-hybridcompute': file:./projects/arm-hybridcompute.tgz + '@rush-temp/arm-hybridcontainerservice': file:./projects/arm-hybridcontainerservice.tgz '@rush-temp/arm-hybridkubernetes': file:./projects/arm-hybridkubernetes.tgz '@rush-temp/arm-imagebuilder': file:./projects/arm-imagebuilder.tgz '@rush-temp/arm-iotcentral': file:./projects/arm-iotcentral.tgz @@ -426,6 +427,7 @@ dependencies: '@rush-temp/arm-healthbot': file:projects/arm-healthbot.tgz '@rush-temp/arm-healthcareapis': file:projects/arm-healthcareapis.tgz '@rush-temp/arm-hybridcompute': file:projects/arm-hybridcompute.tgz + '@rush-temp/arm-hybridcontainerservice': file:projects/arm-hybridcontainerservice.tgz '@rush-temp/arm-hybridkubernetes': file:projects/arm-hybridkubernetes.tgz '@rush-temp/arm-imagebuilder': file:projects/arm-imagebuilder.tgz '@rush-temp/arm-iotcentral': file:projects/arm-iotcentral.tgz @@ -12372,6 +12374,33 @@ packages: - supports-color dev: false + file:projects/arm-hybridcontainerservice.tgz: + resolution: {integrity: sha512-iRPolkscFIu6Sqdyd0sxQugS18N1lbYL6TuRUAWJcJwkDHwmKsIhqRvyGHrAeQVqc9KYcuOryX4mScWcU/MsUw==, tarball: file:projects/arm-hybridcontainerservice.tgz} + name: '@rush-temp/arm-hybridcontainerservice' + version: 0.0.0 + dependencies: + '@azure/identity': 2.1.0 + '@microsoft/api-extractor': 7.33.5 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.3 + '@types/node': 14.18.33 + chai: 4.3.6 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 2.79.1 + rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444 + tslib: 2.4.1 + typescript: 4.6.4 + uglify-js: 3.17.4 + transitivePeerDependencies: + - supports-color + dev: false + file:projects/arm-hybridkubernetes.tgz: resolution: {integrity: sha512-bkQPLkwNDRjFRZnD8x/kPLTE0G80dDZPPH7IvoRPwmwlU2w6aYwCR+o95O3TLoEGekifXfttcoTLYNS+VvFI/w==, tarball: file:projects/arm-hybridkubernetes.tgz} name: '@rush-temp/arm-hybridkubernetes' diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index c4b8fae91907..9aecc32c5a11 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -33,3 +33,4 @@ https://docs.microsoft.com/javascript/api/@azure-rest/ai-anomaly-detector?view=a https://docs.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview https://docs.microsoft.com/javascript/api/@azure/arm-appcomplianceautomation?view=azure-node-preview https://docs.microsoft.com/javascript/api/@azure/arm-elastic?view=azure-node-preview +https://docs.microsoft.com/javascript/api/@azure/arm-hybridcontainerservice?view=azure-node-preview diff --git a/rush.json b/rush.json index 2de97abff922..157b80a59d66 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */{ + */ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -1930,6 +1930,11 @@ "packageName": "@azure/arm-elastic", "projectFolder": "sdk/elastic/arm-elastic", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-hybridcontainerservice", + "projectFolder": "sdk/hybridcontainerservice/arm-hybridcontainerservice", + "versionPolicyName": "management" } ] -} \ No newline at end of file +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/CHANGELOG.md b/sdk/hybridcontainerservice/arm-hybridcontainerservice/CHANGELOG.md new file mode 100644 index 000000000000..398aaa978f08 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-11-09) + +The package of @azure/arm-hybridcontainerservice is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/LICENSE b/sdk/hybridcontainerservice/arm-hybridcontainerservice/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/README.md b/sdk/hybridcontainerservice/arm-hybridcontainerservice/README.md new file mode 100644 index 000000000000..e64abbaffe78 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/README.md @@ -0,0 +1,109 @@ +# Azure HybridContainerService client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure HybridContainerService client. + +The Microsoft.HybridContainerService Rest API spec. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hybridcontainerservice/arm-hybridcontainerservice) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-hybridcontainerservice) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-hybridcontainerservice?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- 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]. + +### Install the `@azure/arm-hybridcontainerservice` package + +Install the Azure HybridContainerService client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-hybridcontainerservice +``` + +### Create and authenticate a `HybridContainerServiceClient` + +To create a client object to access the Azure HybridContainerService API, you will need the `endpoint` of your Azure HybridContainerService resource and a `credential`. The Azure HybridContainerService client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure HybridContainerService resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure HybridContainerService** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +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 HybridContainerServiceClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new HybridContainerServiceClient(credential, subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### HybridContainerServiceClient + +`HybridContainerServiceClient` is the primary interface for developers using the Azure HybridContainerService client library. Explore the methods on this client object to understand the different features of the Azure HybridContainerService service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fhybridcontainerservice%2Farm-hybridcontainerservice%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/_meta.json b/sdk/hybridcontainerservice/arm-hybridcontainerservice/_meta.json new file mode 100644 index 000000000000..43e1759caafe --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "ae9cb5a65ff4dba1d626ed0a1bb4e94dd17583e8", + "readme": "specification/hybridaks/resource-manager/readme.md", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\hybridaks\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221103.1 --generate-sample=true", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", + "use": "@autorest/typescript@6.0.0-rc.3.20221103.1" +} \ No newline at end of file diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/api-extractor.json b/sdk/hybridcontainerservice/arm-hybridcontainerservice/api-extractor.json new file mode 100644 index 000000000000..0c53b44aaad8 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-hybridcontainerservice.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/package.json b/sdk/hybridcontainerservice/arm-hybridcontainerservice/package.json new file mode 100644 index 000000000000..abf9dbaaea9d --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/package.json @@ -0,0 +1,122 @@ +{ + "name": "@azure/arm-hybridcontainerservice", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for HybridContainerServiceClient.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=14.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.6.1", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.8.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-hybridcontainerservice.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "^7.31.1", + "@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", + "mkdirp": "^1.0.4", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "typescript": "~4.6.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", + "mocha": "^7.1.1", + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@types/node": "^14.0.0", + "@azure/dev-tool": "^1.0.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hybridcontainerservice/arm-hybridcontainerservice", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "rollup.config.js", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "api-extractor run --local", + "lint": "echo skipped", + "audit": "echo skipped", + "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/hybridContainerServiceClient.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "//sampleConfiguration": { + "productName": "", + "productSlugs": [ + "azure" + ], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-hybridcontainerservice?view=azure-node-preview" + } +} \ No newline at end of file diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/recordings/node/my_test/recording_sample_test.json b/sdk/hybridcontainerservice/arm-hybridcontainerservice/recordings/node/my_test/recording_sample_test.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/recordings/node/my_test/recording_sample_test.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/review/arm-hybridcontainerservice.api.md b/sdk/hybridcontainerservice/arm-hybridcontainerservice/review/arm-hybridcontainerservice.api.md new file mode 100644 index 000000000000..2c2145f4f99b --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/review/arm-hybridcontainerservice.api.md @@ -0,0 +1,1187 @@ +## API Report File for "@azure/arm-hybridcontainerservice" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export interface AADProfile extends AADProfileSecret, AADProfileResponse { +} + +// @public +export interface AADProfileResponse { + adminGroupObjectIDs?: string[]; + clientAppID?: string; + enableAzureRbac?: boolean; + managed?: boolean; + serverAppID?: string; + tenantID?: string; +} + +// @public +export interface AADProfileSecret { + serverAppSecret?: string; +} + +// @public +export interface AddonProfiles { + config?: { + [propertyName: string]: string; + }; + enabled?: boolean; +} + +// @public +export interface AddonStatus { + errorMessage?: string; + phase?: string; + // (undocumented) + ready?: boolean; +} + +// @public +export interface AgentPool { + availabilityZones?: string[]; + cloudProviderProfile?: CloudProviderProfile; + count?: number; + // (undocumented) + extendedLocation?: AgentPoolExtendedLocation; + readonly id?: string; + location?: string; + maxCount?: number; + maxPods?: number; + minCount?: number; + mode?: Mode; + readonly name?: string; + nodeImageVersion?: string; + nodeLabels?: { + [propertyName: string]: string; + }; + nodeTaints?: string[]; + osType?: OsType; + readonly provisioningState?: AgentPoolProvisioningState; + status?: AgentPoolProvisioningStatusStatus; + readonly systemData?: SystemData; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; + vmSize?: string; +} + +// @public +export interface AgentPoolCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AgentPoolCreateOrUpdateResponse = AgentPool; + +// @public +export interface AgentPoolDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public (undocumented) +export interface AgentPoolExtendedLocation { + name?: string; + type?: string; +} + +// @public +export interface AgentPoolGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AgentPoolGetResponse = AgentPool; + +// @public +export interface AgentPoolListByProvisionedClusterOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AgentPoolListByProvisionedClusterResponse = AgentPoolListResult; + +// @public (undocumented) +export interface AgentPoolListResult { + // (undocumented) + nextLink?: string; + // (undocumented) + value?: AgentPool[]; +} + +// @public +export interface AgentPoolName { + name?: string; +} + +// @public +export interface AgentPoolOperations { + beginCreateOrUpdate(resourceGroupName: string, provisionedClustersName: string, agentPoolName: string, agentPool: AgentPool, options?: AgentPoolCreateOrUpdateOptionalParams): Promise, AgentPoolCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, provisionedClustersName: string, agentPoolName: string, agentPool: AgentPool, options?: AgentPoolCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, provisionedClustersName: string, agentPoolName: string, options?: AgentPoolDeleteOptionalParams): Promise; + get(resourceGroupName: string, provisionedClustersName: string, agentPoolName: string, options?: AgentPoolGetOptionalParams): Promise; + listByProvisionedCluster(resourceGroupName: string, provisionedClustersName: string, options?: AgentPoolListByProvisionedClusterOptionalParams): Promise; + update(resourceGroupName: string, provisionedClustersName: string, agentPoolName: string, agentPool: AgentPool, options?: AgentPoolUpdateOptionalParams): Promise; +} + +// @public +export interface AgentPoolProfile { + availabilityZones?: string[]; + cloudProviderProfile?: CloudProviderProfile; + count?: number; + maxCount?: number; + maxPods?: number; + minCount?: number; + mode?: Mode; + nodeImageVersion?: string; + nodeLabels?: { + [propertyName: string]: string; + }; + nodeTaints?: string[]; + osType?: OsType; + vmSize?: string; +} + +// @public (undocumented) +export interface AgentPoolProperties extends AgentPoolProfile, AgentPoolProvisioningStatus { +} + +// @public +export type AgentPoolProvisioningState = string; + +// @public +export interface AgentPoolProvisioningStatus { + readonly provisioningState?: AgentPoolProvisioningState; + status?: AgentPoolProvisioningStatusStatus; +} + +// @public (undocumented) +export interface AgentPoolProvisioningStatusError { + // (undocumented) + code?: string; + // (undocumented) + message?: string; +} + +// @public +export interface AgentPoolProvisioningStatusStatus { + errorMessage?: string; + provisioningStatus?: AgentPoolProvisioningStatusStatusProvisioningStatus; + readyReplicas?: number; + replicas?: number; +} + +// @public +export interface AgentPoolProvisioningStatusStatusProvisioningStatus { + // (undocumented) + error?: AgentPoolProvisioningStatusError; + // (undocumented) + operationId?: string; + phase?: string; + // (undocumented) + status?: string; +} + +// @public +export interface AgentPoolUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AgentPoolUpdateResponse = AgentPool; + +// @public +export interface ArcAgentProfile { + agentAutoUpgrade?: AutoUpgradeOptions; + agentVersion?: string; +} + +// @public +export interface ArcAgentStatus { + agentVersion?: string; + coreCount?: number; + deploymentState?: DeploymentState; + errorMessage?: string; + lastConnectivityTime?: Date; + managedIdentityCertificateExpirationTime?: Date; + onboardingPublicKey?: string; +} + +// @public +export type AutoUpgradeOptions = string; + +// @public +export interface CloudProviderProfile { + infraNetworkProfile?: CloudProviderProfileInfraNetworkProfile; + infraStorageProfile?: CloudProviderProfileInfraStorageProfile; +} + +// @public +export interface CloudProviderProfileInfraNetworkProfile { + vnetSubnetIds?: string[]; +} + +// @public +export interface CloudProviderProfileInfraStorageProfile { + storageSpaceIds?: string[]; +} + +// @public +export interface ControlPlaneEndpointProfile { + controlPlaneEndpoint?: ControlPlaneEndpointProfileControlPlaneEndpoint; +} + +// @public +export interface ControlPlaneEndpointProfileControlPlaneEndpoint { + hostIP?: string; + port?: string; +} + +// @public +export interface ControlPlaneProfile extends NamedAgentPoolProfile, ControlPlaneEndpointProfile, LinuxProfile { +} + +// @public +export type CreatedByType = string; + +// @public +export type DeploymentState = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export interface HttpProxyConfig extends HttpProxyConfigResponse, HttpProxyConfigPassword { +} + +// @public (undocumented) +export interface HttpProxyConfigPassword { + password?: string; +} + +// @public +export interface HttpProxyConfigResponse { + httpProxy?: string; + httpsProxy?: string; + noProxy?: string[]; + trustedCa?: string; + username?: string; +} + +// @public +export interface HybridContainerService { + listOrchestrators(customLocationResourceUri: string, options?: HybridContainerServiceListOrchestratorsOptionalParams): Promise; + listVMSkus(customLocationResourceUri: string, options?: HybridContainerServiceListVMSkusOptionalParams): Promise; +} + +// @public (undocumented) +export class HybridContainerServiceClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: HybridContainerServiceClientOptionalParams); + // (undocumented) + agentPoolOperations: AgentPoolOperations; + // (undocumented) + apiVersion: string; + // (undocumented) + hybridContainerService: HybridContainerService; + // (undocumented) + hybridIdentityMetadataOperations: HybridIdentityMetadataOperations; + // (undocumented) + operations: Operations; + // (undocumented) + provisionedClustersOperations: ProvisionedClustersOperations; + // (undocumented) + storageSpacesOperations: StorageSpacesOperations; + // (undocumented) + subscriptionId: string; + // (undocumented) + virtualNetworksOperations: VirtualNetworksOperations; +} + +// @public +export interface HybridContainerServiceClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface HybridContainerServiceListOrchestratorsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridContainerServiceListOrchestratorsResponse = OrchestratorVersionProfileListResult; + +// @public +export interface HybridContainerServiceListVMSkusOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridContainerServiceListVMSkusResponse = VMSkuListResult; + +// @public +export interface HybridIdentityMetadata extends ProxyResource { + identity?: ProvisionedClusterIdentity; + readonly provisioningState?: string; + publicKey?: string; + resourceUid?: string; + readonly systemData?: SystemData; +} + +// @public +export interface HybridIdentityMetadataDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface HybridIdentityMetadataGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridIdentityMetadataGetResponse = HybridIdentityMetadata; + +// @public +export interface HybridIdentityMetadataList { + nextLink?: string; + value: HybridIdentityMetadata[]; +} + +// @public +export interface HybridIdentityMetadataListByClusterNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridIdentityMetadataListByClusterNextResponse = HybridIdentityMetadataList; + +// @public +export interface HybridIdentityMetadataListByClusterOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridIdentityMetadataListByClusterResponse = HybridIdentityMetadataList; + +// @public +export interface HybridIdentityMetadataOperations { + delete(resourceGroupName: string, provisionedClustersName: string, hybridIdentityMetadataResourceName: string, options?: HybridIdentityMetadataDeleteOptionalParams): Promise; + get(resourceGroupName: string, provisionedClustersName: string, hybridIdentityMetadataResourceName: string, options?: HybridIdentityMetadataGetOptionalParams): Promise; + listByCluster(resourceGroupName: string, provisionedClustersName: string, options?: HybridIdentityMetadataListByClusterOptionalParams): PagedAsyncIterableIterator; + put(resourceGroupName: string, provisionedClustersName: string, hybridIdentityMetadataResourceName: string, body: HybridIdentityMetadata, options?: HybridIdentityMetadataPutOptionalParams): Promise; +} + +// @public +export interface HybridIdentityMetadataPutOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type HybridIdentityMetadataPutResponse = HybridIdentityMetadata; + +// @public +export enum KnownAgentPoolProvisioningState { + Canceled = "Canceled", + Deleting = "Deleting", + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded" +} + +// @public +export enum KnownAutoUpgradeOptions { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDeploymentState { + Deleting = "deleting", + Failed = "failed", + Pending = "pending", + Provisioned = "provisioned", + Provisioning = "provisioning", + Upgrading = "upgrading" +} + +// @public +export enum KnownLicenseType { + None = "None", + WindowsServer = "Windows_Server" +} + +// @public +export enum KnownLoadBalancerSku { + StackedKubeVip = "stacked-kube-vip", + StackedMetallb = "stacked-metallb", + Unmanaged = "unmanaged", + UnstackedHaproxy = "unstacked-haproxy" +} + +// @public +export enum KnownMode { + LB = "LB", + System = "System", + User = "User" +} + +// @public +export enum KnownNetworkPolicy { + Calico = "calico", + Flannel = "flannel" +} + +// @public +export enum KnownOsType { + Linux = "Linux", + Windows = "Windows" +} + +// @public +export enum KnownProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Created = "Created", + Deleting = "Deleting", + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export type LicenseType = string; + +// @public +export interface LinuxProfile { + linuxProfile?: LinuxProfileProperties; +} + +// @public +export interface LinuxProfileProperties { + adminUsername?: string; + ssh?: LinuxProfilePropertiesSsh; +} + +// @public +export interface LinuxProfilePropertiesSsh { + publicKeys?: LinuxProfilePropertiesSshPublicKeysItem[]; +} + +// @public (undocumented) +export interface LinuxProfilePropertiesSshPublicKeysItem { + keyData?: string; +} + +// @public +export interface LoadBalancerProfile extends NamedAgentPoolProfile, LinuxProfile { +} + +// @public +export type LoadBalancerSku = string; + +// @public +export type Mode = string; + +// @public +export interface NamedAgentPoolProfile extends AgentPoolProfile, AgentPoolName { +} + +// @public +export type NetworkPolicy = string; + +// @public +export interface NetworkProfile { + dnsServiceIP?: string; + loadBalancerProfile?: LoadBalancerProfile; + loadBalancerSku?: LoadBalancerSku; + networkPolicy?: NetworkPolicy; + podCidr?: string; + podCidrs?: string[]; + serviceCidr?: string; + serviceCidrs?: string[]; +} + +// @public +export interface Operations { + // (undocumented) + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = ResourceProviderOperationList; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = ResourceProviderOperationList; + +// @public +export interface OrchestratorProfile { + readonly isPreview?: boolean; + readonly orchestratorType?: string; + readonly orchestratorVersion?: string; +} + +// @public +export interface OrchestratorVersionProfile { + readonly default?: boolean; + readonly isPreview?: boolean; + readonly orchestratorType?: string; + readonly orchestratorVersion?: string; + upgrades?: OrchestratorProfile[]; +} + +// @public +export interface OrchestratorVersionProfileListResult { + readonly id?: string; + readonly name?: string; + orchestrators?: OrchestratorVersionProfile[]; + readonly type?: string; +} + +// @public +export type OsType = string; + +// @public +export interface ProvisionedClusterIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ResourceIdentityType; +} + +// @public +export interface ProvisionedClusters extends TrackedResource { + // (undocumented) + extendedLocation?: ProvisionedClustersExtendedLocation; + identity?: ProvisionedClusterIdentity; + properties?: ProvisionedClustersAllProperties; + readonly systemData?: SystemData; +} + +// @public +export interface ProvisionedClustersAllProperties extends ProvisionedClustersPropertiesWithSecrets, ProvisionedClustersCommonProperties { +} + +// @public +export interface ProvisionedClustersCommonProperties { + addonProfiles?: { + [propertyName: string]: AddonProfiles; + }; + agentPoolProfiles?: NamedAgentPoolProfile[]; + cloudProviderProfile?: CloudProviderProfile; + controlPlane?: ControlPlaneProfile; + enableRbac?: boolean; + features?: ProvisionedClustersCommonPropertiesFeatures; + kubernetesVersion?: string; + linuxProfile?: LinuxProfileProperties; + networkProfile?: NetworkProfile; + nodeResourceGroup?: string; + readonly provisioningState?: ProvisioningState; + readonly status?: ProvisionedClustersCommonPropertiesStatus; +} + +// @public +export interface ProvisionedClustersCommonPropertiesFeatures { + arcAgentProfile?: ArcAgentProfile; +} + +// @public +export interface ProvisionedClustersCommonPropertiesStatus { + addonStatus?: { + [propertyName: string]: AddonStatus; + }; + errorMessage?: string; + featuresStatus?: ProvisionedClustersCommonPropertiesStatusFeaturesStatus; + provisioningStatus?: ProvisionedClustersCommonPropertiesStatusProvisioningStatus; +} + +// @public +export interface ProvisionedClustersCommonPropertiesStatusFeaturesStatus { + arcAgentStatus?: ArcAgentStatus; +} + +// @public +export interface ProvisionedClustersCommonPropertiesStatusProvisioningStatus { + // (undocumented) + error?: ProvisionedClustersCommonPropertiesStatusProvisioningStatusError; + // (undocumented) + operationId?: string; + phase?: string; + // (undocumented) + status?: string; +} + +// @public (undocumented) +export interface ProvisionedClustersCommonPropertiesStatusProvisioningStatusError { + // (undocumented) + code?: string; + // (undocumented) + message?: string; +} + +// @public +export interface ProvisionedClustersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ProvisionedClustersCreateOrUpdateResponse = ProvisionedClustersResponse; + +// @public +export interface ProvisionedClustersDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public (undocumented) +export interface ProvisionedClustersExtendedLocation { + name?: string; + type?: string; +} + +// @public +export interface ProvisionedClustersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProvisionedClustersGetResponse = ProvisionedClustersResponse; + +// @public +export interface ProvisionedClustersListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProvisionedClustersListByResourceGroupNextResponse = ProvisionedClustersResponseListResult; + +// @public +export interface ProvisionedClustersListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProvisionedClustersListByResourceGroupResponse = ProvisionedClustersResponseListResult; + +// @public +export interface ProvisionedClustersListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProvisionedClustersListBySubscriptionNextResponse = ProvisionedClustersResponseListResult; + +// @public +export interface ProvisionedClustersListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ProvisionedClustersListBySubscriptionResponse = ProvisionedClustersResponseListResult; + +// @public +export interface ProvisionedClustersOperations { + beginCreateOrUpdate(resourceGroupName: string, provisionedClustersName: string, provisionedClusters: ProvisionedClusters, options?: ProvisionedClustersCreateOrUpdateOptionalParams): Promise, ProvisionedClustersCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, provisionedClustersName: string, provisionedClusters: ProvisionedClusters, options?: ProvisionedClustersCreateOrUpdateOptionalParams): Promise; + beginUpdate(resourceGroupName: string, provisionedClustersName: string, provisionedClusters: ProvisionedClustersPatch, options?: ProvisionedClustersUpdateOptionalParams): Promise, ProvisionedClustersUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, provisionedClustersName: string, provisionedClusters: ProvisionedClustersPatch, options?: ProvisionedClustersUpdateOptionalParams): Promise; + delete(resourceGroupName: string, provisionedClustersName: string, options?: ProvisionedClustersDeleteOptionalParams): Promise; + get(resourceGroupName: string, provisionedClustersName: string, options?: ProvisionedClustersGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ProvisionedClustersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: ProvisionedClustersListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ProvisionedClustersPatch { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ProvisionedClustersPropertiesWithoutSecrets { + aadProfile?: AADProfileResponse; + httpProxyConfig?: HttpProxyConfigResponse; + windowsProfile?: WindowsProfileResponse; +} + +// @public +export interface ProvisionedClustersPropertiesWithSecrets { + aadProfile?: AADProfile; + httpProxyConfig?: HttpProxyConfig; + windowsProfile?: WindowsProfile; +} + +// @public +export interface ProvisionedClustersResponse extends TrackedResource { + // (undocumented) + extendedLocation?: ProvisionedClustersResponseExtendedLocation; + identity?: ProvisionedClusterIdentity; + // (undocumented) + properties?: ProvisionedClustersResponseProperties; + readonly systemData?: SystemData; +} + +// @public (undocumented) +export interface ProvisionedClustersResponseExtendedLocation { + name?: string; + type?: string; +} + +// @public (undocumented) +export interface ProvisionedClustersResponseListResult { + // (undocumented) + nextLink?: string; + // (undocumented) + value?: ProvisionedClustersResponse[]; +} + +// @public (undocumented) +export interface ProvisionedClustersResponseProperties extends ProvisionedClustersPropertiesWithoutSecrets, ProvisionedClustersCommonProperties { +} + +// @public +export interface ProvisionedClustersUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ProvisionedClustersUpdateResponse = ProvisionedClustersResponse; + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export type ResourceIdentityType = "None" | "SystemAssigned"; + +// @public +export interface ResourceProviderOperation { + display?: ResourceProviderOperationDisplay; + isDataAction?: string; + name?: string; +} + +// @public +export interface ResourceProviderOperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface ResourceProviderOperationList { + // (undocumented) + nextLink?: string; + // (undocumented) + value?: ResourceProviderOperation[]; +} + +// @public +export interface StorageSpaces extends TrackedResource { + // (undocumented) + extendedLocation?: StorageSpacesExtendedLocation; + properties?: StorageSpacesProperties; + readonly systemData?: SystemData; +} + +// @public +export interface StorageSpacesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageSpacesCreateOrUpdateResponse = StorageSpaces; + +// @public +export interface StorageSpacesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public (undocumented) +export interface StorageSpacesExtendedLocation { + name?: string; + type?: string; +} + +// @public +export interface StorageSpacesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageSpacesListByResourceGroupNextResponse = StorageSpacesListResult; + +// @public +export interface StorageSpacesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageSpacesListByResourceGroupResponse = StorageSpacesListResult; + +// @public +export interface StorageSpacesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageSpacesListBySubscriptionNextResponse = StorageSpacesListResult; + +// @public +export interface StorageSpacesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageSpacesListBySubscriptionResponse = StorageSpacesListResult; + +// @public (undocumented) +export interface StorageSpacesListResult { + // (undocumented) + nextLink?: string; + // (undocumented) + value?: StorageSpaces[]; +} + +// @public +export interface StorageSpacesOperations { + beginCreateOrUpdate(resourceGroupName: string, storageSpacesName: string, storageSpaces: StorageSpaces, options?: StorageSpacesCreateOrUpdateOptionalParams): Promise, StorageSpacesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, storageSpacesName: string, storageSpaces: StorageSpaces, options?: StorageSpacesCreateOrUpdateOptionalParams): Promise; + beginUpdate(resourceGroupName: string, storageSpacesName: string, storageSpaces: StorageSpacesPatch, options?: StorageSpacesUpdateOptionalParams): Promise, StorageSpacesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, storageSpacesName: string, storageSpaces: StorageSpacesPatch, options?: StorageSpacesUpdateOptionalParams): Promise; + delete(resourceGroupName: string, storageSpacesName: string, options?: StorageSpacesDeleteOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: StorageSpacesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: StorageSpacesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + retrieve(resourceGroupName: string, storageSpacesName: string, options?: StorageSpacesRetrieveOptionalParams): Promise; +} + +// @public +export interface StorageSpacesPatch { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface StorageSpacesProperties { + // (undocumented) + hciStorageProfile?: StorageSpacesPropertiesHciStorageProfile; + readonly provisioningState?: ProvisioningState; + status?: StorageSpacesPropertiesStatus; + // (undocumented) + vmwareStorageProfile?: StorageSpacesPropertiesVmwareStorageProfile; +} + +// @public (undocumented) +export interface StorageSpacesPropertiesHciStorageProfile { + mocGroup?: string; + mocLocation?: string; + mocStorageContainer?: string; +} + +// @public +export interface StorageSpacesPropertiesStatus { + provisioningStatus?: StorageSpacesPropertiesStatusProvisioningStatus; +} + +// @public +export interface StorageSpacesPropertiesStatusProvisioningStatus { + // (undocumented) + error?: StorageSpacesPropertiesStatusProvisioningStatusError; + // (undocumented) + operationId?: string; + phase?: string; + // (undocumented) + status?: string; +} + +// @public (undocumented) +export interface StorageSpacesPropertiesStatusProvisioningStatusError { + // (undocumented) + code?: string; + // (undocumented) + message?: string; +} + +// @public (undocumented) +export interface StorageSpacesPropertiesVmwareStorageProfile { + datacenter?: string; + datastore?: string; + folder?: string; + resourcePool?: string; +} + +// @public +export interface StorageSpacesRetrieveOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageSpacesRetrieveResponse = StorageSpaces; + +// @public +export interface StorageSpacesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageSpacesUpdateResponse = StorageSpaces; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface VirtualNetworks extends TrackedResource { + // (undocumented) + extendedLocation?: VirtualNetworksExtendedLocation; + properties?: VirtualNetworksProperties; + readonly systemData?: SystemData; +} + +// @public +export interface VirtualNetworksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualNetworksCreateOrUpdateResponse = VirtualNetworks; + +// @public +export interface VirtualNetworksDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public (undocumented) +export interface VirtualNetworksExtendedLocation { + name?: string; + type?: string; +} + +// @public +export interface VirtualNetworksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksListByResourceGroupNextResponse = VirtualNetworksListResult; + +// @public +export interface VirtualNetworksListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksListByResourceGroupResponse = VirtualNetworksListResult; + +// @public +export interface VirtualNetworksListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksListBySubscriptionNextResponse = VirtualNetworksListResult; + +// @public +export interface VirtualNetworksListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksListBySubscriptionResponse = VirtualNetworksListResult; + +// @public (undocumented) +export interface VirtualNetworksListResult { + // (undocumented) + nextLink?: string; + // (undocumented) + value?: VirtualNetworks[]; +} + +// @public +export interface VirtualNetworksOperations { + beginCreateOrUpdate(resourceGroupName: string, virtualNetworksName: string, virtualNetworks: VirtualNetworks, options?: VirtualNetworksCreateOrUpdateOptionalParams): Promise, VirtualNetworksCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, virtualNetworksName: string, virtualNetworks: VirtualNetworks, options?: VirtualNetworksCreateOrUpdateOptionalParams): Promise; + beginUpdate(resourceGroupName: string, virtualNetworksName: string, virtualNetworks: VirtualNetworksPatch, options?: VirtualNetworksUpdateOptionalParams): Promise, VirtualNetworksUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, virtualNetworksName: string, virtualNetworks: VirtualNetworksPatch, options?: VirtualNetworksUpdateOptionalParams): Promise; + delete(resourceGroupName: string, virtualNetworksName: string, options?: VirtualNetworksDeleteOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: VirtualNetworksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: VirtualNetworksListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + retrieve(resourceGroupName: string, virtualNetworksName: string, options?: VirtualNetworksRetrieveOptionalParams): Promise; +} + +// @public +export interface VirtualNetworksPatch { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface VirtualNetworksProperties { + readonly dhcpServers?: string[]; + readonly dnsServers?: string[]; + readonly gateway?: string; + // (undocumented) + infraVnetProfile?: VirtualNetworksPropertiesInfraVnetProfile; + readonly ipAddressPrefix?: string; + readonly provisioningState?: ProvisioningState; + readonly status?: VirtualNetworksPropertiesStatus; + vipPool?: VirtualNetworksPropertiesVipPoolItem[]; + readonly vlanID?: string; + vmipPool?: VirtualNetworksPropertiesVmipPoolItem[]; +} + +// @public (undocumented) +export interface VirtualNetworksPropertiesInfraVnetProfile { + hci?: VirtualNetworksPropertiesInfraVnetProfileHci; + kubevirt?: VirtualNetworksPropertiesInfraVnetProfileKubevirt; + vmware?: VirtualNetworksPropertiesInfraVnetProfileVmware; +} + +// @public +export interface VirtualNetworksPropertiesInfraVnetProfileHci { + mocGroup?: string; + mocLocation?: string; + mocVnetName?: string; +} + +// @public +export interface VirtualNetworksPropertiesInfraVnetProfileKubevirt { + vnetName?: string; +} + +// @public +export interface VirtualNetworksPropertiesInfraVnetProfileVmware { + segmentName?: string; +} + +// @public +export interface VirtualNetworksPropertiesStatus { + provisioningStatus?: VirtualNetworksPropertiesStatusProvisioningStatus; +} + +// @public +export interface VirtualNetworksPropertiesStatusProvisioningStatus { + // (undocumented) + error?: VirtualNetworksPropertiesStatusProvisioningStatusError; + // (undocumented) + operationId?: string; + phase?: string; + // (undocumented) + status?: string; +} + +// @public (undocumented) +export interface VirtualNetworksPropertiesStatusProvisioningStatusError { + // (undocumented) + code?: string; + // (undocumented) + message?: string; +} + +// @public (undocumented) +export interface VirtualNetworksPropertiesVipPoolItem { + endIP?: string; + startIP?: string; +} + +// @public (undocumented) +export interface VirtualNetworksPropertiesVmipPoolItem { + endIP?: string; + startIP?: string; +} + +// @public +export interface VirtualNetworksRetrieveOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VirtualNetworksRetrieveResponse = VirtualNetworks; + +// @public +export interface VirtualNetworksUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VirtualNetworksUpdateResponse = VirtualNetworks; + +// @public +export interface VMSkuListResult { + readonly id?: string; + readonly name?: string; + readonly type?: string; + readonly vmSKUs?: string[]; +} + +// @public +export interface WindowsProfile extends WindowsProfileResponse, WindowsProfilePassword { +} + +// @public +export interface WindowsProfilePassword { + adminPassword?: string; +} + +// @public +export interface WindowsProfileResponse { + adminUsername?: string; + enableCsiProxy?: boolean; + licenseType?: LicenseType; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/rollup.config.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/rollup.config.js new file mode 100644 index 000000000000..3f89d7309da5 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/rollup.config.js @@ -0,0 +1,122 @@ +/* + * 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 nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +// #region Warning Handler + +/** + * A function that can determine whether a rollup warning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEval(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependency(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs(), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/sample.env b/sdk/hybridcontainerservice/arm-hybridcontainerservice/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolCreateOrUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolCreateOrUpdateSample.ts new file mode 100644 index 000000000000..5c1cf54b9a0f --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolCreateOrUpdateSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AgentPool, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates the agent pool in the Hybrid AKS provisioned cluster + * + * @summary Creates the agent pool in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutAgentPool.json + */ +async function putAgentPool() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const agentPoolName = "test-hybridaksnodepool"; + const agentPool: AgentPool = { + count: 1, + location: "westus", + osType: "Linux", + vmSize: "Standard_A4_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.beginCreateOrUpdateAndWait( + resourceGroupName, + provisionedClustersName, + agentPoolName, + agentPool + ); + console.log(result); +} + +putAgentPool().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolDeleteSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolDeleteSample.ts new file mode 100644 index 000000000000..86fe564f8a27 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes the agent pool in the Hybrid AKS provisioned cluster + * + * @summary Deletes the agent pool in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteAgentPool.json + */ +async function deleteAgentPool() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const agentPoolName = "test-hybridaksnodepool"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.delete( + resourceGroupName, + provisionedClustersName, + agentPoolName + ); + console.log(result); +} + +deleteAgentPool().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolGetSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolGetSample.ts new file mode 100644 index 000000000000..b79fba5df4d0 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the agent pool in the Hybrid AKS provisioned cluster + * + * @summary Gets the agent pool in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetAgentPool.json + */ +async function getAgentPool() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const agentPoolName = "test-hybridaksnodepool"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.get( + resourceGroupName, + provisionedClustersName, + agentPoolName + ); + console.log(result); +} + +getAgentPool().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolListByProvisionedClusterSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolListByProvisionedClusterSample.ts new file mode 100644 index 000000000000..13483713d3de --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolListByProvisionedClusterSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the agent pools in the Hybrid AKS provisioned cluster + * + * @summary Gets the agent pools in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListAgentPoolByProvisionedCluster.json + */ +async function listAgentPoolByProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.listByProvisionedCluster( + resourceGroupName, + provisionedClustersName + ); + console.log(result); +} + +listAgentPoolByProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolUpdateSample.ts new file mode 100644 index 000000000000..c53350561538 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/agentPoolUpdateSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AgentPool, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates the agent pool in the Hybrid AKS provisioned cluster + * + * @summary Updates the agent pool in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateAgentPool.json + */ +async function updateAgentPool() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const agentPoolName = "test-hybridaksnodepool"; + const agentPool: AgentPool = { count: 3, location: "westus" }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.update( + resourceGroupName, + provisionedClustersName, + agentPoolName, + agentPool + ); + console.log(result); +} + +updateAgentPool().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridContainerServiceListOrchestratorsSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridContainerServiceListOrchestratorsSample.ts new file mode 100644 index 000000000000..c0f643e4d528 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridContainerServiceListOrchestratorsSample.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the available orchestrators in a custom location for HybridAKS + * + * @summary Lists the available orchestrators in a custom location for HybridAKS + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListOrchestrators.json + */ +async function listOrchestrators() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const customLocationResourceUri = + "subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridContainerService.listOrchestrators( + customLocationResourceUri + ); + console.log(result); +} + +listOrchestrators().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridContainerServiceListVMSkusSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridContainerServiceListVMSkusSample.ts new file mode 100644 index 000000000000..6abbee4acd68 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridContainerServiceListVMSkusSample.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the available VM SKUs in a custom location for HybridAKS + * + * @summary Lists the available VM SKUs in a custom location for HybridAKS + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVMSkus.json + */ +async function listVMSkus() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const customLocationResourceUri = + "subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridContainerService.listVMSkus( + customLocationResourceUri + ); + console.log(result); +} + +listVMSkus().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridIdentityMetadataDeleteSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridIdentityMetadataDeleteSample.ts new file mode 100644 index 000000000000..e19237e5d630 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridIdentityMetadataDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes the hybrid identity metadata proxy resource. + * + * @summary Deletes the hybrid identity metadata proxy resource. + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteHybridIdentityMetadata.json + */ +async function deleteHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const provisionedClustersName = "ContosoTargetCluster"; + const hybridIdentityMetadataResourceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridIdentityMetadataOperations.delete( + resourceGroupName, + provisionedClustersName, + hybridIdentityMetadataResourceName + ); + console.log(result); +} + +deleteHybridIdentityMetadata().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridIdentityMetadataGetSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridIdentityMetadataGetSample.ts new file mode 100644 index 000000000000..f4f4bdb3b295 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridIdentityMetadataGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the hybrid identity metadata proxy resource. + * + * @summary Get the hybrid identity metadata proxy resource. + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetHybridIdentityMetadata.json + */ +async function getHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const provisionedClustersName = "ContosoTargetCluster"; + const hybridIdentityMetadataResourceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridIdentityMetadataOperations.get( + resourceGroupName, + provisionedClustersName, + hybridIdentityMetadataResourceName + ); + console.log(result); +} + +getHybridIdentityMetadata().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridIdentityMetadataListByClusterSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridIdentityMetadataListByClusterSample.ts new file mode 100644 index 000000000000..116a777351a8 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridIdentityMetadataListByClusterSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the hybrid identity metadata proxy resource in a cluster. + * + * @summary Lists the hybrid identity metadata proxy resource in a cluster. + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/HybridIdentityMetadataListByCluster.json + */ +async function hybridIdentityMetadataListByCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const provisionedClustersName = "ContosoTargetCluster"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hybridIdentityMetadataOperations.listByCluster( + resourceGroupName, + provisionedClustersName + )) { + resArray.push(item); + } + console.log(resArray); +} + +hybridIdentityMetadataListByCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridIdentityMetadataPutSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridIdentityMetadataPutSample.ts new file mode 100644 index 000000000000..6c2e0b8e7aee --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/hybridIdentityMetadataPutSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + HybridIdentityMetadata, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates the hybrid identity metadata proxy resource that facilitates the managed identity provisioning. + * + * @summary Creates the hybrid identity metadata proxy resource that facilitates the managed identity provisioning. + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/CreateHybridIdentityMetadata.json + */ +async function createHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const provisionedClustersName = "ContosoTargetCluster"; + const hybridIdentityMetadataResourceName = "default"; + const body: HybridIdentityMetadata = { + publicKey: "8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2", + resourceUid: "f8b82dff-38ef-4220-99ef-d3a3f86ddc6c" + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridIdentityMetadataOperations.put( + resourceGroupName, + provisionedClustersName, + hybridIdentityMetadataResourceName, + body + ); + console.log(result); +} + +createHybridIdentityMetadata().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/operationsListSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/operationsListSample.ts new file mode 100644 index 000000000000..048c9110d47d --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/operationsListSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to + * + * @summary + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListOperations.json + */ +async function listOperations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listOperations().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersCreateOrUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersCreateOrUpdateSample.ts new file mode 100644 index 000000000000..1c9e12b41b04 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersCreateOrUpdateSample.ts @@ -0,0 +1,104 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ProvisionedClusters, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates the Hybrid AKS provisioned cluster + * + * @summary Creates the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutProvisionedCluster.json + */ +async function putProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const provisionedClusters: ProvisionedClusters = { + extendedLocation: { + name: + "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourcegroups/test-arcappliance-resgrp/providers/microsoft.extendedlocation/customlocations/testcustomlocation", + type: "CustomLocation" + }, + location: "westus", + properties: { + agentPoolProfiles: [ + { + name: "default-nodepool-1", + count: 1, + osType: "Linux", + vmSize: "Standard_A4_v2" + } + ], + cloudProviderProfile: { + infraNetworkProfile: { + vnetSubnetIds: [ + "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.HybridContainerService/virtualNetworks/test-vnet-static" + ] + }, + infraStorageProfile: { + storageSpaceIds: [ + "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.HybridContainerService/storageSpaces/test-storage" + ] + } + }, + controlPlane: { + count: 1, + linuxProfile: { + ssh: { + publicKeys: [ + { keyData: "ssh-rsa AAAAB1NzaC1yc2EAAAADAQABAAACAQCY......" } + ] + } + }, + osType: "Linux", + vmSize: "Standard_A4_v2" + }, + kubernetesVersion: "v1.20.5", + linuxProfile: { + ssh: { + publicKeys: [ + { keyData: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCY......." } + ] + } + }, + networkProfile: { + loadBalancerProfile: { + count: 1, + linuxProfile: { + ssh: { + publicKeys: [ + { keyData: "ssh-rsa AAAAB2NzaC1yc2EAAAADAQABAAACAQCY......" } + ] + } + }, + osType: "Linux", + vmSize: "Standard_K8S3_v1" + }, + loadBalancerSku: "unstacked-haproxy", + networkPolicy: "calico", + podCidr: "10.244.0.0/16" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.provisionedClustersOperations.beginCreateOrUpdateAndWait( + resourceGroupName, + provisionedClustersName, + provisionedClusters + ); + console.log(result); +} + +putProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersDeleteSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersDeleteSample.ts new file mode 100644 index 000000000000..716ea1932549 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes the Hybrid AKS provisioned cluster + * + * @summary Deletes the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteProvisionedCluster.json + */ +async function deleteProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.provisionedClustersOperations.delete( + resourceGroupName, + provisionedClustersName + ); + console.log(result); +} + +deleteProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersGetSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersGetSample.ts new file mode 100644 index 000000000000..3141f268bb86 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the Hybrid AKS provisioned cluster + * + * @summary Gets the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetProvisionedCluster.json + */ +async function getProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.provisionedClustersOperations.get( + resourceGroupName, + provisionedClustersName + ); + console.log(result); +} + +getProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersListByResourceGroupSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersListByResourceGroupSample.ts new file mode 100644 index 000000000000..c6cf5f4ffa57 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the Hybrid AKS provisioned cluster in a resource group + * + * @summary Gets the Hybrid AKS provisioned cluster in a resource group + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListProvisionedClusterByResourceGroup.json + */ +async function listProvisionedClusterByResourceGroup() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.provisionedClustersOperations.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listProvisionedClusterByResourceGroup().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersListBySubscriptionSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersListBySubscriptionSample.ts new file mode 100644 index 000000000000..eb1e974752a4 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the Hybrid AKS provisioned cluster in a subscription + * + * @summary Gets the Hybrid AKS provisioned cluster in a subscription + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListProvisionedClusterBySubscription.json + */ +async function listProvisionedClusterBySubscription() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.provisionedClustersOperations.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +listProvisionedClusterBySubscription().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersUpdateSample.ts new file mode 100644 index 000000000000..0a91a5fea135 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/provisionedClustersUpdateSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ProvisionedClustersPatch, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates the Hybrid AKS provisioned cluster + * + * @summary Updates the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateProvisionedCluster.json + */ +async function updateProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const provisionedClusters: ProvisionedClustersPatch = { + tags: { additionalProperties: "sample" } + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.provisionedClustersOperations.beginUpdateAndWait( + resourceGroupName, + provisionedClustersName, + provisionedClusters + ); + console.log(result); +} + +updateProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesCreateOrUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f3c13ad870a2 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesCreateOrUpdateSample.ts @@ -0,0 +1,52 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageSpaces, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Puts the Hybrid AKS storage object + * + * @summary Puts the Hybrid AKS storage object + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutStorageSpace.json + */ +async function putStorageSpace() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const storageSpacesName = "test-storage"; + const storageSpaces: StorageSpaces = { + extendedLocation: { + name: + "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourcegroups/test-arcappliance-resgrp/providers/microsoft.extendedlocation/customlocations/testcustomlocation", + type: "CustomLocation" + }, + location: "westus", + properties: { + hciStorageProfile: { + mocGroup: "target-group", + mocLocation: "MocLocation", + mocStorageContainer: "WssdStorageContainer" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.storageSpacesOperations.beginCreateOrUpdateAndWait( + resourceGroupName, + storageSpacesName, + storageSpaces + ); + console.log(result); +} + +putStorageSpace().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesDeleteSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesDeleteSample.ts new file mode 100644 index 000000000000..263e2ed47ee4 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes the Hybrid AKS storage object + * + * @summary Deletes the Hybrid AKS storage object + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteStorageSpace.json + */ +async function deleteStorageSpace() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const storageSpacesName = "test-storage"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.storageSpacesOperations.delete( + resourceGroupName, + storageSpacesName + ); + console.log(result); +} + +deleteStorageSpace().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesListByResourceGroupSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesListByResourceGroupSample.ts new file mode 100644 index 000000000000..6176906001f9 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List the Hybrid AKS storage object by resource group + * + * @summary List the Hybrid AKS storage object by resource group + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListStorageSpaceByResourceGroup.json + */ +async function listStorageSpaceByResourceGroup() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageSpacesOperations.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listStorageSpaceByResourceGroup().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesListBySubscriptionSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesListBySubscriptionSample.ts new file mode 100644 index 000000000000..cf621f9c21bb --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List the Hybrid AKS storage object by subscription + * + * @summary List the Hybrid AKS storage object by subscription + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListStorageSpaceBySubscription.json + */ +async function listStorageSpaceBySubscription() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageSpacesOperations.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +listStorageSpaceBySubscription().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesRetrieveSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesRetrieveSample.ts new file mode 100644 index 000000000000..e51b21db454d --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesRetrieveSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the Hybrid AKS storage space object + * + * @summary Gets the Hybrid AKS storage space object + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetStorageSpace.json + */ +async function getStorageSpace() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const storageSpacesName = "test-storage"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.storageSpacesOperations.retrieve( + resourceGroupName, + storageSpacesName + ); + console.log(result); +} + +getStorageSpace().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesUpdateSample.ts new file mode 100644 index 000000000000..9a46fcc8cbf0 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/storageSpacesUpdateSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageSpacesPatch, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patches the Hybrid AKS storage object + * + * @summary Patches the Hybrid AKS storage object + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateStorageSpace.json + */ +async function updateStorageSpace() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const storageSpacesName = "test-storage"; + const storageSpaces: StorageSpacesPatch = { + tags: { additionalProperties: "sample" } + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.storageSpacesOperations.beginUpdateAndWait( + resourceGroupName, + storageSpacesName, + storageSpaces + ); + console.log(result); +} + +updateStorageSpace().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksCreateOrUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..655908b0da31 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksCreateOrUpdateSample.ts @@ -0,0 +1,56 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualNetworks, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Puts the Hybrid AKS virtual network + * + * @summary Puts the Hybrid AKS virtual network + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutVirtualNetwork.json + */ +async function putVirtualNetwork() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const virtualNetworksName = "test-vnet-static"; + const virtualNetworks: VirtualNetworks = { + extendedLocation: { + name: + "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourcegroups/test-arcappliance-resgrp/providers/microsoft.extendedlocation/customlocations/testcustomlocation", + type: "CustomLocation" + }, + location: "westus", + properties: { + infraVnetProfile: { + hci: { + mocGroup: "target-group", + mocLocation: "MocLocation", + mocVnetName: "test-vnet" + } + }, + vipPool: [{ endIP: "192.168.0.50", startIP: "192.168.0.10" }], + vmipPool: [{ endIP: "192.168.0.130", startIP: "192.168.0.110" }] + } + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.virtualNetworksOperations.beginCreateOrUpdateAndWait( + resourceGroupName, + virtualNetworksName, + virtualNetworks + ); + console.log(result); +} + +putVirtualNetwork().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksDeleteSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksDeleteSample.ts new file mode 100644 index 000000000000..bbd12a8386b3 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes the Hybrid AKS virtual network + * + * @summary Deletes the Hybrid AKS virtual network + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteVirtualNetwork.json + */ +async function deleteVirtualNetwork() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const virtualNetworksName = "test-vnet-static"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.virtualNetworksOperations.delete( + resourceGroupName, + virtualNetworksName + ); + console.log(result); +} + +deleteVirtualNetwork().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksListByResourceGroupSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..dec15d9f2182 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the Hybrid AKS virtual networks by resource group + * + * @summary Lists the Hybrid AKS virtual networks by resource group + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVirtualNetworkByResourceGroup.json + */ +async function listVirtualNetworkByResourceGroup() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualNetworksOperations.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualNetworkByResourceGroup().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksListBySubscriptionSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksListBySubscriptionSample.ts new file mode 100644 index 000000000000..ca5e58ff216a --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the Hybrid AKS virtual networks by subscription + * + * @summary Lists the Hybrid AKS virtual networks by subscription + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVirtualNetworkBySubscription.json + */ +async function listVirtualNetworkBySubscription() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualNetworksOperations.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualNetworkBySubscription().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksRetrieveSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksRetrieveSample.ts new file mode 100644 index 000000000000..d7abf185e85b --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksRetrieveSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the Hybrid AKS virtual network + * + * @summary Gets the Hybrid AKS virtual network + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetVirtualNetwork.json + */ +async function getVirtualNetwork() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const virtualNetworksName = "test-vnet-static"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.virtualNetworksOperations.retrieve( + resourceGroupName, + virtualNetworksName + ); + console.log(result); +} + +getVirtualNetwork().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksUpdateSample.ts new file mode 100644 index 000000000000..12d7adab54c9 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples-dev/virtualNetworksUpdateSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualNetworksPatch, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patches the Hybrid AKS virtual network + * + * @summary Patches the Hybrid AKS virtual network + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateVirtualNetwork.json + */ +async function updateVirtualNetwork() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const virtualNetworksName = "test-vnet-static"; + const virtualNetworks: VirtualNetworksPatch = { + tags: { additionalProperties: "sample" } + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.virtualNetworksOperations.beginUpdateAndWait( + resourceGroupName, + virtualNetworksName, + virtualNetworks + ); + console.log(result); +} + +updateVirtualNetwork().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/README.md b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/README.md new file mode 100644 index 000000000000..783e5d9e352c --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/README.md @@ -0,0 +1,108 @@ +# client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [agentPoolCreateOrUpdateSample.js][agentpoolcreateorupdatesample] | Creates the agent pool in the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutAgentPool.json | +| [agentPoolDeleteSample.js][agentpooldeletesample] | Deletes the agent pool in the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteAgentPool.json | +| [agentPoolGetSample.js][agentpoolgetsample] | Gets the agent pool in the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetAgentPool.json | +| [agentPoolListByProvisionedClusterSample.js][agentpoollistbyprovisionedclustersample] | Gets the agent pools in the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListAgentPoolByProvisionedCluster.json | +| [agentPoolUpdateSample.js][agentpoolupdatesample] | Updates the agent pool in the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateAgentPool.json | +| [hybridContainerServiceListOrchestratorsSample.js][hybridcontainerservicelistorchestratorssample] | Lists the available orchestrators in a custom location for HybridAKS x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListOrchestrators.json | +| [hybridContainerServiceListVMSkusSample.js][hybridcontainerservicelistvmskussample] | Lists the available VM SKUs in a custom location for HybridAKS x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVMSkus.json | +| [hybridIdentityMetadataDeleteSample.js][hybrididentitymetadatadeletesample] | Deletes the hybrid identity metadata proxy resource. x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteHybridIdentityMetadata.json | +| [hybridIdentityMetadataGetSample.js][hybrididentitymetadatagetsample] | Get the hybrid identity metadata proxy resource. x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetHybridIdentityMetadata.json | +| [hybridIdentityMetadataListByClusterSample.js][hybrididentitymetadatalistbyclustersample] | Lists the hybrid identity metadata proxy resource in a cluster. x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/HybridIdentityMetadataListByCluster.json | +| [hybridIdentityMetadataPutSample.js][hybrididentitymetadataputsample] | Creates the hybrid identity metadata proxy resource that facilitates the managed identity provisioning. x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/CreateHybridIdentityMetadata.json | +| [operationsListSample.js][operationslistsample] | x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListOperations.json | +| [provisionedClustersCreateOrUpdateSample.js][provisionedclusterscreateorupdatesample] | Creates the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutProvisionedCluster.json | +| [provisionedClustersDeleteSample.js][provisionedclustersdeletesample] | Deletes the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteProvisionedCluster.json | +| [provisionedClustersGetSample.js][provisionedclustersgetsample] | Gets the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetProvisionedCluster.json | +| [provisionedClustersListByResourceGroupSample.js][provisionedclusterslistbyresourcegroupsample] | Gets the Hybrid AKS provisioned cluster in a resource group x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListProvisionedClusterByResourceGroup.json | +| [provisionedClustersListBySubscriptionSample.js][provisionedclusterslistbysubscriptionsample] | Gets the Hybrid AKS provisioned cluster in a subscription x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListProvisionedClusterBySubscription.json | +| [provisionedClustersUpdateSample.js][provisionedclustersupdatesample] | Updates the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateProvisionedCluster.json | +| [storageSpacesCreateOrUpdateSample.js][storagespacescreateorupdatesample] | Puts the Hybrid AKS storage object x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutStorageSpace.json | +| [storageSpacesDeleteSample.js][storagespacesdeletesample] | Deletes the Hybrid AKS storage object x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteStorageSpace.json | +| [storageSpacesListByResourceGroupSample.js][storagespaceslistbyresourcegroupsample] | List the Hybrid AKS storage object by resource group x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListStorageSpaceByResourceGroup.json | +| [storageSpacesListBySubscriptionSample.js][storagespaceslistbysubscriptionsample] | List the Hybrid AKS storage object by subscription x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListStorageSpaceBySubscription.json | +| [storageSpacesRetrieveSample.js][storagespacesretrievesample] | Gets the Hybrid AKS storage space object x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetStorageSpace.json | +| [storageSpacesUpdateSample.js][storagespacesupdatesample] | Patches the Hybrid AKS storage object x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateStorageSpace.json | +| [virtualNetworksCreateOrUpdateSample.js][virtualnetworkscreateorupdatesample] | Puts the Hybrid AKS virtual network x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutVirtualNetwork.json | +| [virtualNetworksDeleteSample.js][virtualnetworksdeletesample] | Deletes the Hybrid AKS virtual network x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteVirtualNetwork.json | +| [virtualNetworksListByResourceGroupSample.js][virtualnetworkslistbyresourcegroupsample] | Lists the Hybrid AKS virtual networks by resource group x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVirtualNetworkByResourceGroup.json | +| [virtualNetworksListBySubscriptionSample.js][virtualnetworkslistbysubscriptionsample] | Lists the Hybrid AKS virtual networks by subscription x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVirtualNetworkBySubscription.json | +| [virtualNetworksRetrieveSample.js][virtualnetworksretrievesample] | Gets the Hybrid AKS virtual network x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetVirtualNetwork.json | +| [virtualNetworksUpdateSample.js][virtualnetworksupdatesample] | Patches the Hybrid AKS virtual network x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateVirtualNetwork.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node agentPoolCreateOrUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node agentPoolCreateOrUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[agentpoolcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolCreateOrUpdateSample.js +[agentpooldeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolDeleteSample.js +[agentpoolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolGetSample.js +[agentpoollistbyprovisionedclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolListByProvisionedClusterSample.js +[agentpoolupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolUpdateSample.js +[hybridcontainerservicelistorchestratorssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridContainerServiceListOrchestratorsSample.js +[hybridcontainerservicelistvmskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridContainerServiceListVMSkusSample.js +[hybrididentitymetadatadeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataDeleteSample.js +[hybrididentitymetadatagetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js +[hybrididentitymetadatalistbyclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataListByClusterSample.js +[hybrididentitymetadataputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataPutSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/operationsListSample.js +[provisionedclusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersCreateOrUpdateSample.js +[provisionedclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersDeleteSample.js +[provisionedclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersGetSample.js +[provisionedclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersListByResourceGroupSample.js +[provisionedclusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersListBySubscriptionSample.js +[provisionedclustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersUpdateSample.js +[storagespacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesCreateOrUpdateSample.js +[storagespacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesDeleteSample.js +[storagespaceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesListByResourceGroupSample.js +[storagespaceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesListBySubscriptionSample.js +[storagespacesretrievesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesRetrieveSample.js +[storagespacesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesUpdateSample.js +[virtualnetworkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksCreateOrUpdateSample.js +[virtualnetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksDeleteSample.js +[virtualnetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksListByResourceGroupSample.js +[virtualnetworkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksListBySubscriptionSample.js +[virtualnetworksretrievesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksRetrieveSample.js +[virtualnetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksUpdateSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-hybridcontainerservice?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/README.md diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolCreateOrUpdateSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolCreateOrUpdateSample.js new file mode 100644 index 000000000000..e87c57221442 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolCreateOrUpdateSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates the agent pool in the Hybrid AKS provisioned cluster + * + * @summary Creates the agent pool in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutAgentPool.json + */ +async function putAgentPool() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const agentPoolName = "test-hybridaksnodepool"; + const agentPool = { + count: 1, + location: "westus", + osType: "Linux", + vmSize: "Standard_A4_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.beginCreateOrUpdateAndWait( + resourceGroupName, + provisionedClustersName, + agentPoolName, + agentPool + ); + console.log(result); +} + +putAgentPool().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolDeleteSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolDeleteSample.js new file mode 100644 index 000000000000..dbe0dbdbcfb8 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes the agent pool in the Hybrid AKS provisioned cluster + * + * @summary Deletes the agent pool in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteAgentPool.json + */ +async function deleteAgentPool() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const agentPoolName = "test-hybridaksnodepool"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.delete( + resourceGroupName, + provisionedClustersName, + agentPoolName + ); + console.log(result); +} + +deleteAgentPool().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolGetSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolGetSample.js new file mode 100644 index 000000000000..64613f515b7d --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolGetSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the agent pool in the Hybrid AKS provisioned cluster + * + * @summary Gets the agent pool in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetAgentPool.json + */ +async function getAgentPool() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const agentPoolName = "test-hybridaksnodepool"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.get( + resourceGroupName, + provisionedClustersName, + agentPoolName + ); + console.log(result); +} + +getAgentPool().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolListByProvisionedClusterSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolListByProvisionedClusterSample.js new file mode 100644 index 000000000000..35206ec06fbf --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolListByProvisionedClusterSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the agent pools in the Hybrid AKS provisioned cluster + * + * @summary Gets the agent pools in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListAgentPoolByProvisionedCluster.json + */ +async function listAgentPoolByProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.listByProvisionedCluster( + resourceGroupName, + provisionedClustersName + ); + console.log(result); +} + +listAgentPoolByProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolUpdateSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolUpdateSample.js new file mode 100644 index 000000000000..fc5b99df3b3e --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/agentPoolUpdateSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates the agent pool in the Hybrid AKS provisioned cluster + * + * @summary Updates the agent pool in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateAgentPool.json + */ +async function updateAgentPool() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const agentPoolName = "test-hybridaksnodepool"; + const agentPool = { count: 3, location: "westus" }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.update( + resourceGroupName, + provisionedClustersName, + agentPoolName, + agentPool + ); + console.log(result); +} + +updateAgentPool().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridContainerServiceListOrchestratorsSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridContainerServiceListOrchestratorsSample.js new file mode 100644 index 000000000000..f45aae65dda7 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridContainerServiceListOrchestratorsSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the available orchestrators in a custom location for HybridAKS + * + * @summary Lists the available orchestrators in a custom location for HybridAKS + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListOrchestrators.json + */ +async function listOrchestrators() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const customLocationResourceUri = + "subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridContainerService.listOrchestrators(customLocationResourceUri); + console.log(result); +} + +listOrchestrators().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridContainerServiceListVMSkusSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridContainerServiceListVMSkusSample.js new file mode 100644 index 000000000000..53fe2fb62f25 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridContainerServiceListVMSkusSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the available VM SKUs in a custom location for HybridAKS + * + * @summary Lists the available VM SKUs in a custom location for HybridAKS + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVMSkus.json + */ +async function listVMSkus() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const customLocationResourceUri = + "subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridContainerService.listVMSkus(customLocationResourceUri); + console.log(result); +} + +listVMSkus().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataDeleteSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataDeleteSample.js new file mode 100644 index 000000000000..0561a5f0c952 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes the hybrid identity metadata proxy resource. + * + * @summary Deletes the hybrid identity metadata proxy resource. + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteHybridIdentityMetadata.json + */ +async function deleteHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const provisionedClustersName = "ContosoTargetCluster"; + const hybridIdentityMetadataResourceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridIdentityMetadataOperations.delete( + resourceGroupName, + provisionedClustersName, + hybridIdentityMetadataResourceName + ); + console.log(result); +} + +deleteHybridIdentityMetadata().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js new file mode 100644 index 000000000000..98757f045c91 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataGetSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the hybrid identity metadata proxy resource. + * + * @summary Get the hybrid identity metadata proxy resource. + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetHybridIdentityMetadata.json + */ +async function getHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const provisionedClustersName = "ContosoTargetCluster"; + const hybridIdentityMetadataResourceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridIdentityMetadataOperations.get( + resourceGroupName, + provisionedClustersName, + hybridIdentityMetadataResourceName + ); + console.log(result); +} + +getHybridIdentityMetadata().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataListByClusterSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataListByClusterSample.js new file mode 100644 index 000000000000..f40acef0caf7 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataListByClusterSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the hybrid identity metadata proxy resource in a cluster. + * + * @summary Lists the hybrid identity metadata proxy resource in a cluster. + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/HybridIdentityMetadataListByCluster.json + */ +async function hybridIdentityMetadataListByCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const provisionedClustersName = "ContosoTargetCluster"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hybridIdentityMetadataOperations.listByCluster( + resourceGroupName, + provisionedClustersName + )) { + resArray.push(item); + } + console.log(resArray); +} + +hybridIdentityMetadataListByCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataPutSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataPutSample.js new file mode 100644 index 000000000000..7fd72596fc36 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/hybridIdentityMetadataPutSample.js @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates the hybrid identity metadata proxy resource that facilitates the managed identity provisioning. + * + * @summary Creates the hybrid identity metadata proxy resource that facilitates the managed identity provisioning. + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/CreateHybridIdentityMetadata.json + */ +async function createHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const provisionedClustersName = "ContosoTargetCluster"; + const hybridIdentityMetadataResourceName = "default"; + const body = { + publicKey: "8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2", + resourceUid: "f8b82dff-38ef-4220-99ef-d3a3f86ddc6c", + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridIdentityMetadataOperations.put( + resourceGroupName, + provisionedClustersName, + hybridIdentityMetadataResourceName, + body + ); + console.log(result); +} + +createHybridIdentityMetadata().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/operationsListSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/operationsListSample.js new file mode 100644 index 000000000000..f595f8995cee --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/operationsListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to + * + * @summary + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListOperations.json + */ +async function listOperations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listOperations().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/package.json b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/package.json new file mode 100644 index 000000000000..7804fc4e9b10 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "@azure-samples/arm-hybridcontainerservice-js-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/hybridcontainerservice/arm-hybridcontainerservice" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hybridcontainerservice/arm-hybridcontainerservice", + "dependencies": { + "@azure/arm-hybridcontainerservice": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersCreateOrUpdateSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersCreateOrUpdateSample.js new file mode 100644 index 000000000000..6086a2a095e3 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersCreateOrUpdateSample.js @@ -0,0 +1,94 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates the Hybrid AKS provisioned cluster + * + * @summary Creates the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutProvisionedCluster.json + */ +async function putProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const provisionedClusters = { + extendedLocation: { + name: "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourcegroups/test-arcappliance-resgrp/providers/microsoft.extendedlocation/customlocations/testcustomlocation", + type: "CustomLocation", + }, + location: "westus", + properties: { + agentPoolProfiles: [ + { + name: "default-nodepool-1", + count: 1, + osType: "Linux", + vmSize: "Standard_A4_v2", + }, + ], + cloudProviderProfile: { + infraNetworkProfile: { + vnetSubnetIds: [ + "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.HybridContainerService/virtualNetworks/test-vnet-static", + ], + }, + infraStorageProfile: { + storageSpaceIds: [ + "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.HybridContainerService/storageSpaces/test-storage", + ], + }, + }, + controlPlane: { + count: 1, + linuxProfile: { + ssh: { + publicKeys: [{ keyData: "ssh-rsa AAAAB1NzaC1yc2EAAAADAQABAAACAQCY......" }], + }, + }, + osType: "Linux", + vmSize: "Standard_A4_v2", + }, + kubernetesVersion: "v1.20.5", + linuxProfile: { + ssh: { + publicKeys: [{ keyData: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCY......." }], + }, + }, + networkProfile: { + loadBalancerProfile: { + count: 1, + linuxProfile: { + ssh: { + publicKeys: [{ keyData: "ssh-rsa AAAAB2NzaC1yc2EAAAADAQABAAACAQCY......" }], + }, + }, + osType: "Linux", + vmSize: "Standard_K8S3_v1", + }, + loadBalancerSku: "unstacked-haproxy", + networkPolicy: "calico", + podCidr: "10.244.0.0/16", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.provisionedClustersOperations.beginCreateOrUpdateAndWait( + resourceGroupName, + provisionedClustersName, + provisionedClusters + ); + console.log(result); +} + +putProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersDeleteSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersDeleteSample.js new file mode 100644 index 000000000000..c14975781dab --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersDeleteSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes the Hybrid AKS provisioned cluster + * + * @summary Deletes the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteProvisionedCluster.json + */ +async function deleteProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.provisionedClustersOperations.delete( + resourceGroupName, + provisionedClustersName + ); + console.log(result); +} + +deleteProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersGetSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersGetSample.js new file mode 100644 index 000000000000..21364f5f72b3 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersGetSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the Hybrid AKS provisioned cluster + * + * @summary Gets the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetProvisionedCluster.json + */ +async function getProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.provisionedClustersOperations.get( + resourceGroupName, + provisionedClustersName + ); + console.log(result); +} + +getProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersListByResourceGroupSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersListByResourceGroupSample.js new file mode 100644 index 000000000000..6dd72bf4ecdd --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersListByResourceGroupSample.js @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the Hybrid AKS provisioned cluster in a resource group + * + * @summary Gets the Hybrid AKS provisioned cluster in a resource group + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListProvisionedClusterByResourceGroup.json + */ +async function listProvisionedClusterByResourceGroup() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.provisionedClustersOperations.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listProvisionedClusterByResourceGroup().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersListBySubscriptionSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersListBySubscriptionSample.js new file mode 100644 index 000000000000..df54727294f0 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersListBySubscriptionSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the Hybrid AKS provisioned cluster in a subscription + * + * @summary Gets the Hybrid AKS provisioned cluster in a subscription + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListProvisionedClusterBySubscription.json + */ +async function listProvisionedClusterBySubscription() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.provisionedClustersOperations.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +listProvisionedClusterBySubscription().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersUpdateSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersUpdateSample.js new file mode 100644 index 000000000000..64a631121797 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/provisionedClustersUpdateSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates the Hybrid AKS provisioned cluster + * + * @summary Updates the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateProvisionedCluster.json + */ +async function updateProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const provisionedClusters = { + tags: { additionalProperties: "sample" }, + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.provisionedClustersOperations.beginUpdateAndWait( + resourceGroupName, + provisionedClustersName, + provisionedClusters + ); + console.log(result); +} + +updateProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/sample.env b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesCreateOrUpdateSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesCreateOrUpdateSample.js new file mode 100644 index 000000000000..9933b57b2e54 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesCreateOrUpdateSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Puts the Hybrid AKS storage object + * + * @summary Puts the Hybrid AKS storage object + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutStorageSpace.json + */ +async function putStorageSpace() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const storageSpacesName = "test-storage"; + const storageSpaces = { + extendedLocation: { + name: "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourcegroups/test-arcappliance-resgrp/providers/microsoft.extendedlocation/customlocations/testcustomlocation", + type: "CustomLocation", + }, + location: "westus", + properties: { + hciStorageProfile: { + mocGroup: "target-group", + mocLocation: "MocLocation", + mocStorageContainer: "WssdStorageContainer", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.storageSpacesOperations.beginCreateOrUpdateAndWait( + resourceGroupName, + storageSpacesName, + storageSpaces + ); + console.log(result); +} + +putStorageSpace().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesDeleteSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesDeleteSample.js new file mode 100644 index 000000000000..e2cc6354694d --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesDeleteSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes the Hybrid AKS storage object + * + * @summary Deletes the Hybrid AKS storage object + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteStorageSpace.json + */ +async function deleteStorageSpace() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const storageSpacesName = "test-storage"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.storageSpacesOperations.delete(resourceGroupName, storageSpacesName); + console.log(result); +} + +deleteStorageSpace().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesListByResourceGroupSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesListByResourceGroupSample.js new file mode 100644 index 000000000000..719010d6a49c --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List the Hybrid AKS storage object by resource group + * + * @summary List the Hybrid AKS storage object by resource group + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListStorageSpaceByResourceGroup.json + */ +async function listStorageSpaceByResourceGroup() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageSpacesOperations.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listStorageSpaceByResourceGroup().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesListBySubscriptionSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesListBySubscriptionSample.js new file mode 100644 index 000000000000..787fb770e007 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesListBySubscriptionSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List the Hybrid AKS storage object by subscription + * + * @summary List the Hybrid AKS storage object by subscription + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListStorageSpaceBySubscription.json + */ +async function listStorageSpaceBySubscription() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageSpacesOperations.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +listStorageSpaceBySubscription().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesRetrieveSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesRetrieveSample.js new file mode 100644 index 000000000000..41954ed77af3 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesRetrieveSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the Hybrid AKS storage space object + * + * @summary Gets the Hybrid AKS storage space object + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetStorageSpace.json + */ +async function getStorageSpace() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const storageSpacesName = "test-storage"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.storageSpacesOperations.retrieve( + resourceGroupName, + storageSpacesName + ); + console.log(result); +} + +getStorageSpace().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesUpdateSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesUpdateSample.js new file mode 100644 index 000000000000..b5413d097ed7 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/storageSpacesUpdateSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Patches the Hybrid AKS storage object + * + * @summary Patches the Hybrid AKS storage object + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateStorageSpace.json + */ +async function updateStorageSpace() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const storageSpacesName = "test-storage"; + const storageSpaces = { + tags: { additionalProperties: "sample" }, + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.storageSpacesOperations.beginUpdateAndWait( + resourceGroupName, + storageSpacesName, + storageSpaces + ); + console.log(result); +} + +updateStorageSpace().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksCreateOrUpdateSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksCreateOrUpdateSample.js new file mode 100644 index 000000000000..d78f09ba0094 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksCreateOrUpdateSample.js @@ -0,0 +1,52 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Puts the Hybrid AKS virtual network + * + * @summary Puts the Hybrid AKS virtual network + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutVirtualNetwork.json + */ +async function putVirtualNetwork() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const virtualNetworksName = "test-vnet-static"; + const virtualNetworks = { + extendedLocation: { + name: "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourcegroups/test-arcappliance-resgrp/providers/microsoft.extendedlocation/customlocations/testcustomlocation", + type: "CustomLocation", + }, + location: "westus", + properties: { + infraVnetProfile: { + hci: { + mocGroup: "target-group", + mocLocation: "MocLocation", + mocVnetName: "test-vnet", + }, + }, + vipPool: [{ endIP: "192.168.0.50", startIP: "192.168.0.10" }], + vmipPool: [{ endIP: "192.168.0.130", startIP: "192.168.0.110" }], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.virtualNetworksOperations.beginCreateOrUpdateAndWait( + resourceGroupName, + virtualNetworksName, + virtualNetworks + ); + console.log(result); +} + +putVirtualNetwork().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksDeleteSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksDeleteSample.js new file mode 100644 index 000000000000..deef5c313a4a --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksDeleteSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes the Hybrid AKS virtual network + * + * @summary Deletes the Hybrid AKS virtual network + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteVirtualNetwork.json + */ +async function deleteVirtualNetwork() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const virtualNetworksName = "test-vnet-static"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.virtualNetworksOperations.delete( + resourceGroupName, + virtualNetworksName + ); + console.log(result); +} + +deleteVirtualNetwork().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksListByResourceGroupSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksListByResourceGroupSample.js new file mode 100644 index 000000000000..c850aa31d25f --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the Hybrid AKS virtual networks by resource group + * + * @summary Lists the Hybrid AKS virtual networks by resource group + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVirtualNetworkByResourceGroup.json + */ +async function listVirtualNetworkByResourceGroup() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualNetworksOperations.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualNetworkByResourceGroup().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksListBySubscriptionSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksListBySubscriptionSample.js new file mode 100644 index 000000000000..2c88271a62d8 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksListBySubscriptionSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the Hybrid AKS virtual networks by subscription + * + * @summary Lists the Hybrid AKS virtual networks by subscription + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVirtualNetworkBySubscription.json + */ +async function listVirtualNetworkBySubscription() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualNetworksOperations.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualNetworkBySubscription().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksRetrieveSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksRetrieveSample.js new file mode 100644 index 000000000000..65422941b97a --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksRetrieveSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the Hybrid AKS virtual network + * + * @summary Gets the Hybrid AKS virtual network + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetVirtualNetwork.json + */ +async function getVirtualNetwork() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const virtualNetworksName = "test-vnet-static"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.virtualNetworksOperations.retrieve( + resourceGroupName, + virtualNetworksName + ); + console.log(result); +} + +getVirtualNetwork().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksUpdateSample.js b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksUpdateSample.js new file mode 100644 index 000000000000..8cce23898488 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/javascript/virtualNetworksUpdateSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { HybridContainerServiceClient } = require("@azure/arm-hybridcontainerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Patches the Hybrid AKS virtual network + * + * @summary Patches the Hybrid AKS virtual network + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateVirtualNetwork.json + */ +async function updateVirtualNetwork() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const virtualNetworksName = "test-vnet-static"; + const virtualNetworks = { + tags: { additionalProperties: "sample" }, + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.virtualNetworksOperations.beginUpdateAndWait( + resourceGroupName, + virtualNetworksName, + virtualNetworks + ); + console.log(result); +} + +updateVirtualNetwork().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/README.md b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/README.md new file mode 100644 index 000000000000..78854435ef30 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/README.md @@ -0,0 +1,121 @@ +# client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [agentPoolCreateOrUpdateSample.ts][agentpoolcreateorupdatesample] | Creates the agent pool in the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutAgentPool.json | +| [agentPoolDeleteSample.ts][agentpooldeletesample] | Deletes the agent pool in the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteAgentPool.json | +| [agentPoolGetSample.ts][agentpoolgetsample] | Gets the agent pool in the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetAgentPool.json | +| [agentPoolListByProvisionedClusterSample.ts][agentpoollistbyprovisionedclustersample] | Gets the agent pools in the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListAgentPoolByProvisionedCluster.json | +| [agentPoolUpdateSample.ts][agentpoolupdatesample] | Updates the agent pool in the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateAgentPool.json | +| [hybridContainerServiceListOrchestratorsSample.ts][hybridcontainerservicelistorchestratorssample] | Lists the available orchestrators in a custom location for HybridAKS x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListOrchestrators.json | +| [hybridContainerServiceListVMSkusSample.ts][hybridcontainerservicelistvmskussample] | Lists the available VM SKUs in a custom location for HybridAKS x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVMSkus.json | +| [hybridIdentityMetadataDeleteSample.ts][hybrididentitymetadatadeletesample] | Deletes the hybrid identity metadata proxy resource. x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteHybridIdentityMetadata.json | +| [hybridIdentityMetadataGetSample.ts][hybrididentitymetadatagetsample] | Get the hybrid identity metadata proxy resource. x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetHybridIdentityMetadata.json | +| [hybridIdentityMetadataListByClusterSample.ts][hybrididentitymetadatalistbyclustersample] | Lists the hybrid identity metadata proxy resource in a cluster. x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/HybridIdentityMetadataListByCluster.json | +| [hybridIdentityMetadataPutSample.ts][hybrididentitymetadataputsample] | Creates the hybrid identity metadata proxy resource that facilitates the managed identity provisioning. x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/CreateHybridIdentityMetadata.json | +| [operationsListSample.ts][operationslistsample] | x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListOperations.json | +| [provisionedClustersCreateOrUpdateSample.ts][provisionedclusterscreateorupdatesample] | Creates the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutProvisionedCluster.json | +| [provisionedClustersDeleteSample.ts][provisionedclustersdeletesample] | Deletes the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteProvisionedCluster.json | +| [provisionedClustersGetSample.ts][provisionedclustersgetsample] | Gets the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetProvisionedCluster.json | +| [provisionedClustersListByResourceGroupSample.ts][provisionedclusterslistbyresourcegroupsample] | Gets the Hybrid AKS provisioned cluster in a resource group x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListProvisionedClusterByResourceGroup.json | +| [provisionedClustersListBySubscriptionSample.ts][provisionedclusterslistbysubscriptionsample] | Gets the Hybrid AKS provisioned cluster in a subscription x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListProvisionedClusterBySubscription.json | +| [provisionedClustersUpdateSample.ts][provisionedclustersupdatesample] | Updates the Hybrid AKS provisioned cluster x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateProvisionedCluster.json | +| [storageSpacesCreateOrUpdateSample.ts][storagespacescreateorupdatesample] | Puts the Hybrid AKS storage object x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutStorageSpace.json | +| [storageSpacesDeleteSample.ts][storagespacesdeletesample] | Deletes the Hybrid AKS storage object x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteStorageSpace.json | +| [storageSpacesListByResourceGroupSample.ts][storagespaceslistbyresourcegroupsample] | List the Hybrid AKS storage object by resource group x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListStorageSpaceByResourceGroup.json | +| [storageSpacesListBySubscriptionSample.ts][storagespaceslistbysubscriptionsample] | List the Hybrid AKS storage object by subscription x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListStorageSpaceBySubscription.json | +| [storageSpacesRetrieveSample.ts][storagespacesretrievesample] | Gets the Hybrid AKS storage space object x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetStorageSpace.json | +| [storageSpacesUpdateSample.ts][storagespacesupdatesample] | Patches the Hybrid AKS storage object x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateStorageSpace.json | +| [virtualNetworksCreateOrUpdateSample.ts][virtualnetworkscreateorupdatesample] | Puts the Hybrid AKS virtual network x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutVirtualNetwork.json | +| [virtualNetworksDeleteSample.ts][virtualnetworksdeletesample] | Deletes the Hybrid AKS virtual network x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteVirtualNetwork.json | +| [virtualNetworksListByResourceGroupSample.ts][virtualnetworkslistbyresourcegroupsample] | Lists the Hybrid AKS virtual networks by resource group x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVirtualNetworkByResourceGroup.json | +| [virtualNetworksListBySubscriptionSample.ts][virtualnetworkslistbysubscriptionsample] | Lists the Hybrid AKS virtual networks by subscription x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVirtualNetworkBySubscription.json | +| [virtualNetworksRetrieveSample.ts][virtualnetworksretrievesample] | Gets the Hybrid AKS virtual network x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetVirtualNetwork.json | +| [virtualNetworksUpdateSample.ts][virtualnetworksupdatesample] | Patches the Hybrid AKS virtual network x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateVirtualNetwork.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/agentPoolCreateOrUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/agentPoolCreateOrUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[agentpoolcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolCreateOrUpdateSample.ts +[agentpooldeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolDeleteSample.ts +[agentpoolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolGetSample.ts +[agentpoollistbyprovisionedclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolListByProvisionedClusterSample.ts +[agentpoolupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolUpdateSample.ts +[hybridcontainerservicelistorchestratorssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridContainerServiceListOrchestratorsSample.ts +[hybridcontainerservicelistvmskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridContainerServiceListVMSkusSample.ts +[hybrididentitymetadatadeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataDeleteSample.ts +[hybrididentitymetadatagetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataGetSample.ts +[hybrididentitymetadatalistbyclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataListByClusterSample.ts +[hybrididentitymetadataputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataPutSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/operationsListSample.ts +[provisionedclusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersCreateOrUpdateSample.ts +[provisionedclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersDeleteSample.ts +[provisionedclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersGetSample.ts +[provisionedclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersListByResourceGroupSample.ts +[provisionedclusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersListBySubscriptionSample.ts +[provisionedclustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersUpdateSample.ts +[storagespacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesCreateOrUpdateSample.ts +[storagespacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesDeleteSample.ts +[storagespaceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesListByResourceGroupSample.ts +[storagespaceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesListBySubscriptionSample.ts +[storagespacesretrievesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesRetrieveSample.ts +[storagespacesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesUpdateSample.ts +[virtualnetworkscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksCreateOrUpdateSample.ts +[virtualnetworksdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksDeleteSample.ts +[virtualnetworkslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksListByResourceGroupSample.ts +[virtualnetworkslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksListBySubscriptionSample.ts +[virtualnetworksretrievesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksRetrieveSample.ts +[virtualnetworksupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksUpdateSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-hybridcontainerservice?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hybridcontainerservice/arm-hybridcontainerservice/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/package.json b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/package.json new file mode 100644 index 000000000000..8588f1aebe08 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure-samples/arm-hybridcontainerservice-ts-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/hybridcontainerservice/arm-hybridcontainerservice" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hybridcontainerservice/arm-hybridcontainerservice", + "dependencies": { + "@azure/arm-hybridcontainerservice": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.8.0", + "rimraf": "latest" + } +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/sample.env b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolCreateOrUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolCreateOrUpdateSample.ts new file mode 100644 index 000000000000..5c1cf54b9a0f --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolCreateOrUpdateSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AgentPool, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates the agent pool in the Hybrid AKS provisioned cluster + * + * @summary Creates the agent pool in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutAgentPool.json + */ +async function putAgentPool() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const agentPoolName = "test-hybridaksnodepool"; + const agentPool: AgentPool = { + count: 1, + location: "westus", + osType: "Linux", + vmSize: "Standard_A4_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.beginCreateOrUpdateAndWait( + resourceGroupName, + provisionedClustersName, + agentPoolName, + agentPool + ); + console.log(result); +} + +putAgentPool().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolDeleteSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolDeleteSample.ts new file mode 100644 index 000000000000..86fe564f8a27 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes the agent pool in the Hybrid AKS provisioned cluster + * + * @summary Deletes the agent pool in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteAgentPool.json + */ +async function deleteAgentPool() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const agentPoolName = "test-hybridaksnodepool"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.delete( + resourceGroupName, + provisionedClustersName, + agentPoolName + ); + console.log(result); +} + +deleteAgentPool().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolGetSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolGetSample.ts new file mode 100644 index 000000000000..b79fba5df4d0 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the agent pool in the Hybrid AKS provisioned cluster + * + * @summary Gets the agent pool in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetAgentPool.json + */ +async function getAgentPool() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const agentPoolName = "test-hybridaksnodepool"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.get( + resourceGroupName, + provisionedClustersName, + agentPoolName + ); + console.log(result); +} + +getAgentPool().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolListByProvisionedClusterSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolListByProvisionedClusterSample.ts new file mode 100644 index 000000000000..13483713d3de --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolListByProvisionedClusterSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the agent pools in the Hybrid AKS provisioned cluster + * + * @summary Gets the agent pools in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListAgentPoolByProvisionedCluster.json + */ +async function listAgentPoolByProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.listByProvisionedCluster( + resourceGroupName, + provisionedClustersName + ); + console.log(result); +} + +listAgentPoolByProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolUpdateSample.ts new file mode 100644 index 000000000000..c53350561538 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/agentPoolUpdateSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AgentPool, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates the agent pool in the Hybrid AKS provisioned cluster + * + * @summary Updates the agent pool in the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateAgentPool.json + */ +async function updateAgentPool() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const agentPoolName = "test-hybridaksnodepool"; + const agentPool: AgentPool = { count: 3, location: "westus" }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.agentPoolOperations.update( + resourceGroupName, + provisionedClustersName, + agentPoolName, + agentPool + ); + console.log(result); +} + +updateAgentPool().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridContainerServiceListOrchestratorsSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridContainerServiceListOrchestratorsSample.ts new file mode 100644 index 000000000000..c0f643e4d528 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridContainerServiceListOrchestratorsSample.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the available orchestrators in a custom location for HybridAKS + * + * @summary Lists the available orchestrators in a custom location for HybridAKS + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListOrchestrators.json + */ +async function listOrchestrators() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const customLocationResourceUri = + "subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridContainerService.listOrchestrators( + customLocationResourceUri + ); + console.log(result); +} + +listOrchestrators().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridContainerServiceListVMSkusSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridContainerServiceListVMSkusSample.ts new file mode 100644 index 000000000000..6abbee4acd68 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridContainerServiceListVMSkusSample.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the available VM SKUs in a custom location for HybridAKS + * + * @summary Lists the available VM SKUs in a custom location for HybridAKS + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVMSkus.json + */ +async function listVMSkus() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const customLocationResourceUri = + "subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridContainerService.listVMSkus( + customLocationResourceUri + ); + console.log(result); +} + +listVMSkus().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataDeleteSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataDeleteSample.ts new file mode 100644 index 000000000000..e19237e5d630 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes the hybrid identity metadata proxy resource. + * + * @summary Deletes the hybrid identity metadata proxy resource. + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteHybridIdentityMetadata.json + */ +async function deleteHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const provisionedClustersName = "ContosoTargetCluster"; + const hybridIdentityMetadataResourceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridIdentityMetadataOperations.delete( + resourceGroupName, + provisionedClustersName, + hybridIdentityMetadataResourceName + ); + console.log(result); +} + +deleteHybridIdentityMetadata().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataGetSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataGetSample.ts new file mode 100644 index 000000000000..f4f4bdb3b295 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the hybrid identity metadata proxy resource. + * + * @summary Get the hybrid identity metadata proxy resource. + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetHybridIdentityMetadata.json + */ +async function getHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const provisionedClustersName = "ContosoTargetCluster"; + const hybridIdentityMetadataResourceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridIdentityMetadataOperations.get( + resourceGroupName, + provisionedClustersName, + hybridIdentityMetadataResourceName + ); + console.log(result); +} + +getHybridIdentityMetadata().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataListByClusterSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataListByClusterSample.ts new file mode 100644 index 000000000000..116a777351a8 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataListByClusterSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the hybrid identity metadata proxy resource in a cluster. + * + * @summary Lists the hybrid identity metadata proxy resource in a cluster. + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/HybridIdentityMetadataListByCluster.json + */ +async function hybridIdentityMetadataListByCluster() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const provisionedClustersName = "ContosoTargetCluster"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.hybridIdentityMetadataOperations.listByCluster( + resourceGroupName, + provisionedClustersName + )) { + resArray.push(item); + } + console.log(resArray); +} + +hybridIdentityMetadataListByCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataPutSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataPutSample.ts new file mode 100644 index 000000000000..6c2e0b8e7aee --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/hybridIdentityMetadataPutSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + HybridIdentityMetadata, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates the hybrid identity metadata proxy resource that facilitates the managed identity provisioning. + * + * @summary Creates the hybrid identity metadata proxy resource that facilitates the managed identity provisioning. + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/CreateHybridIdentityMetadata.json + */ +async function createHybridIdentityMetadata() { + const subscriptionId = "fd3c3665-1729-4b7b-9a38-238e83b0f98b"; + const resourceGroupName = "testrg"; + const provisionedClustersName = "ContosoTargetCluster"; + const hybridIdentityMetadataResourceName = "default"; + const body: HybridIdentityMetadata = { + publicKey: "8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2", + resourceUid: "f8b82dff-38ef-4220-99ef-d3a3f86ddc6c" + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.hybridIdentityMetadataOperations.put( + resourceGroupName, + provisionedClustersName, + hybridIdentityMetadataResourceName, + body + ); + console.log(result); +} + +createHybridIdentityMetadata().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..048c9110d47d --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/operationsListSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to + * + * @summary + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListOperations.json + */ +async function listOperations() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listOperations().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersCreateOrUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersCreateOrUpdateSample.ts new file mode 100644 index 000000000000..1c9e12b41b04 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersCreateOrUpdateSample.ts @@ -0,0 +1,104 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ProvisionedClusters, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates the Hybrid AKS provisioned cluster + * + * @summary Creates the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutProvisionedCluster.json + */ +async function putProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const provisionedClusters: ProvisionedClusters = { + extendedLocation: { + name: + "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourcegroups/test-arcappliance-resgrp/providers/microsoft.extendedlocation/customlocations/testcustomlocation", + type: "CustomLocation" + }, + location: "westus", + properties: { + agentPoolProfiles: [ + { + name: "default-nodepool-1", + count: 1, + osType: "Linux", + vmSize: "Standard_A4_v2" + } + ], + cloudProviderProfile: { + infraNetworkProfile: { + vnetSubnetIds: [ + "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.HybridContainerService/virtualNetworks/test-vnet-static" + ] + }, + infraStorageProfile: { + storageSpaceIds: [ + "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourceGroups/test-arcappliance-resgrp/providers/Microsoft.HybridContainerService/storageSpaces/test-storage" + ] + } + }, + controlPlane: { + count: 1, + linuxProfile: { + ssh: { + publicKeys: [ + { keyData: "ssh-rsa AAAAB1NzaC1yc2EAAAADAQABAAACAQCY......" } + ] + } + }, + osType: "Linux", + vmSize: "Standard_A4_v2" + }, + kubernetesVersion: "v1.20.5", + linuxProfile: { + ssh: { + publicKeys: [ + { keyData: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCY......." } + ] + } + }, + networkProfile: { + loadBalancerProfile: { + count: 1, + linuxProfile: { + ssh: { + publicKeys: [ + { keyData: "ssh-rsa AAAAB2NzaC1yc2EAAAADAQABAAACAQCY......" } + ] + } + }, + osType: "Linux", + vmSize: "Standard_K8S3_v1" + }, + loadBalancerSku: "unstacked-haproxy", + networkPolicy: "calico", + podCidr: "10.244.0.0/16" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.provisionedClustersOperations.beginCreateOrUpdateAndWait( + resourceGroupName, + provisionedClustersName, + provisionedClusters + ); + console.log(result); +} + +putProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersDeleteSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersDeleteSample.ts new file mode 100644 index 000000000000..716ea1932549 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes the Hybrid AKS provisioned cluster + * + * @summary Deletes the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteProvisionedCluster.json + */ +async function deleteProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.provisionedClustersOperations.delete( + resourceGroupName, + provisionedClustersName + ); + console.log(result); +} + +deleteProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersGetSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersGetSample.ts new file mode 100644 index 000000000000..3141f268bb86 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the Hybrid AKS provisioned cluster + * + * @summary Gets the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetProvisionedCluster.json + */ +async function getProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.provisionedClustersOperations.get( + resourceGroupName, + provisionedClustersName + ); + console.log(result); +} + +getProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersListByResourceGroupSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersListByResourceGroupSample.ts new file mode 100644 index 000000000000..c6cf5f4ffa57 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the Hybrid AKS provisioned cluster in a resource group + * + * @summary Gets the Hybrid AKS provisioned cluster in a resource group + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListProvisionedClusterByResourceGroup.json + */ +async function listProvisionedClusterByResourceGroup() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.provisionedClustersOperations.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listProvisionedClusterByResourceGroup().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersListBySubscriptionSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersListBySubscriptionSample.ts new file mode 100644 index 000000000000..eb1e974752a4 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the Hybrid AKS provisioned cluster in a subscription + * + * @summary Gets the Hybrid AKS provisioned cluster in a subscription + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListProvisionedClusterBySubscription.json + */ +async function listProvisionedClusterBySubscription() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.provisionedClustersOperations.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +listProvisionedClusterBySubscription().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersUpdateSample.ts new file mode 100644 index 000000000000..0a91a5fea135 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/provisionedClustersUpdateSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ProvisionedClustersPatch, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates the Hybrid AKS provisioned cluster + * + * @summary Updates the Hybrid AKS provisioned cluster + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateProvisionedCluster.json + */ +async function updateProvisionedCluster() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const provisionedClustersName = "test-hybridakscluster"; + const provisionedClusters: ProvisionedClustersPatch = { + tags: { additionalProperties: "sample" } + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.provisionedClustersOperations.beginUpdateAndWait( + resourceGroupName, + provisionedClustersName, + provisionedClusters + ); + console.log(result); +} + +updateProvisionedCluster().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesCreateOrUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f3c13ad870a2 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesCreateOrUpdateSample.ts @@ -0,0 +1,52 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageSpaces, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Puts the Hybrid AKS storage object + * + * @summary Puts the Hybrid AKS storage object + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutStorageSpace.json + */ +async function putStorageSpace() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const storageSpacesName = "test-storage"; + const storageSpaces: StorageSpaces = { + extendedLocation: { + name: + "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourcegroups/test-arcappliance-resgrp/providers/microsoft.extendedlocation/customlocations/testcustomlocation", + type: "CustomLocation" + }, + location: "westus", + properties: { + hciStorageProfile: { + mocGroup: "target-group", + mocLocation: "MocLocation", + mocStorageContainer: "WssdStorageContainer" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.storageSpacesOperations.beginCreateOrUpdateAndWait( + resourceGroupName, + storageSpacesName, + storageSpaces + ); + console.log(result); +} + +putStorageSpace().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesDeleteSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesDeleteSample.ts new file mode 100644 index 000000000000..263e2ed47ee4 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes the Hybrid AKS storage object + * + * @summary Deletes the Hybrid AKS storage object + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteStorageSpace.json + */ +async function deleteStorageSpace() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const storageSpacesName = "test-storage"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.storageSpacesOperations.delete( + resourceGroupName, + storageSpacesName + ); + console.log(result); +} + +deleteStorageSpace().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesListByResourceGroupSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesListByResourceGroupSample.ts new file mode 100644 index 000000000000..6176906001f9 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List the Hybrid AKS storage object by resource group + * + * @summary List the Hybrid AKS storage object by resource group + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListStorageSpaceByResourceGroup.json + */ +async function listStorageSpaceByResourceGroup() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageSpacesOperations.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listStorageSpaceByResourceGroup().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesListBySubscriptionSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesListBySubscriptionSample.ts new file mode 100644 index 000000000000..cf621f9c21bb --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List the Hybrid AKS storage object by subscription + * + * @summary List the Hybrid AKS storage object by subscription + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListStorageSpaceBySubscription.json + */ +async function listStorageSpaceBySubscription() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storageSpacesOperations.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +listStorageSpaceBySubscription().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesRetrieveSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesRetrieveSample.ts new file mode 100644 index 000000000000..e51b21db454d --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesRetrieveSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the Hybrid AKS storage space object + * + * @summary Gets the Hybrid AKS storage space object + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetStorageSpace.json + */ +async function getStorageSpace() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const storageSpacesName = "test-storage"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.storageSpacesOperations.retrieve( + resourceGroupName, + storageSpacesName + ); + console.log(result); +} + +getStorageSpace().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesUpdateSample.ts new file mode 100644 index 000000000000..9a46fcc8cbf0 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/storageSpacesUpdateSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageSpacesPatch, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patches the Hybrid AKS storage object + * + * @summary Patches the Hybrid AKS storage object + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateStorageSpace.json + */ +async function updateStorageSpace() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const storageSpacesName = "test-storage"; + const storageSpaces: StorageSpacesPatch = { + tags: { additionalProperties: "sample" } + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.storageSpacesOperations.beginUpdateAndWait( + resourceGroupName, + storageSpacesName, + storageSpaces + ); + console.log(result); +} + +updateStorageSpace().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksCreateOrUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksCreateOrUpdateSample.ts new file mode 100644 index 000000000000..655908b0da31 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksCreateOrUpdateSample.ts @@ -0,0 +1,56 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualNetworks, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Puts the Hybrid AKS virtual network + * + * @summary Puts the Hybrid AKS virtual network + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/PutVirtualNetwork.json + */ +async function putVirtualNetwork() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const virtualNetworksName = "test-vnet-static"; + const virtualNetworks: VirtualNetworks = { + extendedLocation: { + name: + "/subscriptions/a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b/resourcegroups/test-arcappliance-resgrp/providers/microsoft.extendedlocation/customlocations/testcustomlocation", + type: "CustomLocation" + }, + location: "westus", + properties: { + infraVnetProfile: { + hci: { + mocGroup: "target-group", + mocLocation: "MocLocation", + mocVnetName: "test-vnet" + } + }, + vipPool: [{ endIP: "192.168.0.50", startIP: "192.168.0.10" }], + vmipPool: [{ endIP: "192.168.0.130", startIP: "192.168.0.110" }] + } + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.virtualNetworksOperations.beginCreateOrUpdateAndWait( + resourceGroupName, + virtualNetworksName, + virtualNetworks + ); + console.log(result); +} + +putVirtualNetwork().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksDeleteSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksDeleteSample.ts new file mode 100644 index 000000000000..bbd12a8386b3 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes the Hybrid AKS virtual network + * + * @summary Deletes the Hybrid AKS virtual network + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/DeleteVirtualNetwork.json + */ +async function deleteVirtualNetwork() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const virtualNetworksName = "test-vnet-static"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.virtualNetworksOperations.delete( + resourceGroupName, + virtualNetworksName + ); + console.log(result); +} + +deleteVirtualNetwork().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksListByResourceGroupSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksListByResourceGroupSample.ts new file mode 100644 index 000000000000..dec15d9f2182 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the Hybrid AKS virtual networks by resource group + * + * @summary Lists the Hybrid AKS virtual networks by resource group + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVirtualNetworkByResourceGroup.json + */ +async function listVirtualNetworkByResourceGroup() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualNetworksOperations.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualNetworkByResourceGroup().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksListBySubscriptionSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksListBySubscriptionSample.ts new file mode 100644 index 000000000000..ca5e58ff216a --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the Hybrid AKS virtual networks by subscription + * + * @summary Lists the Hybrid AKS virtual networks by subscription + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/ListVirtualNetworkBySubscription.json + */ +async function listVirtualNetworkBySubscription() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.virtualNetworksOperations.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +listVirtualNetworkBySubscription().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksRetrieveSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksRetrieveSample.ts new file mode 100644 index 000000000000..d7abf185e85b --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksRetrieveSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { HybridContainerServiceClient } from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the Hybrid AKS virtual network + * + * @summary Gets the Hybrid AKS virtual network + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/GetVirtualNetwork.json + */ +async function getVirtualNetwork() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const virtualNetworksName = "test-vnet-static"; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.virtualNetworksOperations.retrieve( + resourceGroupName, + virtualNetworksName + ); + console.log(result); +} + +getVirtualNetwork().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksUpdateSample.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksUpdateSample.ts new file mode 100644 index 000000000000..12d7adab54c9 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/src/virtualNetworksUpdateSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VirtualNetworksPatch, + HybridContainerServiceClient +} from "@azure/arm-hybridcontainerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Patches the Hybrid AKS virtual network + * + * @summary Patches the Hybrid AKS virtual network + * x-ms-original-file: specification/hybridaks/resource-manager/Microsoft.HybridContainerService/preview/2022-05-01-preview/examples/UpdateVirtualNetwork.json + */ +async function updateVirtualNetwork() { + const subscriptionId = "a3e42606-29b1-4d7d-b1d9-9ff6b9d3c71b"; + const resourceGroupName = "test-arcappliance-resgrp"; + const virtualNetworksName = "test-vnet-static"; + const virtualNetworks: VirtualNetworksPatch = { + tags: { additionalProperties: "sample" } + }; + const credential = new DefaultAzureCredential(); + const client = new HybridContainerServiceClient(credential, subscriptionId); + const result = await client.virtualNetworksOperations.beginUpdateAndWait( + resourceGroupName, + virtualNetworksName, + virtualNetworks + ); + console.log(result); +} + +updateVirtualNetwork().catch(console.error); diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/tsconfig.json b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/samples/v1-beta/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/hybridContainerServiceClient.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/hybridContainerServiceClient.ts new file mode 100644 index 000000000000..8ba99e83d2fd --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/hybridContainerServiceClient.ts @@ -0,0 +1,172 @@ +/* + * 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 * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; +import * as coreAuth from "@azure/core-auth"; +import { + ProvisionedClustersOperationsImpl, + HybridIdentityMetadataOperationsImpl, + AgentPoolOperationsImpl, + HybridContainerServiceImpl, + OperationsImpl, + VirtualNetworksOperationsImpl, + StorageSpacesOperationsImpl +} from "./operations"; +import { + ProvisionedClustersOperations, + HybridIdentityMetadataOperations, + AgentPoolOperations, + HybridContainerService, + Operations, + VirtualNetworksOperations, + StorageSpacesOperations +} from "./operationsInterfaces"; +import { HybridContainerServiceClientOptionalParams } from "./models"; + +export class HybridContainerServiceClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the HybridContainerServiceClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: HybridContainerServiceClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: HybridContainerServiceClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-hybridcontainerservice/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com" + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + 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 ?? + `${optionsWithDefaults.endpoint}/.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-05-01-preview"; + this.provisionedClustersOperations = new ProvisionedClustersOperationsImpl( + this + ); + this.hybridIdentityMetadataOperations = new HybridIdentityMetadataOperationsImpl( + this + ); + this.agentPoolOperations = new AgentPoolOperationsImpl(this); + this.hybridContainerService = new HybridContainerServiceImpl(this); + this.operations = new OperationsImpl(this); + this.virtualNetworksOperations = new VirtualNetworksOperationsImpl(this); + this.storageSpacesOperations = new StorageSpacesOperationsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + provisionedClustersOperations: ProvisionedClustersOperations; + hybridIdentityMetadataOperations: HybridIdentityMetadataOperations; + agentPoolOperations: AgentPoolOperations; + hybridContainerService: HybridContainerService; + operations: Operations; + virtualNetworksOperations: VirtualNetworksOperations; + storageSpacesOperations: StorageSpacesOperations; +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/index.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/index.ts new file mode 100644 index 000000000000..27a709abaf49 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export { getContinuationToken } from "./pagingHelper"; +export * from "./models"; +export { HybridContainerServiceClient } from "./hybridContainerServiceClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/lroImpl.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * 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 { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export class LroImpl implements LongRunningOperation { + constructor( + private sendOperationFn: (args: any, spec: any) => Promise>, + private args: Record, + private spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record, + public requestPath: string = spec.path!, + public requestMethod: string = spec.httpMethod + ) {} + public async sendInitialRequest(): Promise> { + return this.sendOperationFn(this.args, this.spec); + } + public async sendPollRequest(path: string): Promise> { + const { requestBody, ...restSpec } = this.spec; + return this.sendOperationFn(this.args, { + ...restSpec, + path, + httpMethod: "GET" + }); + } +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/models/index.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/models/index.ts new file mode 100644 index 000000000000..e55cebeafd3b --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/models/index.ts @@ -0,0 +1,1514 @@ +/* + * 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 * as coreClient from "@azure/core-client"; + +/** Identity for the Provisioned cluster. */ +export interface ProvisionedClusterIdentity { + /** + * The principal id of provisioned cluster identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant id associated with the provisioned cluster. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The type of identity used for the provisioned cluster. The type SystemAssigned, includes a system created identity. The type None means no identity is assigned to the provisioned cluster. */ + type: ResourceIdentityType; +} + +/** Properties of provisioned clusters without the corresponding secrets */ +export interface ProvisionedClustersPropertiesWithoutSecrets { + /** AAD profile for the provisioned cluster. */ + aadProfile?: AADProfileResponse; + /** WindowsProfile - Profile for Windows VMs in the Provisioned Cluster. */ + windowsProfile?: WindowsProfileResponse; + /** HttpProxyConfig - Configurations for provisioning the cluster with HTTP proxy servers. */ + httpProxyConfig?: HttpProxyConfigResponse; +} + +/** AAD Profile specifies attributes for Azure Active Directory integration. */ +export interface AADProfileResponse { + /** The list of AAD group object IDs that will have admin role of the cluster. */ + adminGroupObjectIDs?: string[]; + /** The client AAD application ID. */ + clientAppID?: string; + /** Whether to enable Azure RBAC for Kubernetes authorization. */ + enableAzureRbac?: boolean; + /** Whether to enable managed AAD. */ + managed?: boolean; + /** The server AAD application ID. */ + serverAppID?: string; + /** The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. */ + tenantID?: string; +} + +/** Profile for Windows VMs in the container service cluster. */ +export interface WindowsProfileResponse { + /** AdminUsername - Specifies the name of the administrator account.

**restriction:** Cannot end in "."

**Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters */ + adminUsername?: string; + /** EnableCSIProxy - Whether to enable CSI proxy. */ + enableCsiProxy?: boolean; + /** LicenseType - The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User Benefits for Windows VMs. Possible values include: 'None', 'Windows_Server' */ + licenseType?: LicenseType; +} + +/** Configurations for provisioning the cluster with HTTP proxy servers. */ +export interface HttpProxyConfigResponse { + /** The HTTP proxy server endpoint to use. */ + httpProxy?: string; + /** The HTTPS proxy server endpoint to use. */ + httpsProxy?: string; + /** The endpoints that should not go through proxy. */ + noProxy?: string[]; + /** Alternative CA cert to use for connecting to proxy servers. */ + trustedCa?: string; + /** Username to use for connecting to proxy server */ + username?: string; +} + +/** HybridAKSClusterSpec defines the desired state of HybridAKSCluster */ +export interface ProvisionedClustersCommonProperties { + /** EnableRBAC - Whether to enable Kubernetes Role-Based Access Control. */ + enableRbac?: boolean; + /** LinuxProfile - The profile for Linux VMs in the Provisioned Cluster. */ + linuxProfile?: LinuxProfileProperties; + /** Additional features specs like Arc Agent Onboarding. */ + features?: ProvisionedClustersCommonPropertiesFeatures; + /** AddonProfiles - Profile of managed cluster add-on. */ + addonProfiles?: { [propertyName: string]: AddonProfiles }; + /** ControlPlane - ControlPlane Configuration */ + controlPlane?: ControlPlaneProfile; + /** KubernetesVersion - Version of Kubernetes specified when creating the managed cluster. */ + kubernetesVersion?: string; + /** NetworkProfile - Profile of network configuration. */ + networkProfile?: NetworkProfile; + /** NodeResourceGroup - Name of the resource group containing agent pool nodes. */ + nodeResourceGroup?: string; + /** The agent pools of the cluster. */ + agentPoolProfiles?: NamedAgentPoolProfile[]; + /** The underlying cloud infra provider properties. */ + cloudProviderProfile?: CloudProviderProfile; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly provisioningState?: ProvisioningState; + /** + * HybridAKSClusterStatus defines the observed state of HybridAKSCluster + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: ProvisionedClustersCommonPropertiesStatus; +} + +/** LinuxProfile - Profile for Linux VMs in the container service cluster. */ +export interface LinuxProfileProperties { + /** AdminUsername - The administrator username to use for Linux VMs. */ + adminUsername?: string; + /** SSH - SSH configuration for Linux-based VMs running on Azure. */ + ssh?: LinuxProfilePropertiesSsh; +} + +/** SSH - SSH configuration for Linux-based VMs running on Azure. */ +export interface LinuxProfilePropertiesSsh { + /** PublicKeys - The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. */ + publicKeys?: LinuxProfilePropertiesSshPublicKeysItem[]; +} + +export interface LinuxProfilePropertiesSshPublicKeysItem { + /** KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. */ + keyData?: string; +} + +/** Additional features specs like Arc Agent Onboarding. */ +export interface ProvisionedClustersCommonPropertiesFeatures { + /** Arc agentry configuration for the provisioned cluster. */ + arcAgentProfile?: ArcAgentProfile; +} + +/** Defines the Arc Agent properties for the Provisioned clusters. */ +export interface ArcAgentProfile { + /** Version of the Arc agents to be installed on the provisioned Provisioned cluster resource */ + agentVersion?: string; + /** Indicates whether the Arc agents on the provisioned clusters be upgraded automatically to the latest version. Defaults to Enabled. */ + agentAutoUpgrade?: AutoUpgradeOptions; +} + +/** Addon configurations */ +export interface AddonProfiles { + /** Config - Key-value pairs for configuring an add-on. */ + config?: { [propertyName: string]: string }; + /** Enabled - Whether the add-on is enabled or not. */ + enabled?: boolean; +} + +/** NodePool configuration */ +export interface AgentPoolProfile { + /** Count - Number of agents to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. */ + count?: number; + /** AvailabilityZones - The list of Availability zones to use for nodes. Datacenter racks modelled as zones */ + availabilityZones?: string[]; + /** The maximum number of nodes for auto-scaling */ + maxCount?: number; + /** The maximum number of pods that can run on a node. */ + maxPods?: number; + /** The minimum number of nodes for auto-scaling */ + minCount?: number; + /** Mode - AgentPoolMode represents mode of an agent pool. Possible values include: 'System', 'LB', 'User'. Default is 'User' */ + mode?: Mode; + /** NodeLabels - Agent pool node labels to be persisted across all nodes in agent pool. */ + nodeLabels?: { [propertyName: string]: string }; + /** NodeTaints - Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. */ + nodeTaints?: string[]; + /** OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' */ + osType?: OsType; + /** The version of node image */ + nodeImageVersion?: string; + /** VmSize - The size of the agent pool VMs. */ + vmSize?: string; + /** The underlying cloud infra provider properties. */ + cloudProviderProfile?: CloudProviderProfile; +} + +/** CloudProviderProfile - The underlying cloud infra provider properties. */ +export interface CloudProviderProfile { + /** InfraNetworkProfile - List of infra network profiles for the provisioned cluster */ + infraNetworkProfile?: CloudProviderProfileInfraNetworkProfile; + /** InfraStorageProfile - List of infra storage profiles for the provisioned cluster */ + infraStorageProfile?: CloudProviderProfileInfraStorageProfile; +} + +/** InfraNetworkProfile - List of infra network profiles for the provisioned cluster */ +export interface CloudProviderProfileInfraNetworkProfile { + /** Array of references to azure resource corresponding to the new HybridAKSNetwork object e.g. /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/virtualNetworks/{virtualNetworkName} */ + vnetSubnetIds?: string[]; +} + +/** InfraStorageProfile - List of infra storage profiles for the provisioned cluster */ +export interface CloudProviderProfileInfraStorageProfile { + /** Reference to azure resource corresponding to the new HybridAKSStorage object e.g. /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/storageSpaces/{storageSpaceName} */ + storageSpaceIds?: string[]; +} + +/** AgentPool Name */ +export interface AgentPoolName { + /** Unique name of the agent pool profile in the context of the subscription and resource group. */ + name?: string; +} + +/** controlPlaneEndpoint - API server endpoint for the control plane */ +export interface ControlPlaneEndpointProfile { + /** API server endpoint for the control plane */ + controlPlaneEndpoint?: ControlPlaneEndpointProfileControlPlaneEndpoint; +} + +/** API server endpoint for the control plane */ +export interface ControlPlaneEndpointProfileControlPlaneEndpoint { + /** Host IP address for API server */ + hostIP?: string; + /** Port for the API server */ + port?: string; +} + +/** LinuxProfile - Profile for Linux VMs in the container service cluster. */ +export interface LinuxProfile { + /** Profile for Linux VMs in the container service cluster. */ + linuxProfile?: LinuxProfileProperties; +} + +/** NetworkProfile - Profile of network configuration. */ +export interface NetworkProfile { + /** LoadBalancerProfile - Profile of the cluster load balancer. */ + loadBalancerProfile?: LoadBalancerProfile; + /** LoadBalancerSku - The load balancer sku for the provisioned cluster. Possible values: 'unstacked-haproxy', 'stacked-kube-vip', 'stacked-metallb', 'unmanaged'. The default is 'unmanaged'. */ + loadBalancerSku?: LoadBalancerSku; + /** DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. */ + dnsServiceIP?: string; + /** NetworkPolicy - Network policy used for building Kubernetes network. Possible values include: 'calico', 'flannel'. Default is 'calico' */ + networkPolicy?: NetworkPolicy; + /** PodCidr - A CIDR notation IP range from which to assign pod IPs when kubenet is used. */ + podCidr?: string; + /** The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. */ + podCidrs?: string[]; + /** ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. */ + serviceCidr?: string; + /** The CIDR notation IP ranges from which to assign service cluster IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with any Subnet IP ranges. */ + serviceCidrs?: string[]; +} + +/** HybridAKSClusterStatus defines the observed state of HybridAKSCluster */ +export interface ProvisionedClustersCommonPropertiesStatus { + /** Additional features status like Arc Agent Onboarding. */ + featuresStatus?: ProvisionedClustersCommonPropertiesStatusFeaturesStatus; + /** AddonStatus - Status of Addons */ + addonStatus?: { [propertyName: string]: AddonStatus }; + /** ErrorMessage - Error messages during creation of cluster */ + errorMessage?: string; + /** Contains Provisioning errors */ + provisioningStatus?: ProvisionedClustersCommonPropertiesStatusProvisioningStatus; +} + +/** Additional features status like Arc Agent Onboarding. */ +export interface ProvisionedClustersCommonPropertiesStatusFeaturesStatus { + /** Defines the observed Arc Agent status that is resourceSynced back to the ARM resource. */ + arcAgentStatus?: ArcAgentStatus; +} + +/** Defines the observed Arc Agent status that is resourceSynced back to the ARM resource. */ +export interface ArcAgentStatus { + /** Observed deployment state of the Arc Agents on the target cluster. Possible values include: 'pending', 'provisioning', 'provisioned', 'deleting', 'failed', 'upgrading' */ + deploymentState?: DeploymentState; + /** Error messages while onboarding/upgrading/uninstalling the Arc agents */ + errorMessage?: string; + /** Onboarding public key for provisioning the Managed identity for the HybridAKS cluster. Will be used to create the hybridIdentityMetadata proxy resource and will not be persisted. */ + onboardingPublicKey?: string; + /** Version of the Arc agents currently running on the Provisioned cluster resource. */ + agentVersion?: string; + /** Number of CPU cores present in the Provisioned cluster resource */ + coreCount?: number; + /** ManagedIdentity certificate expiration time (ValidUntil). */ + managedIdentityCertificateExpirationTime?: Date; + /** Last connected timestamp of the Provisioned cluster resource. */ + lastConnectivityTime?: Date; +} + +/** Status of the addon */ +export interface AddonStatus { + /** ErrorMessage will be set in the event that there is a terminal problem reconciling the AddOn and will contain a more verbose string suitable for logging and human consumption. */ + errorMessage?: string; + /** Phase represents the current phase of cluster actuation. E.g. Pending, Running, Terminating, Failed etc. */ + phase?: string; + ready?: boolean; +} + +/** Contains Provisioning errors */ +export interface ProvisionedClustersCommonPropertiesStatusProvisioningStatus { + error?: ProvisionedClustersCommonPropertiesStatusProvisioningStatusError; + operationId?: string; + /** Phase represents the current phase of cluster actuation. E.g. Pending, Running, Terminating, Failed etc. */ + phase?: string; + status?: string; +} + +export interface ProvisionedClustersCommonPropertiesStatusProvisioningStatusError { + code?: string; + message?: string; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export interface ProvisionedClustersResponseExtendedLocation { + /** The extended location type. */ + type?: string; + /** The extended location name. */ + name?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** Properties of provisioned clusters that contain secrets */ +export interface ProvisionedClustersPropertiesWithSecrets { + /** AAD profile for the provisioned cluster. */ + aadProfile?: AADProfile; + /** WindowsProfile - Profile for Windows VMs in the Provisioned Cluster. */ + windowsProfile?: WindowsProfile; + /** HttpProxyConfig - Configurations for provisioning the cluster with HTTP proxy servers. */ + httpProxyConfig?: HttpProxyConfig; +} + +/** The server AAD application secret. */ +export interface AADProfileSecret { + /** The server AAD application secret. */ + serverAppSecret?: string; +} + +/** Password for the Windows Profile to be used by the Windows VMs in the cluster */ +export interface WindowsProfilePassword { + /** AdminPassword - Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" */ + adminPassword?: string; +} + +export interface HttpProxyConfigPassword { + /** Password to use for connecting to proxy server */ + password?: string; +} + +export interface ProvisionedClustersExtendedLocation { + /** The extended location type. */ + type?: string; + /** The extended location name. */ + name?: string; +} + +/** The provisionedClusters resource patch definition. */ +export interface ProvisionedClustersPatch { + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +export interface ProvisionedClustersResponseListResult { + value?: ProvisionedClustersResponse[]; + nextLink?: string; +} + +/** List of hybridIdentityMetadata. */ +export interface HybridIdentityMetadataList { + /** Url to follow for getting next page of hybridIdentityMetadata. */ + nextLink?: string; + /** Array of hybridIdentityMetadata */ + value: HybridIdentityMetadata[]; +} + +/** The agentPool resource definition */ +export interface AgentPool { + /** + * Resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Resource Name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Resource Type + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** The resource location */ + location?: string; + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + extendedLocation?: AgentPoolExtendedLocation; + /** Count - Number of agents to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. */ + count?: number; + /** AvailabilityZones - The list of Availability zones to use for nodes. Datacenter racks modelled as zones */ + availabilityZones?: string[]; + /** The maximum number of nodes for auto-scaling */ + maxCount?: number; + /** The maximum number of pods that can run on a node. */ + maxPods?: number; + /** The minimum number of nodes for auto-scaling */ + minCount?: number; + /** Mode - AgentPoolMode represents mode of an agent pool. Possible values include: 'System', 'LB', 'User'. Default is 'User' */ + mode?: Mode; + /** NodeLabels - Agent pool node labels to be persisted across all nodes in agent pool. */ + nodeLabels?: { [propertyName: string]: string }; + /** NodeTaints - Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. */ + nodeTaints?: string[]; + /** OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' */ + osType?: OsType; + /** The version of node image */ + nodeImageVersion?: string; + /** VmSize - The size of the agent pool VMs. */ + vmSize?: string; + /** The underlying cloud infra provider properties. */ + cloudProviderProfile?: CloudProviderProfile; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly provisioningState?: AgentPoolProvisioningState; + /** HybridAKSNodePoolStatus defines the observed state of HybridAKSNodePool */ + status?: AgentPoolProvisioningStatusStatus; +} + +/** The agentPool resource provisioning status definition */ +export interface AgentPoolProvisioningStatus { + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly provisioningState?: AgentPoolProvisioningState; + /** HybridAKSNodePoolStatus defines the observed state of HybridAKSNodePool */ + status?: AgentPoolProvisioningStatusStatus; +} + +/** HybridAKSNodePoolStatus defines the observed state of HybridAKSNodePool */ +export interface AgentPoolProvisioningStatusStatus { + /** ErrorMessage - Error messages during creation of cluster */ + errorMessage?: string; + /** Contains Provisioning errors */ + provisioningStatus?: AgentPoolProvisioningStatusStatusProvisioningStatus; + /** Total number of ready machines targeted by this deployment. */ + readyReplicas?: number; + /** Total number of non-terminated machines targeted by this deployment */ + replicas?: number; +} + +/** Contains Provisioning errors */ +export interface AgentPoolProvisioningStatusStatusProvisioningStatus { + error?: AgentPoolProvisioningStatusError; + operationId?: string; + /** Phase represents the current phase of cluster actuation. E.g. Pending, Running, Terminating, Failed etc. */ + phase?: string; + status?: string; +} + +export interface AgentPoolProvisioningStatusError { + code?: string; + message?: string; +} + +export interface AgentPoolExtendedLocation { + /** The extended location type. */ + type?: string; + /** The extended location name. */ + name?: string; +} + +export interface AgentPoolListResult { + value?: AgentPool[]; + nextLink?: string; +} + +/** The list of versions for supported orchestrators. */ +export interface OrchestratorVersionProfileListResult { + /** Profile of the orchestrator versions */ + orchestrators?: OrchestratorVersionProfile[]; + /** + * Resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Resource Name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Resource Type + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** The profile of an orchestrator and its available versions. */ +export interface OrchestratorVersionProfile { + /** + * Whether Kubernetes version is currently in preview. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isPreview?: boolean; + /** + * Installed by default if version is not specified. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly default?: boolean; + /** + * Orchestrator type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly orchestratorType?: string; + /** + * Orchestrator version major.minor.patch, for example 1.21.9 + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly orchestratorVersion?: string; + /** The list of available upgrade versions. */ + upgrades?: OrchestratorProfile[]; +} + +/** Contains information about orchestrator. */ +export interface OrchestratorProfile { + /** + * Whether Kubernetes version is currently in preview. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isPreview?: boolean; + /** + * Orchestrator type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly orchestratorType?: string; + /** + * Orchestrator version (major, minor, patch). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly orchestratorVersion?: string; +} + +/** The list of supported VM SKUs. */ +export interface VMSkuListResult { + /** + * Supported VM SKUs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly vmSKUs?: string[]; + /** + * Resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Resource Name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Resource Type + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** Results of the request to list operations. */ +export interface ResourceProviderOperationList { + value?: ResourceProviderOperation[]; + nextLink?: string; +} + +/** Results of the request to list operations. */ +export interface ResourceProviderOperation { + /** Indicates whether the operation applies to data-plane. */ + isDataAction?: string; + /** Operation name, in format of {provider}/{resource}/{operation} */ + name?: string; + /** Display metadata associated with the operation. */ + display?: ResourceProviderOperationDisplay; +} + +/** Display metadata associated with the operation. */ +export interface ResourceProviderOperationDisplay { + /** The resource provider. */ + provider?: string; + /** Resource on which the operation is performed. */ + resource?: string; + /** Type of operation: get, read, delete, etc. */ + operation?: string; + /** Description of this operation. */ + description?: string; +} + +/** HybridAKSNetworkSpec defines the desired state of HybridAKSNetwork */ +export interface VirtualNetworksProperties { + infraVnetProfile?: VirtualNetworksPropertiesInfraVnetProfile; + /** Virtual IP Pool for Kubernetes */ + vipPool?: VirtualNetworksPropertiesVipPoolItem[]; + /** IP Pool for Virtual Machines */ + vmipPool?: VirtualNetworksPropertiesVmipPoolItem[]; + /** + * Address of the DHCP servers associated with the network + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dhcpServers?: string[]; + /** + * Address of the DNS servers associated with the network + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dnsServers?: string[]; + /** + * Address of the Gateway associated with the network + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly gateway?: string; + /** + * IP Address Prefix of the network + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly ipAddressPrefix?: string; + /** + * VLAN Id used by the network + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly vlanID?: string; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly provisioningState?: ProvisioningState; + /** + * HybridAKSNetworkStatus defines the observed state of HybridAKSNetwork + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: VirtualNetworksPropertiesStatus; +} + +export interface VirtualNetworksPropertiesInfraVnetProfile { + /** Infra network profile for HCI platform */ + hci?: VirtualNetworksPropertiesInfraVnetProfileHci; + /** Infra network profile for KubeVirt platform */ + kubevirt?: VirtualNetworksPropertiesInfraVnetProfileKubevirt; + /** Infra network profile for VMware platform */ + vmware?: VirtualNetworksPropertiesInfraVnetProfileVmware; +} + +/** Infra network profile for HCI platform */ +export interface VirtualNetworksPropertiesInfraVnetProfileHci { + /** Resource group in MOC(Microsoft On-premises Cloud) */ + mocGroup?: string; + /** Location in MOC(Microsoft On-premises Cloud) */ + mocLocation?: string; + /** Virtual Network name in MOC(Microsoft On-premises Cloud) */ + mocVnetName?: string; +} + +/** Infra network profile for KubeVirt platform */ +export interface VirtualNetworksPropertiesInfraVnetProfileKubevirt { + /** Name of the network in KubeVirt */ + vnetName?: string; +} + +/** Infra network profile for VMware platform */ +export interface VirtualNetworksPropertiesInfraVnetProfileVmware { + /** Name of the network segment in VSphere */ + segmentName?: string; +} + +export interface VirtualNetworksPropertiesVipPoolItem { + /** Ending IP address for the IP Pool */ + endIP?: string; + /** Starting IP address for the IP Pool */ + startIP?: string; +} + +export interface VirtualNetworksPropertiesVmipPoolItem { + /** Ending IP address for the IP Pool */ + endIP?: string; + /** Starting IP address for the IP Pool */ + startIP?: string; +} + +/** HybridAKSNetworkStatus defines the observed state of HybridAKSNetwork */ +export interface VirtualNetworksPropertiesStatus { + /** Contains Provisioning errors */ + provisioningStatus?: VirtualNetworksPropertiesStatusProvisioningStatus; +} + +/** Contains Provisioning errors */ +export interface VirtualNetworksPropertiesStatusProvisioningStatus { + error?: VirtualNetworksPropertiesStatusProvisioningStatusError; + operationId?: string; + /** Phase represents the current phase of cluster actuation. E.g. Pending, Running, Terminating, Failed etc. */ + phase?: string; + status?: string; +} + +export interface VirtualNetworksPropertiesStatusProvisioningStatusError { + code?: string; + message?: string; +} + +export interface VirtualNetworksExtendedLocation { + /** The extended location type. */ + type?: string; + /** The extended location name. */ + name?: string; +} + +/** The virtualNetworks resource patch definition. */ +export interface VirtualNetworksPatch { + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +export interface VirtualNetworksListResult { + value?: VirtualNetworks[]; + nextLink?: string; +} + +/** HybridAKSStorageSpec defines the desired state of HybridAKSStorage */ +export interface StorageSpacesProperties { + hciStorageProfile?: StorageSpacesPropertiesHciStorageProfile; + vmwareStorageProfile?: StorageSpacesPropertiesVmwareStorageProfile; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly provisioningState?: ProvisioningState; + /** HybridAKSStorageStatus defines the observed state of HybridAKSStorage */ + status?: StorageSpacesPropertiesStatus; +} + +export interface StorageSpacesPropertiesHciStorageProfile { + /** Resource group in MOC(Microsoft On-premises Cloud) */ + mocGroup?: string; + /** Location in MOC(Microsoft On-premises Cloud) */ + mocLocation?: string; + /** Name of the storage container in MOC(Microsoft On-premises Cloud) */ + mocStorageContainer?: string; +} + +export interface StorageSpacesPropertiesVmwareStorageProfile { + /** Name of the datacenter in VSphere */ + datacenter?: string; + /** Name of the datastore in VSphere */ + datastore?: string; + /** Name of the folder in VSphere */ + folder?: string; + /** Name of the resource pool in VSphere */ + resourcePool?: string; +} + +/** HybridAKSStorageStatus defines the observed state of HybridAKSStorage */ +export interface StorageSpacesPropertiesStatus { + /** Contains Provisioning errors */ + provisioningStatus?: StorageSpacesPropertiesStatusProvisioningStatus; +} + +/** Contains Provisioning errors */ +export interface StorageSpacesPropertiesStatusProvisioningStatus { + error?: StorageSpacesPropertiesStatusProvisioningStatusError; + operationId?: string; + /** Phase represents the current phase of cluster actuation. E.g. Pending, Running, Terminating, Failed etc. */ + phase?: string; + status?: string; +} + +export interface StorageSpacesPropertiesStatusProvisioningStatusError { + code?: string; + message?: string; +} + +export interface StorageSpacesExtendedLocation { + /** The extended location type. */ + type?: string; + /** The extended location name. */ + name?: string; +} + +/** The storageSpaces resource patch definition. */ +export interface StorageSpacesPatch { + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +export interface StorageSpacesListResult { + value?: StorageSpaces[]; + nextLink?: string; +} + +export interface ProvisionedClustersResponseProperties + extends ProvisionedClustersPropertiesWithoutSecrets, + ProvisionedClustersCommonProperties {} + +/** AAD Profile specifies attributes for Azure Active Directory integration. */ +export interface AADProfile extends AADProfileSecret, AADProfileResponse {} + +/** WindowsProfile - Profile for Windows VMs in the container service cluster. */ +export interface WindowsProfile + extends WindowsProfileResponse, + WindowsProfilePassword {} + +/** Configurations for provisioning the cluster with HTTP proxy servers. */ +export interface HttpProxyConfig + extends HttpProxyConfigResponse, + HttpProxyConfigPassword {} + +/** All properties of the provisioned cluster */ +export interface ProvisionedClustersAllProperties + extends ProvisionedClustersPropertiesWithSecrets, + ProvisionedClustersCommonProperties {} + +/** Agent pool profile along with a name parameter */ +export interface NamedAgentPoolProfile + extends AgentPoolProfile, + AgentPoolName {} + +export interface AgentPoolProperties + extends AgentPoolProfile, + AgentPoolProvisioningStatus {} + +/** ControlPlaneProfile - The control plane properties for the provisioned cluster. */ +export interface ControlPlaneProfile + extends NamedAgentPoolProfile, + ControlPlaneEndpointProfile, + LinuxProfile {} + +/** LoadBalancerProfile - Profile of the cluster load balancer. */ +export interface LoadBalancerProfile + extends NamedAgentPoolProfile, + LinuxProfile {} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** The provisionedClusters resource definition. */ +export interface ProvisionedClustersResponse extends TrackedResource { + /** Identity for the Provisioned cluster. */ + identity?: ProvisionedClusterIdentity; + properties?: ProvisionedClustersResponseProperties; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + extendedLocation?: ProvisionedClustersResponseExtendedLocation; +} + +/** The provisionedClusters resource definition. */ +export interface ProvisionedClusters extends TrackedResource { + /** Identity for the Provisioned cluster. */ + identity?: ProvisionedClusterIdentity; + /** All properties of the provisioned cluster */ + properties?: ProvisionedClustersAllProperties; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + extendedLocation?: ProvisionedClustersExtendedLocation; +} + +/** The virtualNetworks resource definition. */ +export interface VirtualNetworks extends TrackedResource { + /** HybridAKSNetworkSpec defines the desired state of HybridAKSNetwork */ + properties?: VirtualNetworksProperties; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + extendedLocation?: VirtualNetworksExtendedLocation; +} + +/** The storageSpaces resource definition. */ +export interface StorageSpaces extends TrackedResource { + /** HybridAKSStorageSpec defines the desired state of HybridAKSStorage */ + properties?: StorageSpacesProperties; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + extendedLocation?: StorageSpacesExtendedLocation; +} + +/** Defines the hybridIdentityMetadata. */ +export interface HybridIdentityMetadata extends ProxyResource { + /** + * The system data. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Unique id of the parent provisioned cluster resource. */ + resourceUid?: string; + /** Onboarding public key for provisioning the Managed identity for the HybridAKS cluster. */ + publicKey?: string; + /** The identity of the provisioned cluster. */ + identity?: ProvisionedClusterIdentity; + /** + * provisioning state of the hybridIdentityMetadata resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** Known values of {@link LicenseType} that the service accepts. */ +export enum KnownLicenseType { + /** WindowsServer */ + WindowsServer = "Windows_Server", + /** None */ + None = "None" +} + +/** + * Defines values for LicenseType. \ + * {@link KnownLicenseType} can be used interchangeably with LicenseType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Windows_Server** \ + * **None** + */ +export type LicenseType = string; + +/** Known values of {@link AutoUpgradeOptions} that the service accepts. */ +export enum KnownAutoUpgradeOptions { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled" +} + +/** + * Defines values for AutoUpgradeOptions. \ + * {@link KnownAutoUpgradeOptions} can be used interchangeably with AutoUpgradeOptions, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type AutoUpgradeOptions = string; + +/** Known values of {@link Mode} that the service accepts. */ +export enum KnownMode { + /** System */ + System = "System", + /** LB */ + LB = "LB", + /** User */ + User = "User" +} + +/** + * Defines values for Mode. \ + * {@link KnownMode} can be used interchangeably with Mode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **System** \ + * **LB** \ + * **User** + */ +export type Mode = string; + +/** Known values of {@link OsType} that the service accepts. */ +export enum KnownOsType { + /** Linux */ + Linux = "Linux", + /** Windows */ + Windows = "Windows" +} + +/** + * Defines values for OsType. \ + * {@link KnownOsType} can be used interchangeably with OsType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Linux** \ + * **Windows** + */ +export type OsType = string; + +/** Known values of {@link LoadBalancerSku} that the service accepts. */ +export enum KnownLoadBalancerSku { + /** UnstackedHaproxy */ + UnstackedHaproxy = "unstacked-haproxy", + /** StackedKubeVip */ + StackedKubeVip = "stacked-kube-vip", + /** StackedMetallb */ + StackedMetallb = "stacked-metallb", + /** Unmanaged */ + Unmanaged = "unmanaged" +} + +/** + * Defines values for LoadBalancerSku. \ + * {@link KnownLoadBalancerSku} can be used interchangeably with LoadBalancerSku, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **unstacked-haproxy** \ + * **stacked-kube-vip** \ + * **stacked-metallb** \ + * **unmanaged** + */ +export type LoadBalancerSku = string; + +/** Known values of {@link NetworkPolicy} that the service accepts. */ +export enum KnownNetworkPolicy { + /** Calico */ + Calico = "calico", + /** Flannel */ + Flannel = "flannel" +} + +/** + * Defines values for NetworkPolicy. \ + * {@link KnownNetworkPolicy} can be used interchangeably with NetworkPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **calico** \ + * **flannel** + */ +export type NetworkPolicy = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** InProgress */ + InProgress = "InProgress", + /** Deleting */ + Deleting = "Deleting", + /** Updating */ + Updating = "Updating", + /** Accepted */ + Accepted = "Accepted", + /** Created */ + Created = "Created" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **InProgress** \ + * **Deleting** \ + * **Updating** \ + * **Accepted** \ + * **Created** + */ +export type ProvisioningState = string; + +/** Known values of {@link DeploymentState} that the service accepts. */ +export enum KnownDeploymentState { + /** Pending */ + Pending = "pending", + /** Provisioning */ + Provisioning = "provisioning", + /** Provisioned */ + Provisioned = "provisioned", + /** Deleting */ + Deleting = "deleting", + /** Failed */ + Failed = "failed", + /** Upgrading */ + Upgrading = "upgrading" +} + +/** + * Defines values for DeploymentState. \ + * {@link KnownDeploymentState} can be used interchangeably with DeploymentState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **pending** \ + * **provisioning** \ + * **provisioned** \ + * **deleting** \ + * **failed** \ + * **upgrading** + */ +export type DeploymentState = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link AgentPoolProvisioningState} that the service accepts. */ +export enum KnownAgentPoolProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Deleting */ + Deleting = "Deleting", + /** InProgress */ + InProgress = "InProgress", + /** Canceled */ + Canceled = "Canceled" +} + +/** + * Defines values for AgentPoolProvisioningState. \ + * {@link KnownAgentPoolProvisioningState} can be used interchangeably with AgentPoolProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Deleting** \ + * **InProgress** \ + * **Canceled** + */ +export type AgentPoolProvisioningState = string; +/** Defines values for ResourceIdentityType. */ +export type ResourceIdentityType = "None" | "SystemAssigned"; + +/** Optional parameters. */ +export interface ProvisionedClustersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ProvisionedClustersGetResponse = ProvisionedClustersResponse; + +/** Optional parameters. */ +export interface ProvisionedClustersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type ProvisionedClustersCreateOrUpdateResponse = ProvisionedClustersResponse; + +/** Optional parameters. */ +export interface ProvisionedClustersDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ProvisionedClustersUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type ProvisionedClustersUpdateResponse = ProvisionedClustersResponse; + +/** Optional parameters. */ +export interface ProvisionedClustersListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ProvisionedClustersListByResourceGroupResponse = ProvisionedClustersResponseListResult; + +/** Optional parameters. */ +export interface ProvisionedClustersListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type ProvisionedClustersListBySubscriptionResponse = ProvisionedClustersResponseListResult; + +/** Optional parameters. */ +export interface ProvisionedClustersListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ProvisionedClustersListByResourceGroupNextResponse = ProvisionedClustersResponseListResult; + +/** Optional parameters. */ +export interface ProvisionedClustersListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type ProvisionedClustersListBySubscriptionNextResponse = ProvisionedClustersResponseListResult; + +/** Optional parameters. */ +export interface HybridIdentityMetadataPutOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the put operation. */ +export type HybridIdentityMetadataPutResponse = HybridIdentityMetadata; + +/** Optional parameters. */ +export interface HybridIdentityMetadataGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type HybridIdentityMetadataGetResponse = HybridIdentityMetadata; + +/** Optional parameters. */ +export interface HybridIdentityMetadataDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface HybridIdentityMetadataListByClusterOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCluster operation. */ +export type HybridIdentityMetadataListByClusterResponse = HybridIdentityMetadataList; + +/** Optional parameters. */ +export interface HybridIdentityMetadataListByClusterNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByClusterNext operation. */ +export type HybridIdentityMetadataListByClusterNextResponse = HybridIdentityMetadataList; + +/** Optional parameters. */ +export interface AgentPoolGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AgentPoolGetResponse = AgentPool; + +/** Optional parameters. */ +export interface AgentPoolCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type AgentPoolCreateOrUpdateResponse = AgentPool; + +/** Optional parameters. */ +export interface AgentPoolDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface AgentPoolUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type AgentPoolUpdateResponse = AgentPool; + +/** Optional parameters. */ +export interface AgentPoolListByProvisionedClusterOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByProvisionedCluster operation. */ +export type AgentPoolListByProvisionedClusterResponse = AgentPoolListResult; + +/** Optional parameters. */ +export interface HybridContainerServiceListOrchestratorsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listOrchestrators operation. */ +export type HybridContainerServiceListOrchestratorsResponse = OrchestratorVersionProfileListResult; + +/** Optional parameters. */ +export interface HybridContainerServiceListVMSkusOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listVMSkus operation. */ +export type HybridContainerServiceListVMSkusResponse = VMSkuListResult; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = ResourceProviderOperationList; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = ResourceProviderOperationList; + +/** Optional parameters. */ +export interface VirtualNetworksRetrieveOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the retrieve operation. */ +export type VirtualNetworksRetrieveResponse = VirtualNetworks; + +/** Optional parameters. */ +export interface VirtualNetworksCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type VirtualNetworksCreateOrUpdateResponse = VirtualNetworks; + +/** Optional parameters. */ +export interface VirtualNetworksDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface VirtualNetworksUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type VirtualNetworksUpdateResponse = VirtualNetworks; + +/** Optional parameters. */ +export interface VirtualNetworksListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type VirtualNetworksListByResourceGroupResponse = VirtualNetworksListResult; + +/** Optional parameters. */ +export interface VirtualNetworksListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type VirtualNetworksListBySubscriptionResponse = VirtualNetworksListResult; + +/** Optional parameters. */ +export interface VirtualNetworksListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type VirtualNetworksListByResourceGroupNextResponse = VirtualNetworksListResult; + +/** Optional parameters. */ +export interface VirtualNetworksListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type VirtualNetworksListBySubscriptionNextResponse = VirtualNetworksListResult; + +/** Optional parameters. */ +export interface StorageSpacesRetrieveOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the retrieve operation. */ +export type StorageSpacesRetrieveResponse = StorageSpaces; + +/** Optional parameters. */ +export interface StorageSpacesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type StorageSpacesCreateOrUpdateResponse = StorageSpaces; + +/** Optional parameters. */ +export interface StorageSpacesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface StorageSpacesUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type StorageSpacesUpdateResponse = StorageSpaces; + +/** Optional parameters. */ +export interface StorageSpacesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type StorageSpacesListByResourceGroupResponse = StorageSpacesListResult; + +/** Optional parameters. */ +export interface StorageSpacesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type StorageSpacesListBySubscriptionResponse = StorageSpacesListResult; + +/** Optional parameters. */ +export interface StorageSpacesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type StorageSpacesListByResourceGroupNextResponse = StorageSpacesListResult; + +/** Optional parameters. */ +export interface StorageSpacesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type StorageSpacesListBySubscriptionNextResponse = StorageSpacesListResult; + +/** Optional parameters. */ +export interface HybridContainerServiceClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/models/mappers.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/models/mappers.ts new file mode 100644 index 000000000000..0705ada44f6d --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/models/mappers.ts @@ -0,0 +1,2727 @@ +/* + * 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 * as coreClient from "@azure/core-client"; + +export const ProvisionedClusterIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClusterIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "Enum", + allowedValues: ["None", "SystemAssigned"] + } + } + } + } +}; + +export const ProvisionedClustersPropertiesWithoutSecrets: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersPropertiesWithoutSecrets", + modelProperties: { + aadProfile: { + serializedName: "aadProfile", + type: { + name: "Composite", + className: "AADProfileResponse" + } + }, + windowsProfile: { + serializedName: "windowsProfile", + type: { + name: "Composite", + className: "WindowsProfileResponse" + } + }, + httpProxyConfig: { + serializedName: "httpProxyConfig", + type: { + name: "Composite", + className: "HttpProxyConfigResponse" + } + } + } + } +}; + +export const AADProfileResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AADProfileResponse", + modelProperties: { + adminGroupObjectIDs: { + serializedName: "adminGroupObjectIDs", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + clientAppID: { + serializedName: "clientAppID", + type: { + name: "String" + } + }, + enableAzureRbac: { + serializedName: "enableAzureRbac", + type: { + name: "Boolean" + } + }, + managed: { + serializedName: "managed", + type: { + name: "Boolean" + } + }, + serverAppID: { + serializedName: "serverAppID", + type: { + name: "String" + } + }, + tenantID: { + serializedName: "tenantID", + type: { + name: "String" + } + } + } + } +}; + +export const WindowsProfileResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WindowsProfileResponse", + modelProperties: { + adminUsername: { + serializedName: "adminUsername", + type: { + name: "String" + } + }, + enableCsiProxy: { + serializedName: "enableCsiProxy", + type: { + name: "Boolean" + } + }, + licenseType: { + serializedName: "licenseType", + type: { + name: "String" + } + } + } + } +}; + +export const HttpProxyConfigResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HttpProxyConfigResponse", + modelProperties: { + httpProxy: { + serializedName: "httpProxy", + type: { + name: "String" + } + }, + httpsProxy: { + serializedName: "httpsProxy", + type: { + name: "String" + } + }, + noProxy: { + serializedName: "noProxy", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + trustedCa: { + serializedName: "trustedCa", + type: { + name: "String" + } + }, + username: { + serializedName: "username", + type: { + name: "String" + } + } + } + } +}; + +export const ProvisionedClustersCommonProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersCommonProperties", + modelProperties: { + enableRbac: { + serializedName: "enableRbac", + type: { + name: "Boolean" + } + }, + linuxProfile: { + serializedName: "linuxProfile", + type: { + name: "Composite", + className: "LinuxProfileProperties" + } + }, + features: { + serializedName: "features", + type: { + name: "Composite", + className: "ProvisionedClustersCommonPropertiesFeatures" + } + }, + addonProfiles: { + serializedName: "addonProfiles", + type: { + name: "Dictionary", + value: { type: { name: "Composite", className: "AddonProfiles" } } + } + }, + controlPlane: { + serializedName: "controlPlane", + type: { + name: "Composite", + className: "ControlPlaneProfile" + } + }, + kubernetesVersion: { + serializedName: "kubernetesVersion", + type: { + name: "String" + } + }, + networkProfile: { + serializedName: "networkProfile", + type: { + name: "Composite", + className: "NetworkProfile" + } + }, + nodeResourceGroup: { + serializedName: "nodeResourceGroup", + type: { + name: "String" + } + }, + agentPoolProfiles: { + serializedName: "agentPoolProfiles", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NamedAgentPoolProfile" + } + } + } + }, + cloudProviderProfile: { + serializedName: "cloudProviderProfile", + type: { + name: "Composite", + className: "CloudProviderProfile" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "Composite", + className: "ProvisionedClustersCommonPropertiesStatus" + } + } + } + } +}; + +export const LinuxProfileProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinuxProfileProperties", + modelProperties: { + adminUsername: { + serializedName: "adminUsername", + type: { + name: "String" + } + }, + ssh: { + serializedName: "ssh", + type: { + name: "Composite", + className: "LinuxProfilePropertiesSsh" + } + } + } + } +}; + +export const LinuxProfilePropertiesSsh: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinuxProfilePropertiesSsh", + modelProperties: { + publicKeys: { + serializedName: "publicKeys", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LinuxProfilePropertiesSshPublicKeysItem" + } + } + } + } + } + } +}; + +export const LinuxProfilePropertiesSshPublicKeysItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinuxProfilePropertiesSshPublicKeysItem", + modelProperties: { + keyData: { + serializedName: "keyData", + type: { + name: "String" + } + } + } + } +}; + +export const ProvisionedClustersCommonPropertiesFeatures: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersCommonPropertiesFeatures", + modelProperties: { + arcAgentProfile: { + serializedName: "arcAgentProfile", + type: { + name: "Composite", + className: "ArcAgentProfile" + } + } + } + } +}; + +export const ArcAgentProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ArcAgentProfile", + modelProperties: { + agentVersion: { + serializedName: "agentVersion", + type: { + name: "String" + } + }, + agentAutoUpgrade: { + defaultValue: "Enabled", + serializedName: "agentAutoUpgrade", + type: { + name: "String" + } + } + } + } +}; + +export const AddonProfiles: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AddonProfiles", + modelProperties: { + config: { + serializedName: "config", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const AgentPoolProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPoolProfile", + modelProperties: { + count: { + defaultValue: 1, + serializedName: "count", + type: { + name: "Number" + } + }, + availabilityZones: { + serializedName: "availabilityZones", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + maxCount: { + serializedName: "maxCount", + type: { + name: "Number" + } + }, + maxPods: { + serializedName: "maxPods", + type: { + name: "Number" + } + }, + minCount: { + serializedName: "minCount", + type: { + name: "Number" + } + }, + mode: { + defaultValue: "User", + serializedName: "mode", + type: { + name: "String" + } + }, + nodeLabels: { + serializedName: "nodeLabels", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + nodeTaints: { + serializedName: "nodeTaints", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + osType: { + defaultValue: "Linux", + serializedName: "osType", + type: { + name: "String" + } + }, + nodeImageVersion: { + serializedName: "nodeImageVersion", + type: { + name: "String" + } + }, + vmSize: { + serializedName: "vmSize", + type: { + name: "String" + } + }, + cloudProviderProfile: { + serializedName: "cloudProviderProfile", + type: { + name: "Composite", + className: "CloudProviderProfile" + } + } + } + } +}; + +export const CloudProviderProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudProviderProfile", + modelProperties: { + infraNetworkProfile: { + serializedName: "infraNetworkProfile", + type: { + name: "Composite", + className: "CloudProviderProfileInfraNetworkProfile" + } + }, + infraStorageProfile: { + serializedName: "infraStorageProfile", + type: { + name: "Composite", + className: "CloudProviderProfileInfraStorageProfile" + } + } + } + } +}; + +export const CloudProviderProfileInfraNetworkProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudProviderProfileInfraNetworkProfile", + modelProperties: { + vnetSubnetIds: { + serializedName: "vnetSubnetIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CloudProviderProfileInfraStorageProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudProviderProfileInfraStorageProfile", + modelProperties: { + storageSpaceIds: { + serializedName: "storageSpaceIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const AgentPoolName: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPoolName", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const ControlPlaneEndpointProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ControlPlaneEndpointProfile", + modelProperties: { + controlPlaneEndpoint: { + serializedName: "controlPlaneEndpoint", + type: { + name: "Composite", + className: "ControlPlaneEndpointProfileControlPlaneEndpoint" + } + } + } + } +}; + +export const ControlPlaneEndpointProfileControlPlaneEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ControlPlaneEndpointProfileControlPlaneEndpoint", + modelProperties: { + hostIP: { + serializedName: "hostIP", + type: { + name: "String" + } + }, + port: { + serializedName: "port", + type: { + name: "String" + } + } + } + } +}; + +export const LinuxProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinuxProfile", + modelProperties: { + linuxProfile: { + serializedName: "linuxProfile", + type: { + name: "Composite", + className: "LinuxProfileProperties" + } + } + } + } +}; + +export const NetworkProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkProfile", + modelProperties: { + loadBalancerProfile: { + serializedName: "loadBalancerProfile", + type: { + name: "Composite", + className: "LoadBalancerProfile" + } + }, + loadBalancerSku: { + defaultValue: "unmanaged", + serializedName: "loadBalancerSku", + type: { + name: "String" + } + }, + dnsServiceIP: { + serializedName: "dnsServiceIP", + type: { + name: "String" + } + }, + networkPolicy: { + defaultValue: "calico", + serializedName: "networkPolicy", + type: { + name: "String" + } + }, + podCidr: { + serializedName: "podCidr", + type: { + name: "String" + } + }, + podCidrs: { + serializedName: "podCidrs", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + serviceCidr: { + serializedName: "serviceCidr", + type: { + name: "String" + } + }, + serviceCidrs: { + serializedName: "serviceCidrs", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ProvisionedClustersCommonPropertiesStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersCommonPropertiesStatus", + modelProperties: { + featuresStatus: { + serializedName: "featuresStatus", + type: { + name: "Composite", + className: "ProvisionedClustersCommonPropertiesStatusFeaturesStatus" + } + }, + addonStatus: { + serializedName: "addonStatus", + type: { + name: "Dictionary", + value: { type: { name: "Composite", className: "AddonStatus" } } + } + }, + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String" + } + }, + provisioningStatus: { + serializedName: "provisioningStatus", + type: { + name: "Composite", + className: + "ProvisionedClustersCommonPropertiesStatusProvisioningStatus" + } + } + } + } +}; + +export const ProvisionedClustersCommonPropertiesStatusFeaturesStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersCommonPropertiesStatusFeaturesStatus", + modelProperties: { + arcAgentStatus: { + serializedName: "arcAgentStatus", + type: { + name: "Composite", + className: "ArcAgentStatus" + } + } + } + } +}; + +export const ArcAgentStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ArcAgentStatus", + modelProperties: { + deploymentState: { + serializedName: "deploymentState", + type: { + name: "String" + } + }, + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String" + } + }, + onboardingPublicKey: { + serializedName: "onboardingPublicKey", + type: { + name: "String" + } + }, + agentVersion: { + serializedName: "agentVersion", + type: { + name: "String" + } + }, + coreCount: { + serializedName: "coreCount", + type: { + name: "Number" + } + }, + managedIdentityCertificateExpirationTime: { + serializedName: "managedIdentityCertificateExpirationTime", + type: { + name: "DateTime" + } + }, + lastConnectivityTime: { + serializedName: "lastConnectivityTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const AddonStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AddonStatus", + modelProperties: { + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String" + } + }, + phase: { + serializedName: "phase", + type: { + name: "String" + } + }, + ready: { + serializedName: "ready", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ProvisionedClustersCommonPropertiesStatusProvisioningStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersCommonPropertiesStatusProvisioningStatus", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: + "ProvisionedClustersCommonPropertiesStatusProvisioningStatusError" + } + }, + operationId: { + serializedName: "operationId", + type: { + name: "String" + } + }, + phase: { + serializedName: "phase", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const ProvisionedClustersCommonPropertiesStatusProvisioningStatusError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: + "ProvisionedClustersCommonPropertiesStatusProvisioningStatusError", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ProvisionedClustersResponseExtendedLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersResponseExtendedLocation", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const ProvisionedClustersPropertiesWithSecrets: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersPropertiesWithSecrets", + modelProperties: { + aadProfile: { + serializedName: "aadProfile", + type: { + name: "Composite", + className: "AADProfile" + } + }, + windowsProfile: { + serializedName: "windowsProfile", + type: { + name: "Composite", + className: "WindowsProfile" + } + }, + httpProxyConfig: { + serializedName: "httpProxyConfig", + type: { + name: "Composite", + className: "HttpProxyConfig" + } + } + } + } +}; + +export const AADProfileSecret: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AADProfileSecret", + modelProperties: { + serverAppSecret: { + serializedName: "serverAppSecret", + type: { + name: "String" + } + } + } + } +}; + +export const WindowsProfilePassword: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WindowsProfilePassword", + modelProperties: { + adminPassword: { + serializedName: "adminPassword", + type: { + name: "String" + } + } + } + } +}; + +export const HttpProxyConfigPassword: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HttpProxyConfigPassword", + modelProperties: { + password: { + serializedName: "password", + type: { + name: "String" + } + } + } + } +}; + +export const ProvisionedClustersExtendedLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersExtendedLocation", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const ProvisionedClustersPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersPatch", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ProvisionedClustersResponseListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersResponseListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProvisionedClustersResponse" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const HybridIdentityMetadataList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HybridIdentityMetadataList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HybridIdentityMetadata" + } + } + } + } + } + } +}; + +export const AgentPool: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPool", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "AgentPoolExtendedLocation" + } + }, + count: { + defaultValue: 1, + serializedName: "properties.count", + type: { + name: "Number" + } + }, + availabilityZones: { + serializedName: "properties.availabilityZones", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + maxCount: { + serializedName: "properties.maxCount", + type: { + name: "Number" + } + }, + maxPods: { + serializedName: "properties.maxPods", + type: { + name: "Number" + } + }, + minCount: { + serializedName: "properties.minCount", + type: { + name: "Number" + } + }, + mode: { + defaultValue: "User", + serializedName: "properties.mode", + type: { + name: "String" + } + }, + nodeLabels: { + serializedName: "properties.nodeLabels", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + nodeTaints: { + serializedName: "properties.nodeTaints", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + osType: { + defaultValue: "Linux", + serializedName: "properties.osType", + type: { + name: "String" + } + }, + nodeImageVersion: { + serializedName: "properties.nodeImageVersion", + type: { + name: "String" + } + }, + vmSize: { + serializedName: "properties.vmSize", + type: { + name: "String" + } + }, + cloudProviderProfile: { + serializedName: "properties.cloudProviderProfile", + type: { + name: "Composite", + className: "CloudProviderProfile" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + type: { + name: "Composite", + className: "AgentPoolProvisioningStatusStatus" + } + } + } + } +}; + +export const AgentPoolProvisioningStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPoolProvisioningStatus", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "Composite", + className: "AgentPoolProvisioningStatusStatus" + } + } + } + } +}; + +export const AgentPoolProvisioningStatusStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPoolProvisioningStatusStatus", + modelProperties: { + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String" + } + }, + provisioningStatus: { + serializedName: "provisioningStatus", + type: { + name: "Composite", + className: "AgentPoolProvisioningStatusStatusProvisioningStatus" + } + }, + readyReplicas: { + serializedName: "readyReplicas", + type: { + name: "Number" + } + }, + replicas: { + serializedName: "replicas", + type: { + name: "Number" + } + } + } + } +}; + +export const AgentPoolProvisioningStatusStatusProvisioningStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPoolProvisioningStatusStatusProvisioningStatus", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "AgentPoolProvisioningStatusError" + } + }, + operationId: { + serializedName: "operationId", + type: { + name: "String" + } + }, + phase: { + serializedName: "phase", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const AgentPoolProvisioningStatusError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPoolProvisioningStatusError", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const AgentPoolExtendedLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPoolExtendedLocation", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const AgentPoolListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPoolListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AgentPool" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OrchestratorVersionProfileListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OrchestratorVersionProfileListResult", + modelProperties: { + orchestrators: { + serializedName: "orchestrators", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OrchestratorVersionProfile" + } + } + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OrchestratorVersionProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OrchestratorVersionProfile", + modelProperties: { + isPreview: { + serializedName: "isPreview", + readOnly: true, + type: { + name: "Boolean" + } + }, + default: { + serializedName: "default", + readOnly: true, + type: { + name: "Boolean" + } + }, + orchestratorType: { + serializedName: "orchestratorType", + readOnly: true, + type: { + name: "String" + } + }, + orchestratorVersion: { + serializedName: "orchestratorVersion", + readOnly: true, + type: { + name: "String" + } + }, + upgrades: { + serializedName: "upgrades", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OrchestratorProfile" + } + } + } + } + } + } +}; + +export const OrchestratorProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OrchestratorProfile", + modelProperties: { + isPreview: { + serializedName: "isPreview", + readOnly: true, + type: { + name: "Boolean" + } + }, + orchestratorType: { + serializedName: "orchestratorType", + readOnly: true, + type: { + name: "String" + } + }, + orchestratorVersion: { + serializedName: "orchestratorVersion", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const VMSkuListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VMSkuListResult", + modelProperties: { + vmSKUs: { + serializedName: "vmSKUs", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ResourceProviderOperationList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceProviderOperationList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceProviderOperation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceProviderOperation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceProviderOperation", + modelProperties: { + isDataAction: { + serializedName: "isDataAction", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "ResourceProviderOperationDisplay" + } + } + } + } +}; + +export const ResourceProviderOperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceProviderOperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworksProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksProperties", + modelProperties: { + infraVnetProfile: { + serializedName: "infraVnetProfile", + type: { + name: "Composite", + className: "VirtualNetworksPropertiesInfraVnetProfile" + } + }, + vipPool: { + serializedName: "vipPool", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualNetworksPropertiesVipPoolItem" + } + } + } + }, + vmipPool: { + serializedName: "vmipPool", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualNetworksPropertiesVmipPoolItem" + } + } + } + }, + dhcpServers: { + serializedName: "dhcpServers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + dnsServers: { + serializedName: "dnsServers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + gateway: { + serializedName: "gateway", + readOnly: true, + type: { + name: "String" + } + }, + ipAddressPrefix: { + serializedName: "ipAddressPrefix", + readOnly: true, + type: { + name: "String" + } + }, + vlanID: { + serializedName: "vlanID", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "Composite", + className: "VirtualNetworksPropertiesStatus" + } + } + } + } +}; + +export const VirtualNetworksPropertiesInfraVnetProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksPropertiesInfraVnetProfile", + modelProperties: { + hci: { + serializedName: "hci", + type: { + name: "Composite", + className: "VirtualNetworksPropertiesInfraVnetProfileHci" + } + }, + kubevirt: { + serializedName: "kubevirt", + type: { + name: "Composite", + className: "VirtualNetworksPropertiesInfraVnetProfileKubevirt" + } + }, + vmware: { + serializedName: "vmware", + type: { + name: "Composite", + className: "VirtualNetworksPropertiesInfraVnetProfileVmware" + } + } + } + } +}; + +export const VirtualNetworksPropertiesInfraVnetProfileHci: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksPropertiesInfraVnetProfileHci", + modelProperties: { + mocGroup: { + serializedName: "mocGroup", + type: { + name: "String" + } + }, + mocLocation: { + serializedName: "mocLocation", + type: { + name: "String" + } + }, + mocVnetName: { + serializedName: "mocVnetName", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworksPropertiesInfraVnetProfileKubevirt: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksPropertiesInfraVnetProfileKubevirt", + modelProperties: { + vnetName: { + serializedName: "vnetName", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworksPropertiesInfraVnetProfileVmware: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksPropertiesInfraVnetProfileVmware", + modelProperties: { + segmentName: { + serializedName: "segmentName", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworksPropertiesVipPoolItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksPropertiesVipPoolItem", + modelProperties: { + endIP: { + serializedName: "endIP", + type: { + name: "String" + } + }, + startIP: { + serializedName: "startIP", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworksPropertiesVmipPoolItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksPropertiesVmipPoolItem", + modelProperties: { + endIP: { + serializedName: "endIP", + type: { + name: "String" + } + }, + startIP: { + serializedName: "startIP", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworksPropertiesStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksPropertiesStatus", + modelProperties: { + provisioningStatus: { + serializedName: "provisioningStatus", + type: { + name: "Composite", + className: "VirtualNetworksPropertiesStatusProvisioningStatus" + } + } + } + } +}; + +export const VirtualNetworksPropertiesStatusProvisioningStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksPropertiesStatusProvisioningStatus", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "VirtualNetworksPropertiesStatusProvisioningStatusError" + } + }, + operationId: { + serializedName: "operationId", + type: { + name: "String" + } + }, + phase: { + serializedName: "phase", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworksPropertiesStatusProvisioningStatusError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksPropertiesStatusProvisioningStatusError", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworksExtendedLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksExtendedLocation", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworksPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksPatch", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const VirtualNetworksListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworksListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualNetworks" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const StorageSpacesProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSpacesProperties", + modelProperties: { + hciStorageProfile: { + serializedName: "hciStorageProfile", + type: { + name: "Composite", + className: "StorageSpacesPropertiesHciStorageProfile" + } + }, + vmwareStorageProfile: { + serializedName: "vmwareStorageProfile", + type: { + name: "Composite", + className: "StorageSpacesPropertiesVmwareStorageProfile" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "Composite", + className: "StorageSpacesPropertiesStatus" + } + } + } + } +}; + +export const StorageSpacesPropertiesHciStorageProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSpacesPropertiesHciStorageProfile", + modelProperties: { + mocGroup: { + serializedName: "mocGroup", + type: { + name: "String" + } + }, + mocLocation: { + serializedName: "mocLocation", + type: { + name: "String" + } + }, + mocStorageContainer: { + serializedName: "mocStorageContainer", + type: { + name: "String" + } + } + } + } +}; + +export const StorageSpacesPropertiesVmwareStorageProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSpacesPropertiesVmwareStorageProfile", + modelProperties: { + datacenter: { + serializedName: "datacenter", + type: { + name: "String" + } + }, + datastore: { + serializedName: "datastore", + type: { + name: "String" + } + }, + folder: { + serializedName: "folder", + type: { + name: "String" + } + }, + resourcePool: { + serializedName: "resourcePool", + type: { + name: "String" + } + } + } + } +}; + +export const StorageSpacesPropertiesStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSpacesPropertiesStatus", + modelProperties: { + provisioningStatus: { + serializedName: "provisioningStatus", + type: { + name: "Composite", + className: "StorageSpacesPropertiesStatusProvisioningStatus" + } + } + } + } +}; + +export const StorageSpacesPropertiesStatusProvisioningStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSpacesPropertiesStatusProvisioningStatus", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "StorageSpacesPropertiesStatusProvisioningStatusError" + } + }, + operationId: { + serializedName: "operationId", + type: { + name: "String" + } + }, + phase: { + serializedName: "phase", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const StorageSpacesPropertiesStatusProvisioningStatusError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSpacesPropertiesStatusProvisioningStatusError", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const StorageSpacesExtendedLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSpacesExtendedLocation", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const StorageSpacesPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSpacesPatch", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const StorageSpacesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSpacesListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageSpaces" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ProvisionedClustersResponseProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersResponseProperties", + modelProperties: { + ...ProvisionedClustersPropertiesWithoutSecrets.type.modelProperties, + ...ProvisionedClustersCommonProperties.type.modelProperties + } + } +}; + +export const AADProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AADProfile", + modelProperties: { + ...AADProfileSecret.type.modelProperties, + ...AADProfileResponse.type.modelProperties + } + } +}; + +export const WindowsProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WindowsProfile", + modelProperties: { + ...WindowsProfileResponse.type.modelProperties, + ...WindowsProfilePassword.type.modelProperties + } + } +}; + +export const HttpProxyConfig: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HttpProxyConfig", + modelProperties: { + ...HttpProxyConfigResponse.type.modelProperties, + ...HttpProxyConfigPassword.type.modelProperties + } + } +}; + +export const ProvisionedClustersAllProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersAllProperties", + modelProperties: { + ...ProvisionedClustersPropertiesWithSecrets.type.modelProperties, + ...ProvisionedClustersCommonProperties.type.modelProperties + } + } +}; + +export const NamedAgentPoolProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NamedAgentPoolProfile", + modelProperties: { + ...AgentPoolProfile.type.modelProperties, + ...AgentPoolName.type.modelProperties + } + } +}; + +export const AgentPoolProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPoolProperties", + modelProperties: { + ...AgentPoolProfile.type.modelProperties, + ...AgentPoolProvisioningStatus.type.modelProperties + } + } +}; + +export const ControlPlaneProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ControlPlaneProfile", + modelProperties: { + ...NamedAgentPoolProfile.type.modelProperties, + ...ControlPlaneEndpointProfile.type.modelProperties, + ...LinuxProfile.type.modelProperties + } + } +}; + +export const LoadBalancerProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LoadBalancerProfile", + modelProperties: { + ...NamedAgentPoolProfile.type.modelProperties, + ...LinuxProfile.type.modelProperties + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const ProvisionedClustersResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClustersResponse", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ProvisionedClusterIdentity" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ProvisionedClustersResponseProperties" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ProvisionedClustersResponseExtendedLocation" + } + } + } + } +}; + +export const ProvisionedClusters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProvisionedClusters", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ProvisionedClusterIdentity" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ProvisionedClustersAllProperties" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ProvisionedClustersExtendedLocation" + } + } + } + } +}; + +export const VirtualNetworks: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworks", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "VirtualNetworksProperties" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "VirtualNetworksExtendedLocation" + } + } + } + } +}; + +export const StorageSpaces: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSpaces", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "StorageSpacesProperties" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "StorageSpacesExtendedLocation" + } + } + } + } +}; + +export const HybridIdentityMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HybridIdentityMetadata", + modelProperties: { + ...ProxyResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + resourceUid: { + serializedName: "properties.resourceUid", + type: { + name: "String" + } + }, + publicKey: { + serializedName: "properties.publicKey", + type: { + name: "String" + } + }, + identity: { + serializedName: "properties.identity", + type: { + name: "Composite", + className: "ProvisionedClusterIdentity" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/models/parameters.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/models/parameters.ts new file mode 100644 index 000000000000..9888b7566d9f --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/models/parameters.ts @@ -0,0 +1,239 @@ +/* + * 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 { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + ProvisionedClusters as ProvisionedClustersMapper, + ProvisionedClustersPatch as ProvisionedClustersPatchMapper, + HybridIdentityMetadata as HybridIdentityMetadataMapper, + AgentPool as AgentPoolMapper, + VirtualNetworks as VirtualNetworksMapper, + VirtualNetworksPatch as VirtualNetworksPatchMapper, + StorageSpaces as StorageSpacesMapper, + StorageSpacesPatch as StorageSpacesPatchMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const provisionedClustersName: OperationURLParameter = { + parameterPath: "provisionedClustersName", + mapper: { + constraints: { + MaxLength: 64, + MinLength: 3 + }, + serializedName: "provisionedClustersName", + required: true, + type: { + name: "String" + } + } +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-05-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const provisionedClusters: OperationParameter = { + parameterPath: "provisionedClusters", + mapper: ProvisionedClustersMapper +}; + +export const provisionedClusters1: OperationParameter = { + parameterPath: "provisionedClusters", + mapper: ProvisionedClustersPatchMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const body: OperationParameter = { + parameterPath: "body", + mapper: HybridIdentityMetadataMapper +}; + +export const hybridIdentityMetadataResourceName: OperationURLParameter = { + parameterPath: "hybridIdentityMetadataResourceName", + mapper: { + constraints: { + MaxLength: 64, + MinLength: 3 + }, + serializedName: "hybridIdentityMetadataResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const agentPoolName: OperationURLParameter = { + parameterPath: "agentPoolName", + mapper: { + constraints: { + MaxLength: 64, + MinLength: 3 + }, + serializedName: "agentPoolName", + required: true, + type: { + name: "String" + } + } +}; + +export const agentPool: OperationParameter = { + parameterPath: "agentPool", + mapper: AgentPoolMapper +}; + +export const customLocationResourceUri: OperationURLParameter = { + parameterPath: "customLocationResourceUri", + mapper: { + serializedName: "customLocationResourceUri", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const virtualNetworksName: OperationURLParameter = { + parameterPath: "virtualNetworksName", + mapper: { + constraints: { + MaxLength: 64, + MinLength: 3 + }, + serializedName: "virtualNetworksName", + required: true, + type: { + name: "String" + } + } +}; + +export const virtualNetworks: OperationParameter = { + parameterPath: "virtualNetworks", + mapper: VirtualNetworksMapper +}; + +export const virtualNetworks1: OperationParameter = { + parameterPath: "virtualNetworks", + mapper: VirtualNetworksPatchMapper +}; + +export const storageSpacesName: OperationURLParameter = { + parameterPath: "storageSpacesName", + mapper: { + constraints: { + MaxLength: 64, + MinLength: 3 + }, + serializedName: "storageSpacesName", + required: true, + type: { + name: "String" + } + } +}; + +export const storageSpaces: OperationParameter = { + parameterPath: "storageSpaces", + mapper: StorageSpacesMapper +}; + +export const storageSpaces1: OperationParameter = { + parameterPath: "storageSpaces", + mapper: StorageSpacesPatchMapper +}; diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/agentPoolOperations.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/agentPoolOperations.ts new file mode 100644 index 000000000000..74884ef121db --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/agentPoolOperations.ts @@ -0,0 +1,358 @@ +/* + * 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 { AgentPoolOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HybridContainerServiceClient } from "../hybridContainerServiceClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + AgentPoolGetOptionalParams, + AgentPoolGetResponse, + AgentPool, + AgentPoolCreateOrUpdateOptionalParams, + AgentPoolCreateOrUpdateResponse, + AgentPoolDeleteOptionalParams, + AgentPoolUpdateOptionalParams, + AgentPoolUpdateResponse, + AgentPoolListByProvisionedClusterOptionalParams, + AgentPoolListByProvisionedClusterResponse +} from "../models"; + +/** Class containing AgentPoolOperations operations. */ +export class AgentPoolOperationsImpl implements AgentPoolOperations { + private readonly client: HybridContainerServiceClient; + + /** + * Initialize a new instance of the class AgentPoolOperations class. + * @param client Reference to the service client + */ + constructor(client: HybridContainerServiceClient) { + this.client = client; + } + + /** + * Gets the agent pool in the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param agentPoolName Parameter for the name of the agent pool in the provisioned cluster + * @param options The options parameters. + */ + get( + resourceGroupName: string, + provisionedClustersName: string, + agentPoolName: string, + options?: AgentPoolGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, provisionedClustersName, agentPoolName, options }, + getOperationSpec + ); + } + + /** + * Creates the agent pool in the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param agentPoolName Parameter for the name of the agent pool in the provisioned cluster + * @param agentPool The agentPool resource definition + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + provisionedClustersName: string, + agentPoolName: string, + agentPool: AgentPool, + options?: AgentPoolCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AgentPoolCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + provisionedClustersName, + agentPoolName, + agentPool, + options + }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates the agent pool in the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param agentPoolName Parameter for the name of the agent pool in the provisioned cluster + * @param agentPool The agentPool resource definition + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + provisionedClustersName: string, + agentPoolName: string, + agentPool: AgentPool, + options?: AgentPoolCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + provisionedClustersName, + agentPoolName, + agentPool, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the agent pool in the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param agentPoolName Parameter for the name of the agent pool in the provisioned cluster + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + provisionedClustersName: string, + agentPoolName: string, + options?: AgentPoolDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, provisionedClustersName, agentPoolName, options }, + deleteOperationSpec + ); + } + + /** + * Updates the agent pool in the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param agentPoolName Parameter for the name of the agent pool in the provisioned cluster + * @param agentPool The agentPool resource definition + * @param options The options parameters. + */ + update( + resourceGroupName: string, + provisionedClustersName: string, + agentPoolName: string, + agentPool: AgentPool, + options?: AgentPoolUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + provisionedClustersName, + agentPoolName, + agentPool, + options + }, + updateOperationSpec + ); + } + + /** + * Gets the agent pools in the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param options The options parameters. + */ + listByProvisionedCluster( + resourceGroupName: string, + provisionedClustersName: string, + options?: AgentPoolListByProvisionedClusterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, provisionedClustersName, options }, + listByProvisionedClusterOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/agentPools/{agentPoolName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AgentPool + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName, + Parameters.agentPoolName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/agentPools/{agentPoolName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AgentPool + }, + 201: { + bodyMapper: Mappers.AgentPool + }, + 202: { + bodyMapper: Mappers.AgentPool + }, + 204: { + bodyMapper: Mappers.AgentPool + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.agentPool, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName, + Parameters.agentPoolName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/agentPools/{agentPoolName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName, + Parameters.agentPoolName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/agentPools/{agentPoolName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.AgentPool + }, + 202: { + bodyMapper: Mappers.AgentPool + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.agentPool, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName, + Parameters.agentPoolName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByProvisionedClusterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/agentPools", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AgentPoolListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/hybridContainerService.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/hybridContainerService.ts new file mode 100644 index 000000000000..82cbc1193b1c --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/hybridContainerService.ts @@ -0,0 +1,101 @@ +/* + * 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 { HybridContainerService } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HybridContainerServiceClient } from "../hybridContainerServiceClient"; +import { + HybridContainerServiceListOrchestratorsOptionalParams, + HybridContainerServiceListOrchestratorsResponse, + HybridContainerServiceListVMSkusOptionalParams, + HybridContainerServiceListVMSkusResponse +} from "../models"; + +/** Class containing HybridContainerService operations. */ +export class HybridContainerServiceImpl implements HybridContainerService { + private readonly client: HybridContainerServiceClient; + + /** + * Initialize a new instance of the class HybridContainerService class. + * @param client Reference to the service client + */ + constructor(client: HybridContainerServiceClient) { + this.client = client; + } + + /** + * Lists the available orchestrators in a custom location for HybridAKS + * @param customLocationResourceUri The fully qualified Azure Resource manager identifier of the custom + * location resource. + * @param options The options parameters. + */ + listOrchestrators( + customLocationResourceUri: string, + options?: HybridContainerServiceListOrchestratorsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { customLocationResourceUri, options }, + listOrchestratorsOperationSpec + ); + } + + /** + * Lists the available VM SKUs in a custom location for HybridAKS + * @param customLocationResourceUri The fully qualified Azure Resource manager identifier of the custom + * location resource. + * @param options The options parameters. + */ + listVMSkus( + customLocationResourceUri: string, + options?: HybridContainerServiceListVMSkusOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { customLocationResourceUri, options }, + listVMSkusOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOrchestratorsOperationSpec: coreClient.OperationSpec = { + path: + "/{customLocationResourceUri}/providers/Microsoft.HybridContainerService/orchestrators", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OrchestratorVersionProfileListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.customLocationResourceUri], + headerParameters: [Parameters.accept], + serializer +}; +const listVMSkusOperationSpec: coreClient.OperationSpec = { + path: + "/{customLocationResourceUri}/providers/Microsoft.HybridContainerService/vmSkus", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VMSkuListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.customLocationResourceUri], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/hybridIdentityMetadataOperations.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/hybridIdentityMetadataOperations.ts new file mode 100644 index 000000000000..a0d630f79a37 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/hybridIdentityMetadataOperations.ts @@ -0,0 +1,358 @@ +/* + * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { HybridIdentityMetadataOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HybridContainerServiceClient } from "../hybridContainerServiceClient"; +import { + HybridIdentityMetadata, + HybridIdentityMetadataListByClusterNextOptionalParams, + HybridIdentityMetadataListByClusterOptionalParams, + HybridIdentityMetadataListByClusterResponse, + HybridIdentityMetadataPutOptionalParams, + HybridIdentityMetadataPutResponse, + HybridIdentityMetadataGetOptionalParams, + HybridIdentityMetadataGetResponse, + HybridIdentityMetadataDeleteOptionalParams, + HybridIdentityMetadataListByClusterNextResponse +} from "../models"; + +/// +/** Class containing HybridIdentityMetadataOperations operations. */ +export class HybridIdentityMetadataOperationsImpl + implements HybridIdentityMetadataOperations { + private readonly client: HybridContainerServiceClient; + + /** + * Initialize a new instance of the class HybridIdentityMetadataOperations class. + * @param client Reference to the service client + */ + constructor(client: HybridContainerServiceClient) { + this.client = client; + } + + /** + * Lists the hybrid identity metadata proxy resource in a cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param options The options parameters. + */ + public listByCluster( + resourceGroupName: string, + provisionedClustersName: string, + options?: HybridIdentityMetadataListByClusterOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByClusterPagingAll( + resourceGroupName, + provisionedClustersName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByClusterPagingPage( + resourceGroupName, + provisionedClustersName, + options, + settings + ); + } + }; + } + + private async *listByClusterPagingPage( + resourceGroupName: string, + provisionedClustersName: string, + options?: HybridIdentityMetadataListByClusterOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: HybridIdentityMetadataListByClusterResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByCluster( + resourceGroupName, + provisionedClustersName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByClusterNext( + resourceGroupName, + provisionedClustersName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByClusterPagingAll( + resourceGroupName: string, + provisionedClustersName: string, + options?: HybridIdentityMetadataListByClusterOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByClusterPagingPage( + resourceGroupName, + provisionedClustersName, + options + )) { + yield* page; + } + } + + /** + * Creates the hybrid identity metadata proxy resource that facilitates the managed identity + * provisioning. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param hybridIdentityMetadataResourceName Parameter for the name of the hybrid identity metadata + * resource. + * @param body Defines the hybridIdentityMetadata. + * @param options The options parameters. + */ + put( + resourceGroupName: string, + provisionedClustersName: string, + hybridIdentityMetadataResourceName: string, + body: HybridIdentityMetadata, + options?: HybridIdentityMetadataPutOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + provisionedClustersName, + hybridIdentityMetadataResourceName, + body, + options + }, + putOperationSpec + ); + } + + /** + * Get the hybrid identity metadata proxy resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param hybridIdentityMetadataResourceName Parameter for the name of the hybrid identity metadata + * resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + provisionedClustersName: string, + hybridIdentityMetadataResourceName: string, + options?: HybridIdentityMetadataGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + provisionedClustersName, + hybridIdentityMetadataResourceName, + options + }, + getOperationSpec + ); + } + + /** + * Deletes the hybrid identity metadata proxy resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param hybridIdentityMetadataResourceName Parameter for the name of the hybrid identity metadata + * resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + provisionedClustersName: string, + hybridIdentityMetadataResourceName: string, + options?: HybridIdentityMetadataDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + provisionedClustersName, + hybridIdentityMetadataResourceName, + options + }, + deleteOperationSpec + ); + } + + /** + * Lists the hybrid identity metadata proxy resource in a cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param options The options parameters. + */ + private _listByCluster( + resourceGroupName: string, + provisionedClustersName: string, + options?: HybridIdentityMetadataListByClusterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, provisionedClustersName, options }, + listByClusterOperationSpec + ); + } + + /** + * ListByClusterNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param nextLink The nextLink from the previous successful call to the ListByCluster method. + * @param options The options parameters. + */ + private _listByClusterNext( + resourceGroupName: string, + provisionedClustersName: string, + nextLink: string, + options?: HybridIdentityMetadataListByClusterNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, provisionedClustersName, nextLink, options }, + listByClusterNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const putOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/hybridIdentityMetadata/{hybridIdentityMetadataResourceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.HybridIdentityMetadata + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName, + Parameters.hybridIdentityMetadataResourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/hybridIdentityMetadata/{hybridIdentityMetadataResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HybridIdentityMetadata + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName, + Parameters.hybridIdentityMetadataResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/hybridIdentityMetadata/{hybridIdentityMetadataResourceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName, + Parameters.hybridIdentityMetadataResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByClusterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}/hybridIdentityMetadata", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HybridIdentityMetadataList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByClusterNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.HybridIdentityMetadataList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/index.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/index.ts new file mode 100644 index 000000000000..9017a42845c3 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./provisionedClustersOperations"; +export * from "./hybridIdentityMetadataOperations"; +export * from "./agentPoolOperations"; +export * from "./hybridContainerService"; +export * from "./operations"; +export * from "./virtualNetworksOperations"; +export * from "./storageSpacesOperations"; diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/operations.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/operations.ts new file mode 100644 index 000000000000..53eedf435a78 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/operations.ts @@ -0,0 +1,144 @@ +/* + * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HybridContainerServiceClient } from "../hybridContainerServiceClient"; +import { + ResourceProviderOperation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: HybridContainerServiceClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: HybridContainerServiceClient) { + this.client = client; + } + + /** @param options The options parameters. */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** @param options The options parameters. */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.HybridContainerService/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourceProviderOperationList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourceProviderOperationList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/provisionedClustersOperations.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/provisionedClustersOperations.ts new file mode 100644 index 000000000000..37ee3b778f56 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/provisionedClustersOperations.ts @@ -0,0 +1,656 @@ +/* + * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { ProvisionedClustersOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HybridContainerServiceClient } from "../hybridContainerServiceClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ProvisionedClustersResponse, + ProvisionedClustersListByResourceGroupNextOptionalParams, + ProvisionedClustersListByResourceGroupOptionalParams, + ProvisionedClustersListByResourceGroupResponse, + ProvisionedClustersListBySubscriptionNextOptionalParams, + ProvisionedClustersListBySubscriptionOptionalParams, + ProvisionedClustersListBySubscriptionResponse, + ProvisionedClustersGetOptionalParams, + ProvisionedClustersGetResponse, + ProvisionedClusters, + ProvisionedClustersCreateOrUpdateOptionalParams, + ProvisionedClustersCreateOrUpdateResponse, + ProvisionedClustersDeleteOptionalParams, + ProvisionedClustersPatch, + ProvisionedClustersUpdateOptionalParams, + ProvisionedClustersUpdateResponse, + ProvisionedClustersListByResourceGroupNextResponse, + ProvisionedClustersListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing ProvisionedClustersOperations operations. */ +export class ProvisionedClustersOperationsImpl + implements ProvisionedClustersOperations { + private readonly client: HybridContainerServiceClient; + + /** + * Initialize a new instance of the class ProvisionedClustersOperations class. + * @param client Reference to the service client + */ + constructor(client: HybridContainerServiceClient) { + this.client = client; + } + + /** + * Gets the Hybrid AKS provisioned cluster in a resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: ProvisionedClustersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ProvisionedClustersListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ProvisionedClustersListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ProvisionedClustersListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Gets the Hybrid AKS provisioned cluster in a subscription + * @param options The options parameters. + */ + public listBySubscription( + options?: ProvisionedClustersListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: ProvisionedClustersListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ProvisionedClustersListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: ProvisionedClustersListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Gets the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param options The options parameters. + */ + get( + resourceGroupName: string, + provisionedClustersName: string, + options?: ProvisionedClustersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, provisionedClustersName, options }, + getOperationSpec + ); + } + + /** + * Creates the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param provisionedClusters The provisionedClusters resource definition. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + provisionedClustersName: string, + provisionedClusters: ProvisionedClusters, + options?: ProvisionedClustersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ProvisionedClustersCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + provisionedClustersName, + provisionedClusters, + options + }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param provisionedClusters The provisionedClusters resource definition. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + provisionedClustersName: string, + provisionedClusters: ProvisionedClusters, + options?: ProvisionedClustersCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + provisionedClustersName, + provisionedClusters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + provisionedClustersName: string, + options?: ProvisionedClustersDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, provisionedClustersName, options }, + deleteOperationSpec + ); + } + + /** + * Updates the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param provisionedClusters The provisionedClusters resource patch definition. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + provisionedClustersName: string, + provisionedClusters: ProvisionedClustersPatch, + options?: ProvisionedClustersUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ProvisionedClustersUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + provisionedClustersName, + provisionedClusters, + options + }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Updates the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param provisionedClusters The provisionedClusters resource patch definition. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + provisionedClustersName: string, + provisionedClusters: ProvisionedClustersPatch, + options?: ProvisionedClustersUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + provisionedClustersName, + provisionedClusters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets the Hybrid AKS provisioned cluster in a resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ProvisionedClustersListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Gets the Hybrid AKS provisioned cluster in a subscription + * @param options The options parameters. + */ + private _listBySubscription( + options?: ProvisionedClustersListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ProvisionedClustersListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: ProvisionedClustersListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProvisionedClustersResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ProvisionedClustersResponse + }, + 201: { + bodyMapper: Mappers.ProvisionedClustersResponse + }, + 202: { + bodyMapper: Mappers.ProvisionedClustersResponse + }, + 204: { + bodyMapper: Mappers.ProvisionedClustersResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.provisionedClusters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters/{provisionedClustersName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ProvisionedClustersResponse + }, + 201: { + bodyMapper: Mappers.ProvisionedClustersResponse + }, + 202: { + bodyMapper: Mappers.ProvisionedClustersResponse + }, + 204: { + bodyMapper: Mappers.ProvisionedClustersResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.provisionedClusters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.provisionedClustersName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/provisionedClusters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProvisionedClustersResponseListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridContainerService/provisionedClusters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProvisionedClustersResponseListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProvisionedClustersResponseListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ProvisionedClustersResponseListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/storageSpacesOperations.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/storageSpacesOperations.ts new file mode 100644 index 000000000000..85a2ce4725e8 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/storageSpacesOperations.ts @@ -0,0 +1,644 @@ +/* + * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { StorageSpacesOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HybridContainerServiceClient } from "../hybridContainerServiceClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + StorageSpaces, + StorageSpacesListByResourceGroupNextOptionalParams, + StorageSpacesListByResourceGroupOptionalParams, + StorageSpacesListByResourceGroupResponse, + StorageSpacesListBySubscriptionNextOptionalParams, + StorageSpacesListBySubscriptionOptionalParams, + StorageSpacesListBySubscriptionResponse, + StorageSpacesRetrieveOptionalParams, + StorageSpacesRetrieveResponse, + StorageSpacesCreateOrUpdateOptionalParams, + StorageSpacesCreateOrUpdateResponse, + StorageSpacesDeleteOptionalParams, + StorageSpacesPatch, + StorageSpacesUpdateOptionalParams, + StorageSpacesUpdateResponse, + StorageSpacesListByResourceGroupNextResponse, + StorageSpacesListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing StorageSpacesOperations operations. */ +export class StorageSpacesOperationsImpl implements StorageSpacesOperations { + private readonly client: HybridContainerServiceClient; + + /** + * Initialize a new instance of the class StorageSpacesOperations class. + * @param client Reference to the service client + */ + constructor(client: HybridContainerServiceClient) { + this.client = client; + } + + /** + * List the Hybrid AKS storage object by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: StorageSpacesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: StorageSpacesListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: StorageSpacesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: StorageSpacesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List the Hybrid AKS storage object by subscription + * @param options The options parameters. + */ + public listBySubscription( + options?: StorageSpacesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: StorageSpacesListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: StorageSpacesListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: StorageSpacesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Gets the Hybrid AKS storage space object + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSpacesName Parameter for the name of the storage object + * @param options The options parameters. + */ + retrieve( + resourceGroupName: string, + storageSpacesName: string, + options?: StorageSpacesRetrieveOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, storageSpacesName, options }, + retrieveOperationSpec + ); + } + + /** + * Puts the Hybrid AKS storage object + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSpacesName Parameter for the name of the storage object + * @param storageSpaces The storageSpaces resource definition. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + storageSpacesName: string, + storageSpaces: StorageSpaces, + options?: StorageSpacesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageSpacesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, storageSpacesName, storageSpaces, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Puts the Hybrid AKS storage object + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSpacesName Parameter for the name of the storage object + * @param storageSpaces The storageSpaces resource definition. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + storageSpacesName: string, + storageSpaces: StorageSpaces, + options?: StorageSpacesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + storageSpacesName, + storageSpaces, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the Hybrid AKS storage object + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSpacesName Parameter for the name of the storage object + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + storageSpacesName: string, + options?: StorageSpacesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, storageSpacesName, options }, + deleteOperationSpec + ); + } + + /** + * Patches the Hybrid AKS storage object + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSpacesName Parameter for the name of the storage object + * @param storageSpaces The storageSpaces resource patch definition. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + storageSpacesName: string, + storageSpaces: StorageSpacesPatch, + options?: StorageSpacesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageSpacesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, storageSpacesName, storageSpaces, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Patches the Hybrid AKS storage object + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSpacesName Parameter for the name of the storage object + * @param storageSpaces The storageSpaces resource patch definition. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + storageSpacesName: string, + storageSpaces: StorageSpacesPatch, + options?: StorageSpacesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + storageSpacesName, + storageSpaces, + options + ); + return poller.pollUntilDone(); + } + + /** + * List the Hybrid AKS storage object by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: StorageSpacesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * List the Hybrid AKS storage object by subscription + * @param options The options parameters. + */ + private _listBySubscription( + options?: StorageSpacesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: StorageSpacesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: StorageSpacesListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const retrieveOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/storageSpaces/{storageSpacesName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.StorageSpaces + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSpacesName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/storageSpaces/{storageSpacesName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.StorageSpaces + }, + 201: { + bodyMapper: Mappers.StorageSpaces + }, + 202: { + bodyMapper: Mappers.StorageSpaces + }, + 204: { + bodyMapper: Mappers.StorageSpaces + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.storageSpaces, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSpacesName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/storageSpaces/{storageSpacesName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSpacesName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/storageSpaces/{storageSpacesName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.StorageSpaces + }, + 201: { + bodyMapper: Mappers.StorageSpaces + }, + 202: { + bodyMapper: Mappers.StorageSpaces + }, + 204: { + bodyMapper: Mappers.StorageSpaces + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.storageSpaces1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSpacesName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/storageSpaces", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.StorageSpacesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridContainerService/storageSpaces", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.StorageSpacesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.StorageSpacesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.StorageSpacesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/virtualNetworksOperations.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/virtualNetworksOperations.ts new file mode 100644 index 000000000000..37b64ad38f58 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operations/virtualNetworksOperations.ts @@ -0,0 +1,645 @@ +/* + * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { VirtualNetworksOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HybridContainerServiceClient } from "../hybridContainerServiceClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + VirtualNetworks, + VirtualNetworksListByResourceGroupNextOptionalParams, + VirtualNetworksListByResourceGroupOptionalParams, + VirtualNetworksListByResourceGroupResponse, + VirtualNetworksListBySubscriptionNextOptionalParams, + VirtualNetworksListBySubscriptionOptionalParams, + VirtualNetworksListBySubscriptionResponse, + VirtualNetworksRetrieveOptionalParams, + VirtualNetworksRetrieveResponse, + VirtualNetworksCreateOrUpdateOptionalParams, + VirtualNetworksCreateOrUpdateResponse, + VirtualNetworksDeleteOptionalParams, + VirtualNetworksPatch, + VirtualNetworksUpdateOptionalParams, + VirtualNetworksUpdateResponse, + VirtualNetworksListByResourceGroupNextResponse, + VirtualNetworksListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing VirtualNetworksOperations operations. */ +export class VirtualNetworksOperationsImpl + implements VirtualNetworksOperations { + private readonly client: HybridContainerServiceClient; + + /** + * Initialize a new instance of the class VirtualNetworksOperations class. + * @param client Reference to the service client + */ + constructor(client: HybridContainerServiceClient) { + this.client = client; + } + + /** + * Lists the Hybrid AKS virtual networks by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: VirtualNetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: VirtualNetworksListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: VirtualNetworksListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: VirtualNetworksListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Lists the Hybrid AKS virtual networks by subscription + * @param options The options parameters. + */ + public listBySubscription( + options?: VirtualNetworksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: VirtualNetworksListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: VirtualNetworksListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: VirtualNetworksListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Gets the Hybrid AKS virtual network + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworksName Parameter for the name of the virtual network + * @param options The options parameters. + */ + retrieve( + resourceGroupName: string, + virtualNetworksName: string, + options?: VirtualNetworksRetrieveOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualNetworksName, options }, + retrieveOperationSpec + ); + } + + /** + * Puts the Hybrid AKS virtual network + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworksName Parameter for the name of the virtual network + * @param virtualNetworks The virtualNetworks resource definition. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + virtualNetworksName: string, + virtualNetworks: VirtualNetworks, + options?: VirtualNetworksCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualNetworksCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, virtualNetworksName, virtualNetworks, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Puts the Hybrid AKS virtual network + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworksName Parameter for the name of the virtual network + * @param virtualNetworks The virtualNetworks resource definition. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualNetworksName: string, + virtualNetworks: VirtualNetworks, + options?: VirtualNetworksCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + virtualNetworksName, + virtualNetworks, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the Hybrid AKS virtual network + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworksName Parameter for the name of the virtual network + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + virtualNetworksName: string, + options?: VirtualNetworksDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualNetworksName, options }, + deleteOperationSpec + ); + } + + /** + * Patches the Hybrid AKS virtual network + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworksName Parameter for the name of the virtual network + * @param virtualNetworks The virtualNetworks resource patch definition. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + virtualNetworksName: string, + virtualNetworks: VirtualNetworksPatch, + options?: VirtualNetworksUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualNetworksUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, virtualNetworksName, virtualNetworks, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Patches the Hybrid AKS virtual network + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworksName Parameter for the name of the virtual network + * @param virtualNetworks The virtualNetworks resource patch definition. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + virtualNetworksName: string, + virtualNetworks: VirtualNetworksPatch, + options?: VirtualNetworksUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + virtualNetworksName, + virtualNetworks, + options + ); + return poller.pollUntilDone(); + } + + /** + * Lists the Hybrid AKS virtual networks by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: VirtualNetworksListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Lists the Hybrid AKS virtual networks by subscription + * @param options The options parameters. + */ + private _listBySubscription( + options?: VirtualNetworksListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: VirtualNetworksListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: VirtualNetworksListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const retrieveOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/virtualNetworks/{virtualNetworksName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworks + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualNetworksName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/virtualNetworks/{virtualNetworksName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworks + }, + 201: { + bodyMapper: Mappers.VirtualNetworks + }, + 202: { + bodyMapper: Mappers.VirtualNetworks + }, + 204: { + bodyMapper: Mappers.VirtualNetworks + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.virtualNetworks, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualNetworksName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/virtualNetworks/{virtualNetworksName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualNetworksName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/virtualNetworks/{virtualNetworksName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworks + }, + 201: { + bodyMapper: Mappers.VirtualNetworks + }, + 202: { + bodyMapper: Mappers.VirtualNetworks + }, + 204: { + bodyMapper: Mappers.VirtualNetworks + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.virtualNetworks1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualNetworksName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/virtualNetworks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworksListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridContainerService/virtualNetworks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworksListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworksListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworksListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/agentPoolOperations.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/agentPoolOperations.ts new file mode 100644 index 000000000000..1e540152997d --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/agentPoolOperations.ts @@ -0,0 +1,112 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + AgentPoolGetOptionalParams, + AgentPoolGetResponse, + AgentPool, + AgentPoolCreateOrUpdateOptionalParams, + AgentPoolCreateOrUpdateResponse, + AgentPoolDeleteOptionalParams, + AgentPoolUpdateOptionalParams, + AgentPoolUpdateResponse, + AgentPoolListByProvisionedClusterOptionalParams, + AgentPoolListByProvisionedClusterResponse +} from "../models"; + +/** Interface representing a AgentPoolOperations. */ +export interface AgentPoolOperations { + /** + * Gets the agent pool in the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param agentPoolName Parameter for the name of the agent pool in the provisioned cluster + * @param options The options parameters. + */ + get( + resourceGroupName: string, + provisionedClustersName: string, + agentPoolName: string, + options?: AgentPoolGetOptionalParams + ): Promise; + /** + * Creates the agent pool in the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param agentPoolName Parameter for the name of the agent pool in the provisioned cluster + * @param agentPool The agentPool resource definition + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + provisionedClustersName: string, + agentPoolName: string, + agentPool: AgentPool, + options?: AgentPoolCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AgentPoolCreateOrUpdateResponse + > + >; + /** + * Creates the agent pool in the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param agentPoolName Parameter for the name of the agent pool in the provisioned cluster + * @param agentPool The agentPool resource definition + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + provisionedClustersName: string, + agentPoolName: string, + agentPool: AgentPool, + options?: AgentPoolCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the agent pool in the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param agentPoolName Parameter for the name of the agent pool in the provisioned cluster + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + provisionedClustersName: string, + agentPoolName: string, + options?: AgentPoolDeleteOptionalParams + ): Promise; + /** + * Updates the agent pool in the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param agentPoolName Parameter for the name of the agent pool in the provisioned cluster + * @param agentPool The agentPool resource definition + * @param options The options parameters. + */ + update( + resourceGroupName: string, + provisionedClustersName: string, + agentPoolName: string, + agentPool: AgentPool, + options?: AgentPoolUpdateOptionalParams + ): Promise; + /** + * Gets the agent pools in the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param options The options parameters. + */ + listByProvisionedCluster( + resourceGroupName: string, + provisionedClustersName: string, + options?: AgentPoolListByProvisionedClusterOptionalParams + ): Promise; +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/hybridContainerService.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/hybridContainerService.ts new file mode 100644 index 000000000000..444fbf60bea0 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/hybridContainerService.ts @@ -0,0 +1,38 @@ +/* + * 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 { + HybridContainerServiceListOrchestratorsOptionalParams, + HybridContainerServiceListOrchestratorsResponse, + HybridContainerServiceListVMSkusOptionalParams, + HybridContainerServiceListVMSkusResponse +} from "../models"; + +/** Interface representing a HybridContainerService. */ +export interface HybridContainerService { + /** + * Lists the available orchestrators in a custom location for HybridAKS + * @param customLocationResourceUri The fully qualified Azure Resource manager identifier of the custom + * location resource. + * @param options The options parameters. + */ + listOrchestrators( + customLocationResourceUri: string, + options?: HybridContainerServiceListOrchestratorsOptionalParams + ): Promise; + /** + * Lists the available VM SKUs in a custom location for HybridAKS + * @param customLocationResourceUri The fully qualified Azure Resource manager identifier of the custom + * location resource. + * @param options The options parameters. + */ + listVMSkus( + customLocationResourceUri: string, + options?: HybridContainerServiceListVMSkusOptionalParams + ): Promise; +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/hybridIdentityMetadataOperations.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/hybridIdentityMetadataOperations.ts new file mode 100644 index 000000000000..d5f0749840d4 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/hybridIdentityMetadataOperations.ts @@ -0,0 +1,79 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + HybridIdentityMetadata, + HybridIdentityMetadataListByClusterOptionalParams, + HybridIdentityMetadataPutOptionalParams, + HybridIdentityMetadataPutResponse, + HybridIdentityMetadataGetOptionalParams, + HybridIdentityMetadataGetResponse, + HybridIdentityMetadataDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a HybridIdentityMetadataOperations. */ +export interface HybridIdentityMetadataOperations { + /** + * Lists the hybrid identity metadata proxy resource in a cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param options The options parameters. + */ + listByCluster( + resourceGroupName: string, + provisionedClustersName: string, + options?: HybridIdentityMetadataListByClusterOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates the hybrid identity metadata proxy resource that facilitates the managed identity + * provisioning. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param hybridIdentityMetadataResourceName Parameter for the name of the hybrid identity metadata + * resource. + * @param body Defines the hybridIdentityMetadata. + * @param options The options parameters. + */ + put( + resourceGroupName: string, + provisionedClustersName: string, + hybridIdentityMetadataResourceName: string, + body: HybridIdentityMetadata, + options?: HybridIdentityMetadataPutOptionalParams + ): Promise; + /** + * Get the hybrid identity metadata proxy resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param hybridIdentityMetadataResourceName Parameter for the name of the hybrid identity metadata + * resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + provisionedClustersName: string, + hybridIdentityMetadataResourceName: string, + options?: HybridIdentityMetadataGetOptionalParams + ): Promise; + /** + * Deletes the hybrid identity metadata proxy resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param hybridIdentityMetadataResourceName Parameter for the name of the hybrid identity metadata + * resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + provisionedClustersName: string, + hybridIdentityMetadataResourceName: string, + options?: HybridIdentityMetadataDeleteOptionalParams + ): Promise; +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/index.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..9017a42845c3 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./provisionedClustersOperations"; +export * from "./hybridIdentityMetadataOperations"; +export * from "./agentPoolOperations"; +export * from "./hybridContainerService"; +export * from "./operations"; +export * from "./virtualNetworksOperations"; +export * from "./storageSpacesOperations"; diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/operations.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..2a94a26532c7 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ResourceProviderOperation, + OperationsListOptionalParams +} from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** @param options The options parameters. */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/provisionedClustersOperations.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/provisionedClustersOperations.ts new file mode 100644 index 000000000000..6b56550a759e --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/provisionedClustersOperations.ts @@ -0,0 +1,129 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + ProvisionedClustersResponse, + ProvisionedClustersListByResourceGroupOptionalParams, + ProvisionedClustersListBySubscriptionOptionalParams, + ProvisionedClustersGetOptionalParams, + ProvisionedClustersGetResponse, + ProvisionedClusters, + ProvisionedClustersCreateOrUpdateOptionalParams, + ProvisionedClustersCreateOrUpdateResponse, + ProvisionedClustersDeleteOptionalParams, + ProvisionedClustersPatch, + ProvisionedClustersUpdateOptionalParams, + ProvisionedClustersUpdateResponse +} from "../models"; + +/// +/** Interface representing a ProvisionedClustersOperations. */ +export interface ProvisionedClustersOperations { + /** + * Gets the Hybrid AKS provisioned cluster in a resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ProvisionedClustersListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the Hybrid AKS provisioned cluster in a subscription + * @param options The options parameters. + */ + listBySubscription( + options?: ProvisionedClustersListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param options The options parameters. + */ + get( + resourceGroupName: string, + provisionedClustersName: string, + options?: ProvisionedClustersGetOptionalParams + ): Promise; + /** + * Creates the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param provisionedClusters The provisionedClusters resource definition. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + provisionedClustersName: string, + provisionedClusters: ProvisionedClusters, + options?: ProvisionedClustersCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ProvisionedClustersCreateOrUpdateResponse + > + >; + /** + * Creates the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param provisionedClusters The provisionedClusters resource definition. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + provisionedClustersName: string, + provisionedClusters: ProvisionedClusters, + options?: ProvisionedClustersCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + provisionedClustersName: string, + options?: ProvisionedClustersDeleteOptionalParams + ): Promise; + /** + * Updates the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param provisionedClusters The provisionedClusters resource patch definition. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + provisionedClustersName: string, + provisionedClusters: ProvisionedClustersPatch, + options?: ProvisionedClustersUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ProvisionedClustersUpdateResponse + > + >; + /** + * Updates the Hybrid AKS provisioned cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param provisionedClustersName Parameter for the name of the provisioned cluster + * @param provisionedClusters The provisionedClusters resource patch definition. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + provisionedClustersName: string, + provisionedClusters: ProvisionedClustersPatch, + options?: ProvisionedClustersUpdateOptionalParams + ): Promise; +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/storageSpacesOperations.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/storageSpacesOperations.ts new file mode 100644 index 000000000000..b1c5234a5f82 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/storageSpacesOperations.ts @@ -0,0 +1,128 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + StorageSpaces, + StorageSpacesListByResourceGroupOptionalParams, + StorageSpacesListBySubscriptionOptionalParams, + StorageSpacesRetrieveOptionalParams, + StorageSpacesRetrieveResponse, + StorageSpacesCreateOrUpdateOptionalParams, + StorageSpacesCreateOrUpdateResponse, + StorageSpacesDeleteOptionalParams, + StorageSpacesPatch, + StorageSpacesUpdateOptionalParams, + StorageSpacesUpdateResponse +} from "../models"; + +/// +/** Interface representing a StorageSpacesOperations. */ +export interface StorageSpacesOperations { + /** + * List the Hybrid AKS storage object by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: StorageSpacesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * List the Hybrid AKS storage object by subscription + * @param options The options parameters. + */ + listBySubscription( + options?: StorageSpacesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the Hybrid AKS storage space object + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSpacesName Parameter for the name of the storage object + * @param options The options parameters. + */ + retrieve( + resourceGroupName: string, + storageSpacesName: string, + options?: StorageSpacesRetrieveOptionalParams + ): Promise; + /** + * Puts the Hybrid AKS storage object + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSpacesName Parameter for the name of the storage object + * @param storageSpaces The storageSpaces resource definition. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + storageSpacesName: string, + storageSpaces: StorageSpaces, + options?: StorageSpacesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageSpacesCreateOrUpdateResponse + > + >; + /** + * Puts the Hybrid AKS storage object + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSpacesName Parameter for the name of the storage object + * @param storageSpaces The storageSpaces resource definition. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + storageSpacesName: string, + storageSpaces: StorageSpaces, + options?: StorageSpacesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the Hybrid AKS storage object + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSpacesName Parameter for the name of the storage object + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + storageSpacesName: string, + options?: StorageSpacesDeleteOptionalParams + ): Promise; + /** + * Patches the Hybrid AKS storage object + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSpacesName Parameter for the name of the storage object + * @param storageSpaces The storageSpaces resource patch definition. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + storageSpacesName: string, + storageSpaces: StorageSpacesPatch, + options?: StorageSpacesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageSpacesUpdateResponse + > + >; + /** + * Patches the Hybrid AKS storage object + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSpacesName Parameter for the name of the storage object + * @param storageSpaces The storageSpaces resource patch definition. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + storageSpacesName: string, + storageSpaces: StorageSpacesPatch, + options?: StorageSpacesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/virtualNetworksOperations.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/virtualNetworksOperations.ts new file mode 100644 index 000000000000..ed13dc4a8f9b --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/operationsInterfaces/virtualNetworksOperations.ts @@ -0,0 +1,128 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + VirtualNetworks, + VirtualNetworksListByResourceGroupOptionalParams, + VirtualNetworksListBySubscriptionOptionalParams, + VirtualNetworksRetrieveOptionalParams, + VirtualNetworksRetrieveResponse, + VirtualNetworksCreateOrUpdateOptionalParams, + VirtualNetworksCreateOrUpdateResponse, + VirtualNetworksDeleteOptionalParams, + VirtualNetworksPatch, + VirtualNetworksUpdateOptionalParams, + VirtualNetworksUpdateResponse +} from "../models"; + +/// +/** Interface representing a VirtualNetworksOperations. */ +export interface VirtualNetworksOperations { + /** + * Lists the Hybrid AKS virtual networks by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: VirtualNetworksListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists the Hybrid AKS virtual networks by subscription + * @param options The options parameters. + */ + listBySubscription( + options?: VirtualNetworksListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the Hybrid AKS virtual network + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworksName Parameter for the name of the virtual network + * @param options The options parameters. + */ + retrieve( + resourceGroupName: string, + virtualNetworksName: string, + options?: VirtualNetworksRetrieveOptionalParams + ): Promise; + /** + * Puts the Hybrid AKS virtual network + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworksName Parameter for the name of the virtual network + * @param virtualNetworks The virtualNetworks resource definition. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + virtualNetworksName: string, + virtualNetworks: VirtualNetworks, + options?: VirtualNetworksCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualNetworksCreateOrUpdateResponse + > + >; + /** + * Puts the Hybrid AKS virtual network + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworksName Parameter for the name of the virtual network + * @param virtualNetworks The virtualNetworks resource definition. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualNetworksName: string, + virtualNetworks: VirtualNetworks, + options?: VirtualNetworksCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the Hybrid AKS virtual network + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworksName Parameter for the name of the virtual network + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + virtualNetworksName: string, + options?: VirtualNetworksDeleteOptionalParams + ): Promise; + /** + * Patches the Hybrid AKS virtual network + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworksName Parameter for the name of the virtual network + * @param virtualNetworks The virtualNetworks resource patch definition. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + virtualNetworksName: string, + virtualNetworks: VirtualNetworksPatch, + options?: VirtualNetworksUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VirtualNetworksUpdateResponse + > + >; + /** + * Patches the Hybrid AKS virtual network + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworksName Parameter for the name of the virtual network + * @param virtualNetworks The virtualNetworks resource patch definition. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + virtualNetworksName: string, + virtualNetworks: VirtualNetworksPatch, + options?: VirtualNetworksUpdateOptionalParams + ): Promise; +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/pagingHelper.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/pagingHelper.ts new file mode 100644 index 000000000000..d85fc13bce1e --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given a result page from a pageable operation, returns a + * continuation token that can be used to begin paging from + * that point later. + * @param page A result object from calling .byPage() on a paged operation. + * @returns The continuation token that can be passed into byPage(). + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/hybridcontainerservice/arm-hybridcontainerservice/test/sampleTest.ts b/sdk/hybridcontainerservice/arm-hybridcontainerservice/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/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/hybridcontainerservice/arm-hybridcontainerservice/tsconfig.json b/sdk/hybridcontainerservice/arm-hybridcontainerservice/tsconfig.json new file mode 100644 index 000000000000..4db387467821 --- /dev/null +++ b/sdk/hybridcontainerservice/arm-hybridcontainerservice/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true, + "paths": { + "@azure/arm-hybridcontainerservice": [ + "./src/index" + ] + } + }, + "include": [ + "./src/**/*.ts", + "./test/**/*.ts", + "samples-dev/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/hybridcontainerservice/ci.mgmt.yml b/sdk/hybridcontainerservice/ci.mgmt.yml new file mode 100644 index 000000000000..41398555ae27 --- /dev/null +++ b/sdk/hybridcontainerservice/ci.mgmt.yml @@ -0,0 +1,38 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/hybridcontainerservice/arm-hybridcontainerservice + - sdk/hybridcontainerservice/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/hybridcontainerservice/arm-hybridcontainerservice + - sdk/hybridcontainerservice/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: hybridcontainerservice + Artifacts: + - name: azure-arm-hybridcontainerservice + safeName: azurearmhybridcontainerservice + \ No newline at end of file