From e65b742fa2706252cfed6fdde399e080e668eddf Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 21 Oct 2022 03:32:36 +0000 Subject: [PATCH] CodeGen from PR 21219 in Azure/azure-rest-api-specs [Go] update readme.go.md (#21219) --- common/config/rush/pnpm-lock.yaml | 83 +- rush.json | 5 + sdk/elasticsans/arm-elasticsan/CHANGELOG.md | 5 + sdk/elasticsans/arm-elasticsan/LICENSE | 21 + sdk/elasticsans/arm-elasticsan/README.md | 109 ++ sdk/elasticsans/arm-elasticsan/_meta.json | 8 + .../arm-elasticsan/api-extractor.json | 31 + sdk/elasticsans/arm-elasticsan/package.json | 113 +++ .../review/arm-elasticsan.api.md | 536 ++++++++++ .../arm-elasticsan/rollup.config.js | 122 +++ sdk/elasticsans/arm-elasticsan/sample.env | 4 + .../src/elasticSanManagement.ts | 161 +++ sdk/elasticsans/arm-elasticsan/src/index.ts | 12 + sdk/elasticsans/arm-elasticsan/src/lroImpl.ts | 34 + .../arm-elasticsan/src/models/index.ts | 787 +++++++++++++++ .../arm-elasticsan/src/models/mappers.ts | 935 ++++++++++++++++++ .../arm-elasticsan/src/models/parameters.ts | 199 ++++ .../src/operations/elasticSans.ts | 683 +++++++++++++ .../arm-elasticsan/src/operations/index.ts | 13 + .../src/operations/operations.ts | 98 ++ .../arm-elasticsan/src/operations/skus.ts | 96 ++ .../src/operations/volumeGroups.ts | 629 ++++++++++++ .../arm-elasticsan/src/operations/volumes.ts | 673 +++++++++++++ .../src/operationsInterfaces/elasticSans.ts | 139 +++ .../src/operationsInterfaces/index.ts | 13 + .../src/operationsInterfaces/operations.ts | 22 + .../src/operationsInterfaces/skus.ts | 22 + .../src/operationsInterfaces/volumeGroups.ts | 147 +++ .../src/operationsInterfaces/volumes.ts | 157 +++ .../arm-elasticsan/test/sampleTest.ts | 43 + sdk/elasticsans/arm-elasticsan/tsconfig.json | 27 + sdk/elasticsans/ci.mgmt.yml | 38 + 32 files changed, 5938 insertions(+), 27 deletions(-) create mode 100644 sdk/elasticsans/arm-elasticsan/CHANGELOG.md create mode 100644 sdk/elasticsans/arm-elasticsan/LICENSE create mode 100644 sdk/elasticsans/arm-elasticsan/README.md create mode 100644 sdk/elasticsans/arm-elasticsan/_meta.json create mode 100644 sdk/elasticsans/arm-elasticsan/api-extractor.json create mode 100644 sdk/elasticsans/arm-elasticsan/package.json create mode 100644 sdk/elasticsans/arm-elasticsan/review/arm-elasticsan.api.md create mode 100644 sdk/elasticsans/arm-elasticsan/rollup.config.js create mode 100644 sdk/elasticsans/arm-elasticsan/sample.env create mode 100644 sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/lroImpl.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/models/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/models/mappers.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/models/parameters.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/skus.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts create mode 100644 sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts create mode 100644 sdk/elasticsans/arm-elasticsan/test/sampleTest.ts create mode 100644 sdk/elasticsans/arm-elasticsan/tsconfig.json create mode 100644 sdk/elasticsans/ci.mgmt.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 8ddfa30e8fb9..b78bc8f5674b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -85,6 +85,7 @@ specifiers: '@rush-temp/arm-domainservices': file:./projects/arm-domainservices.tgz '@rush-temp/arm-dynatrace': file:./projects/arm-dynatrace.tgz '@rush-temp/arm-education': file:./projects/arm-education.tgz + '@rush-temp/arm-elasticsan': file:./projects/arm-elasticsan.tgz '@rush-temp/arm-eventgrid': file:./projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:./projects/arm-eventhub.tgz '@rush-temp/arm-eventhub-profile-2020-09-01-hybrid': file:./projects/arm-eventhub-profile-2020-09-01-hybrid.tgz @@ -404,6 +405,7 @@ dependencies: '@rush-temp/arm-domainservices': file:projects/arm-domainservices.tgz '@rush-temp/arm-dynatrace': file:projects/arm-dynatrace.tgz '@rush-temp/arm-education': file:projects/arm-education.tgz + '@rush-temp/arm-elasticsan': file:projects/arm-elasticsan.tgz '@rush-temp/arm-eventgrid': file:projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:projects/arm-eventhub.tgz '@rush-temp/arm-eventhub-profile-2020-09-01-hybrid': file:projects/arm-eventhub-profile-2020-09-01-hybrid.tgz @@ -2263,7 +2265,7 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/chai-as-promised/7.1.5: @@ -2285,7 +2287,7 @@ packages: /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/cookie/0.4.1: @@ -2320,7 +2322,7 @@ packages: /@types/express-serve-static-core/4.17.31: resolution: {integrity: sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 dev: false @@ -2337,20 +2339,20 @@ packages: /@types/fs-extra/8.1.2: resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/inquirer/8.2.4: @@ -2362,7 +2364,7 @@ packages: /@types/is-buffer/2.0.0: resolution: {integrity: sha512-0f7N/e3BAz32qDYvgB4d2cqv1DqUwvGxHkXsrucICn8la1Vb6Yl6Eg8mPScGwUiqHJeE7diXlzaK+QMA9m4Gxw==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/json-schema/7.0.11: @@ -2376,13 +2378,13 @@ packages: /@types/jsonwebtoken/8.5.9: resolution: {integrity: sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/jws/3.2.4: resolution: {integrity: sha512-aqtH4dPw1wUjFZaeMD1ak/pf8iXlu/odFe+trJrvw0g1sTh93i+SCykg0Ek8C6B7rVK3oBORbfZAsKO7P10etg==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/md5/2.3.2: @@ -2418,13 +2420,13 @@ packages: /@types/mock-fs/4.13.1: resolution: {integrity: sha512-m6nFAJ3lBSnqbvDZioawRvpLXSaPyn52Srf7OfzjubYbYX8MTUdIgDxQl0wEapm4m/pNYSd9TXocpQ0TvZFlYA==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/mock-require/2.0.1: resolution: {integrity: sha512-O7U5DVGboY/Crueb5/huUCIRjKtRVRaLmRDbZJBlDQgJn966z3aiFDN+6AtYviu2ExwMkl34LjT/IiC0OPtKuQ==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/ms/0.7.31: @@ -2442,7 +2444,7 @@ packages: /@types/node-fetch/2.6.2: resolution: {integrity: sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 form-data: 3.0.1 dev: false @@ -2497,7 +2499,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/semaphore/1.1.1: @@ -2508,7 +2510,7 @@ packages: resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} dependencies: '@types/mime': 3.0.1 - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/sinon/10.0.13: @@ -2530,13 +2532,13 @@ packages: /@types/stoppable/1.1.1: resolution: {integrity: sha512-b8N+fCADRIYYrGZOcmOR8ZNBOqhktWTB/bMUl5LvGtT201QKJZOOH5UsFyI3qtteM6ZAJbJqZoBcLqqxKIwjhw==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/through/0.0.30: resolution: {integrity: sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/tough-cookie/4.0.2: @@ -2550,13 +2552,13 @@ packages: /@types/tunnel/0.0.1: resolution: {integrity: sha512-AOqu6bQu5MSWwYvehMXLukFHnupHrpZ8nvgae5Ggie9UwzDR1CCwoXgSSWNZJuyOlCdfdsWMA5F2LlmvyoTv8A==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/tunnel/0.0.3: resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/underscore/1.11.4: @@ -2574,19 +2576,19 @@ packages: /@types/ws/7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/ws/8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/xml2js/0.4.11: resolution: {integrity: sha512-JdigeAKmCyoJUiQljjr7tQG3if9NkqGUgwEUqBvV0N7LM4HyQk7UXCnusRa1lnvXAEYJ8mw8GtZWioagNztOwA==} dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false /@types/yargs-parser/21.0.0: @@ -2603,7 +2605,7 @@ packages: resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} requiresBuild: true dependencies: - '@types/node': 14.18.32 + '@types/node': 18.11.3 dev: false optional: true @@ -3678,7 +3680,7 @@ packages: resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) dependencies: - ms: 2.1.1 + ms: 2.1.3 dev: false /debug/3.2.7: @@ -3899,7 +3901,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 4.6.4 + typescript: 4.8.4 dev: false /ecdsa-sig-formatter/1.0.11: @@ -3950,7 +3952,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.12 - '@types/node': 14.18.32 + '@types/node': 18.11.3 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -4964,7 +4966,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: false @@ -12004,6 +12006,33 @@ packages: - supports-color dev: false + file:projects/arm-elasticsan.tgz: + resolution: {integrity: sha512-6RuzvNxyhsdtTe7vgQglS2kcQv7wkHjKSYr+/J64AYxu3rZuTKRo2dP/L5gEZupt+XscIdGayGShTNMVY18uJA==, tarball: file:projects/arm-elasticsan.tgz} + name: '@rush-temp/arm-elasticsan' + version: 0.0.0 + dependencies: + '@azure/identity': 2.1.0 + '@microsoft/api-extractor': 7.33.4 + '@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 + 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_rollup@2.79.1 + tslib: 2.4.0 + typescript: 4.6.4 + uglify-js: 3.17.3 + transitivePeerDependencies: + - '@types/node' + - supports-color + dev: false + file:projects/arm-eventgrid.tgz: resolution: {integrity: sha512-rpLiIRWixWRYJ7TQhgfsQdGwlJ3eEBvnf8oo+uj596ZyL0s1bt1H1f/+RybDO54kullcIaEaeCJQTBypK69qjQ==, tarball: file:projects/arm-eventgrid.tgz} name: '@rush-temp/arm-eventgrid' @@ -15859,7 +15888,7 @@ packages: dev: false file:projects/confidential-ledger.tgz: - resolution: {integrity: sha512-S/QWt7CPWGWM0MTdZebC17NYNRswrgujuMSQOhtTTlSPL92XUzBVTKdzHFfIDlfAiWm2Iw5eM/U5uqTjV7V3rw==, tarball: file:projects/confidential-ledger.tgz} + resolution: {integrity: sha512-uaZbNCpDVM8zmXzCYBZx8e+ymDPt+hXZeuM9/5mG4RJ9+i28uWOSpzoERQjH8hiNbccQEabSKyXOgsQ4LKKPsQ==, tarball: file:projects/confidential-ledger.tgz} name: '@rush-temp/confidential-ledger' version: 0.0.0 dependencies: diff --git a/rush.json b/rush.json index 5bbb9b90d0c0..ddf119796bf0 100644 --- a/rush.json +++ b/rush.json @@ -1905,6 +1905,11 @@ "packageName": "@azure-rest/load-testing", "projectFolder": "sdk/loadtestservice/load-testing-rest", "versionPolicyName": "client" + }, + { + "packageName": "@azure/arm-elasticsan", + "projectFolder": "sdk/elasticsans/arm-elasticsan", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md new file mode 100644 index 000000000000..aeae1d1ddf75 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-10-21) + +The package of @azure/arm-elasticsan 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/elasticsans/arm-elasticsan/LICENSE b/sdk/elasticsans/arm-elasticsan/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/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/elasticsans/arm-elasticsan/README.md b/sdk/elasticsans/arm-elasticsan/README.md new file mode 100644 index 000000000000..3528d9b75ee3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/README.md @@ -0,0 +1,109 @@ +# Azure ElasticSanManagement client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ElasticSanManagement client. + + + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-elasticsan) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-elasticsan?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-elasticsan` package + +Install the Azure ElasticSanManagement client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-elasticsan +``` + +### Create and authenticate a `ElasticSanManagement` + +To create a client object to access the Azure ElasticSanManagement API, you will need the `endpoint` of your Azure ElasticSanManagement resource and a `credential`. The Azure ElasticSanManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure ElasticSanManagement 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 ElasticSanManagement** 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 { ElasticSanManagement } = require("@azure/arm-elasticsan"); +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 ElasticSanManagement(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new ElasticSanManagement(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 + +### ElasticSanManagement + +`ElasticSanManagement` is the primary interface for developers using the Azure ElasticSanManagement client library. Explore the methods on this client object to understand the different features of the Azure ElasticSanManagement 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%2Felasticsans%2Farm-elasticsan%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/elasticsans/arm-elasticsan/_meta.json b/sdk/elasticsans/arm-elasticsan/_meta.json new file mode 100644 index 000000000000..7a4a27c24af0 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "e1da7cbab8d4f554484dedb676ba7bdbdf6cdf78", + "readme": "specification/elasticsan/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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/elasticsan/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.2", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.4", + "use": "@autorest/typescript@6.0.0-rc.2" +} \ No newline at end of file diff --git a/sdk/elasticsans/arm-elasticsan/api-extractor.json b/sdk/elasticsans/arm-elasticsan/api-extractor.json new file mode 100644 index 000000000000..4ebc36d5b551 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/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-elasticsan.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/elasticsans/arm-elasticsan/package.json b/sdk/elasticsans/arm-elasticsan/package.json new file mode 100644 index 000000000000..2045c1ccab39 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/package.json @@ -0,0 +1,113 @@ +{ + "name": "@azure/arm-elasticsan", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for ElasticSanManagement.", + "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.5.0", + "@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-elasticsan.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", + "@azure/dev-tool": "^1.0.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan", + "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/elasticSanManagement.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan.api.md new file mode 100644 index 000000000000..cb2f4b6dfbe4 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan.api.md @@ -0,0 +1,536 @@ +## API Report File for "@azure/arm-elasticsan" + +> 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 type CreatedByType = string; + +// @public +export interface ElasticSan extends TrackedResource { + availabilityZones?: string[]; + baseSizeTiB: number; + extendedCapacitySizeTiB: number; + readonly provisioningState?: ProvisioningStates; + sku: Sku; + readonly systemData?: SystemData; + readonly totalIops?: number; + readonly totalMBps?: number; + readonly totalSizeTiB?: number; + readonly totalVolumeSizeGiB?: number; + readonly volumeGroupCount?: number; +} + +// @public +export interface ElasticSanList { + readonly nextLink?: string; + value: ElasticSan[]; +} + +// @public (undocumented) +export class ElasticSanManagement extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ElasticSanManagementOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + elasticSans: ElasticSans; + // (undocumented) + operations: Operations; + // (undocumented) + skus: Skus; + // (undocumented) + subscriptionId: string; + // (undocumented) + volumeGroups: VolumeGroups; + // (undocumented) + volumes: Volumes; +} + +// @public +export interface ElasticSanManagementOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface ElasticSanOperationDisplay { + description: string; + operation: string; + provider: string; + resource: string; +} + +// @public +export interface ElasticSanOperationListResult { + nextLink?: string; + value: ElasticSanRPOperation[]; +} + +// @public +export interface ElasticSanRPOperation { + readonly display?: ElasticSanOperationDisplay; + readonly isDataAction?: boolean; + name: string; +} + +// @public +export interface ElasticSans { + beginCreate(resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): Promise, ElasticSansCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): Promise, ElasticSansUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): Promise; + get(resourceGroupName: string, elasticSanName: string, options?: ElasticSansGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: ElasticSansListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: ElasticSansListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ElasticSansCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ElasticSansCreateResponse = ElasticSan; + +// @public +export interface ElasticSansDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ElasticSansGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ElasticSansGetResponse = ElasticSan; + +// @public +export interface ElasticSansListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ElasticSansListByResourceGroupNextResponse = ElasticSanList; + +// @public +export interface ElasticSansListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ElasticSansListByResourceGroupResponse = ElasticSanList; + +// @public +export interface ElasticSansListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ElasticSansListBySubscriptionNextResponse = ElasticSanList; + +// @public +export interface ElasticSansListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ElasticSansListBySubscriptionResponse = ElasticSanList; + +// @public +export interface ElasticSansUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ElasticSansUpdateResponse = ElasticSan; + +// @public +export interface ElasticSanUpdate { + baseSizeTiB?: number; + extendedCapacitySizeTiB?: number; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type EncryptionType = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorModel { + error?: ErrorResponse; +} + +// @public +export interface ErrorResponse { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorResponse[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface IscsiTargetInfo { + readonly provisioningState?: ProvisioningStates; + status?: OperationalStatus; + readonly targetIqn?: string; + readonly targetPortalHostname?: string; + readonly targetPortalPort?: number; +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownEncryptionType { + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey" +} + +// @public +export enum KnownOperationalStatus { + Healthy = "Healthy", + Invalid = "Invalid", + Running = "Running", + Stopped = "Stopped", + StoppedDeallocated = "Stopped (deallocated)", + Unhealthy = "Unhealthy", + Unknown = "Unknown", + Updating = "Updating" +} + +// @public +export enum KnownProvisioningStates { + Canceled = "Canceled", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Invalid = "Invalid", + Pending = "Pending", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownSkuName { + PremiumLRS = "Premium_LRS", + PremiumZRS = "Premium_ZRS" +} + +// @public +export enum KnownSkuTier { + Premium = "Premium" +} + +// @public +export enum KnownStorageTargetType { + Iscsi = "Iscsi", + None = "None" +} + +// @public +export interface NetworkRuleSet { + virtualNetworkRules?: VirtualNetworkRule[]; +} + +// @public +export type OperationalStatus = string; + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = ElasticSanOperationListResult; + +// @public +export type ProvisioningStates = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface Sku { + name: SkuName; + tier?: SkuTier; +} + +// @public +export interface SKUCapability { + readonly name?: string; + readonly value?: string; +} + +// @public +export interface SkuInformation { + readonly capabilities?: SKUCapability[]; + readonly locationInfo?: SkuLocationInfo[]; + readonly locations?: string[]; + name: SkuName; + readonly resourceType?: string; + tier?: SkuTier; +} + +// @public +export interface SkuInformationList { + readonly value?: SkuInformation[]; +} + +// @public +export interface SkuLocationInfo { + readonly location?: string; + readonly zones?: string[]; +} + +// @public +export type SkuName = string; + +// @public +export interface Skus { + list(options?: SkusListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SkusListOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type SkusListResponse = SkuInformationList; + +// @public +export type SkuTier = string; + +// @public +export interface SourceCreationData { + createSource?: "None"; + sourceUri?: string; +} + +// @public +export type State = "provisioning" | "deprovisioning" | "succeeded" | "failed" | "networkSourceDeleted"; + +// @public +export type StorageTargetType = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location?: string; +} + +// @public +export interface VirtualNetworkRule { + action?: "Allow"; + readonly state?: State; + virtualNetworkResourceId: string; +} + +// @public +export interface Volume extends Resource { + creationData?: SourceCreationData; + sizeGiB?: number; + readonly storageTarget?: IscsiTargetInfo; + readonly systemData?: SystemData; + readonly volumeId?: string; +} + +// @public +export interface VolumeGroup extends Resource { + encryption?: EncryptionType; + networkAcls?: NetworkRuleSet; + protocolType?: StorageTargetType; + readonly provisioningState?: ProvisioningStates; + readonly systemData?: SystemData; +} + +// @public +export interface VolumeGroupList { + readonly nextLink?: string; + value: VolumeGroup[]; +} + +// @public +export interface VolumeGroups { + beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): Promise, VolumeGroupsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): Promise, VolumeGroupsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): Promise; + get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsGetOptionalParams): Promise; + listByElasticSan(resourceGroupName: string, elasticSanName: string, options?: VolumeGroupsListByElasticSanOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VolumeGroupsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VolumeGroupsCreateResponse = VolumeGroup; + +// @public +export interface VolumeGroupsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VolumeGroupsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumeGroupsGetResponse = VolumeGroup; + +// @public +export interface VolumeGroupsListByElasticSanNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumeGroupsListByElasticSanNextResponse = VolumeGroupList; + +// @public +export interface VolumeGroupsListByElasticSanOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumeGroupsListByElasticSanResponse = VolumeGroupList; + +// @public +export interface VolumeGroupsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VolumeGroupsUpdateResponse = VolumeGroup; + +// @public +export interface VolumeGroupUpdate { + encryption?: EncryptionType; + networkAcls?: NetworkRuleSet; + protocolType?: StorageTargetType; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface VolumeList { + readonly nextLink?: string; + value: Volume[]; +} + +// @public +export interface Volumes { + beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): Promise, VolumesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): Promise, VolumesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): Promise; + get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesGetOptionalParams): Promise; + listByVolumeGroup(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumesListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface VolumesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VolumesCreateResponse = Volume; + +// @public +export interface VolumesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface VolumesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesGetResponse = Volume; + +// @public +export interface VolumesListByVolumeGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesListByVolumeGroupNextResponse = VolumeList; + +// @public +export interface VolumesListByVolumeGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type VolumesListByVolumeGroupResponse = VolumeList; + +// @public +export interface VolumesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type VolumesUpdateResponse = Volume; + +// @public +export interface VolumeUpdate { + sizeGiB?: number; + tags?: { + [propertyName: string]: string; + }; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/elasticsans/arm-elasticsan/rollup.config.js b/sdk/elasticsans/arm-elasticsan/rollup.config.js new file mode 100644 index 000000000000..3f89d7309da5 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/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/elasticsans/arm-elasticsan/sample.env b/sdk/elasticsans/arm-elasticsan/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/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/elasticsans/arm-elasticsan/src/elasticSanManagement.ts b/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts new file mode 100644 index 000000000000..bc785495c37c --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts @@ -0,0 +1,161 @@ +/* + * 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 { + OperationsImpl, + SkusImpl, + ElasticSansImpl, + VolumeGroupsImpl, + VolumesImpl +} from "./operations"; +import { + Operations, + Skus, + ElasticSans, + VolumeGroups, + Volumes +} from "./operationsInterfaces"; +import { ElasticSanManagementOptionalParams } from "./models"; + +export class ElasticSanManagement extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the ElasticSanManagement 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?: ElasticSanManagementOptionalParams + ) { + 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: ElasticSanManagementOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-elasticsan/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: + 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}`, + 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 || "2021-11-20-preview"; + this.operations = new OperationsImpl(this); + this.skus = new SkusImpl(this); + this.elasticSans = new ElasticSansImpl(this); + this.volumeGroups = new VolumeGroupsImpl(this); + this.volumes = new VolumesImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + operations: Operations; + skus: Skus; + elasticSans: ElasticSans; + volumeGroups: VolumeGroups; + volumes: Volumes; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/index.ts b/sdk/elasticsans/arm-elasticsan/src/index.ts new file mode 100644 index 000000000000..f37d6b153cb6 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/index.ts @@ -0,0 +1,12 @@ +/* + * 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 "./models"; +export { ElasticSanManagement } from "./elasticSanManagement"; +export * from "./operationsInterfaces"; diff --git a/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts b/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/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/elasticsans/arm-elasticsan/src/models/index.ts b/sdk/elasticsans/arm-elasticsan/src/models/index.ts new file mode 100644 index 000000000000..445e60454a70 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/models/index.ts @@ -0,0 +1,787 @@ +/* + * 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"; + +/** List of operations supported by the RP. */ +export interface ElasticSanOperationListResult { + /** An array of operations supported by the ElasticSan RP. */ + value: ElasticSanRPOperation[]; + /** URI to fetch the next section of the paginated response. */ + nextLink?: string; +} + +/** Description of a ElasticSan RP Operation */ +export interface ElasticSanRPOperation { + /** The name of the operation being performed on this particular object */ + name: string; + /** + * Indicates whether the operation applies to data-plane. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** + * Additional metadata about RP operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly display?: ElasticSanOperationDisplay; +} + +/** Metadata about an operation. */ +export interface ElasticSanOperationDisplay { + /** Localized friendly form of the resource provider name. */ + provider: string; + /** Localized friendly form of the resource type related to this action/operation. */ + resource: string; + /** Localized friendly name for the operation, as it should be shown to the user. */ + operation: string; + /** Localized friendly description for the operation, as it should be shown to the user. */ + description: string; +} + +/** The resource management error response. */ +export interface ErrorModel { + /** RP error response. */ + error?: ErrorResponse; +} + +/** The resource management error response. */ +export interface ErrorResponse { + /** + * 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?: ErrorResponse[]; + /** + * 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; +} + +/** List of SKU Information objects */ +export interface SkuInformationList { + /** + * List of ResourceType Sku + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: SkuInformation[]; +} + +/** ElasticSAN SKU and its properties */ +export interface SkuInformation { + /** Sku Name */ + name: SkuName; + /** Sku Tier */ + tier?: SkuTier; + /** + * The type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceType?: string; + /** + * The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly locations?: string[]; + /** + * Availability of the SKU for the location/zone + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly locationInfo?: SkuLocationInfo[]; + /** + * The capability information in the specified SKU. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly capabilities?: SKUCapability[]; +} + +/** The location info. */ +export interface SkuLocationInfo { + /** + * The location. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly location?: string; + /** + * The zones. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly zones?: string[]; +} + +/** The capability information in the specified SKU. */ +export interface SKUCapability { + /** + * The name of capability. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * A string value to indicate states of given capability. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: string; +} + +/** List of Elastic Sans */ +export interface ElasticSanList { + /** An array of Elastic San objects. */ + value: ElasticSan[]; + /** + * URI to fetch the next section of the paginated response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The SKU name. Required for account creation; optional for update. */ +export interface Sku { + /** The sku name. */ + name: SkuName; + /** The sku tier. */ + tier?: SkuTier; +} + +/** 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; +} + +/** The resource model definition. */ +export interface Resource { + /** + * Azure resource identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Azure resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Azure resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Azure resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** Response for ElasticSan update request. */ +export interface ElasticSanUpdate { + /** Update tags */ + tags?: { [propertyName: string]: string }; + /** Base size of the Elastic San appliance in TiB. */ + baseSizeTiB?: number; + /** Extended size of the Elastic San appliance in TiB. */ + extendedCapacitySizeTiB?: number; +} + +/** List of Volume Groups */ +export interface VolumeGroupList { + /** An array of Volume Groups objects. */ + value: VolumeGroup[]; + /** + * URI to fetch the next section of the paginated response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A set of rules governing the network accessibility. */ +export interface NetworkRuleSet { + /** The list of virtual network rules. */ + virtualNetworkRules?: VirtualNetworkRule[]; +} + +/** Virtual Network rule. */ +export interface VirtualNetworkRule { + /** Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. */ + virtualNetworkResourceId: string; + /** The action of virtual network rule. */ + action?: "Allow"; + /** + * Gets the state of virtual network rule. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly state?: State; +} + +/** Volume Group request. */ +export interface VolumeGroupUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Type of storage target */ + protocolType?: StorageTargetType; + /** Type of encryption */ + encryption?: EncryptionType; + /** A collection of rules governing the accessibility from specific network locations. */ + networkAcls?: NetworkRuleSet; +} + +/** Data source used when creating the volume. */ +export interface SourceCreationData { + /** This enumerates the possible sources of a volume creation. */ + createSource?: "None"; + /** If createOption is Copy, this is the ARM id of the source snapshot or disk. If createOption is Restore, this is the ARM-like id of the source disk restore point. */ + sourceUri?: string; +} + +/** Iscsi target information */ +export interface IscsiTargetInfo { + /** + * iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetIqn?: string; + /** + * iSCSI Target Portal Host Name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetPortalHostname?: string; + /** + * iSCSI Target Portal Port + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetPortalPort?: number; + /** + * State of the operation on the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningStates; + /** Operational status of the iSCSI Target. */ + status?: OperationalStatus; +} + +/** Response for Volume request. */ +export interface VolumeUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Volume size. */ + sizeGiB?: number; +} + +/** List of Volumes */ +export interface VolumeList { + /** An array of Volume objects. */ + value: Volume[]; + /** + * URI to fetch the next section of the paginated response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The resource model definition for a ARM tracked top level resource. */ +export interface TrackedResource extends Resource { + /** The geo-location where the resource lives. */ + location?: string; +} + +/** Response for Volume Group request. */ +export interface VolumeGroup extends Resource { + /** + * Resource metadata required by ARM RPC + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * State of the operation on the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningStates; + /** Type of storage target */ + protocolType?: StorageTargetType; + /** Type of encryption */ + encryption?: EncryptionType; + /** A collection of rules governing the accessibility from specific network locations. */ + networkAcls?: NetworkRuleSet; +} + +/** Response for Volume request. */ +export interface Volume extends Resource { + /** + * Resource metadata required by ARM RPC + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * Unique Id of the volume in GUID format + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly volumeId?: string; + /** State of the operation on the resource. */ + creationData?: SourceCreationData; + /** Volume size. */ + sizeGiB?: number; + /** + * Storage target information + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly storageTarget?: IscsiTargetInfo; +} + +/** Response for ElasticSan request. */ +export interface ElasticSan extends TrackedResource { + /** + * Resource metadata required by ARM RPC + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** resource sku */ + sku: Sku; + /** Logical zone for Elastic San resource; example: ["1"]. */ + availabilityZones?: string[]; + /** + * State of the operation on the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningStates; + /** Base size of the Elastic San appliance in TiB. */ + baseSizeTiB: number; + /** Extended size of the Elastic San appliance in TiB. */ + extendedCapacitySizeTiB: number; + /** + * Total size of the provisioned Volumes in GiB. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalVolumeSizeGiB?: number; + /** + * Total number of volume groups in this Elastic San appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly volumeGroupCount?: number; + /** + * Total Provisioned IOPS of the Elastic San appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalIops?: number; + /** + * Total Provisioned MBps Elastic San appliance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalMBps?: number; + /** + * Total size of the Elastic San appliance in TB. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalSizeTiB?: number; +} + +/** Known values of {@link SkuName} that the service accepts. */ +export enum KnownSkuName { + /** Premium locally redundant storage */ + PremiumLRS = "Premium_LRS", + /** Premium zone redundant storage */ + PremiumZRS = "Premium_ZRS" +} + +/** + * Defines values for SkuName. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Premium_LRS**: Premium locally redundant storage \ + * **Premium_ZRS**: Premium zone redundant storage + */ +export type SkuName = string; + +/** Known values of {@link SkuTier} that the service accepts. */ +export enum KnownSkuTier { + /** Premium Tier */ + Premium = "Premium" +} + +/** + * Defines values for SkuTier. \ + * {@link KnownSkuTier} can be used interchangeably with SkuTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Premium**: Premium Tier + */ +export type SkuTier = string; + +/** Known values of {@link ProvisioningStates} that the service accepts. */ +export enum KnownProvisioningStates { + /** Invalid */ + Invalid = "Invalid", + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Pending */ + Pending = "Pending", + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Deleting */ + Deleting = "Deleting" +} + +/** + * Defines values for ProvisioningStates. \ + * {@link KnownProvisioningStates} can be used interchangeably with ProvisioningStates, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Pending** \ + * **Creating** \ + * **Updating** \ + * **Deleting** + */ +export type ProvisioningStates = 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 StorageTargetType} that the service accepts. */ +export enum KnownStorageTargetType { + /** Iscsi */ + Iscsi = "Iscsi", + /** None */ + None = "None" +} + +/** + * Defines values for StorageTargetType. \ + * {@link KnownStorageTargetType} can be used interchangeably with StorageTargetType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Iscsi** \ + * **None** + */ +export type StorageTargetType = string; + +/** Known values of {@link EncryptionType} that the service accepts. */ +export enum KnownEncryptionType { + /** Volume is encrypted at rest with Platform managed key. It is the default encryption type. */ + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey" +} + +/** + * Defines values for EncryptionType. \ + * {@link KnownEncryptionType} can be used interchangeably with EncryptionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EncryptionAtRestWithPlatformKey**: Volume is encrypted at rest with Platform managed key. It is the default encryption type. + */ +export type EncryptionType = string; + +/** Known values of {@link OperationalStatus} that the service accepts. */ +export enum KnownOperationalStatus { + /** Invalid */ + Invalid = "Invalid", + /** Unknown */ + Unknown = "Unknown", + /** Healthy */ + Healthy = "Healthy", + /** Unhealthy */ + Unhealthy = "Unhealthy", + /** Updating */ + Updating = "Updating", + /** Running */ + Running = "Running", + /** Stopped */ + Stopped = "Stopped", + /** StoppedDeallocated */ + StoppedDeallocated = "Stopped (deallocated)" +} + +/** + * Defines values for OperationalStatus. \ + * {@link KnownOperationalStatus} can be used interchangeably with OperationalStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **Unknown** \ + * **Healthy** \ + * **Unhealthy** \ + * **Updating** \ + * **Running** \ + * **Stopped** \ + * **Stopped (deallocated)** + */ +export type OperationalStatus = string; +/** Defines values for State. */ +export type State = + | "provisioning" + | "deprovisioning" + | "succeeded" + | "failed" + | "networkSourceDeleted"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = ElasticSanOperationListResult; + +/** Optional parameters. */ +export interface SkusListOptionalParams extends coreClient.OperationOptions { + /** Specify $filter='location eq ' to filter on location. */ + filter?: string; +} + +/** Contains response data for the list operation. */ +export type SkusListResponse = SkuInformationList; + +/** Optional parameters. */ +export interface ElasticSansListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type ElasticSansListBySubscriptionResponse = ElasticSanList; + +/** Optional parameters. */ +export interface ElasticSansListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ElasticSansListByResourceGroupResponse = ElasticSanList; + +/** Optional parameters. */ +export interface ElasticSansCreateOptionalParams + 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 create operation. */ +export type ElasticSansCreateResponse = ElasticSan; + +/** Optional parameters. */ +export interface ElasticSansUpdateOptionalParams + 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 ElasticSansUpdateResponse = ElasticSan; + +/** Optional parameters. */ +export interface ElasticSansDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface ElasticSansGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ElasticSansGetResponse = ElasticSan; + +/** Optional parameters. */ +export interface ElasticSansListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type ElasticSansListBySubscriptionNextResponse = ElasticSanList; + +/** Optional parameters. */ +export interface ElasticSansListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ElasticSansListByResourceGroupNextResponse = ElasticSanList; + +/** Optional parameters. */ +export interface VolumeGroupsListByElasticSanOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByElasticSan operation. */ +export type VolumeGroupsListByElasticSanResponse = VolumeGroupList; + +/** Optional parameters. */ +export interface VolumeGroupsCreateOptionalParams + 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 create operation. */ +export type VolumeGroupsCreateResponse = VolumeGroup; + +/** Optional parameters. */ +export interface VolumeGroupsUpdateOptionalParams + 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 VolumeGroupsUpdateResponse = VolumeGroup; + +/** Optional parameters. */ +export interface VolumeGroupsDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface VolumeGroupsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VolumeGroupsGetResponse = VolumeGroup; + +/** Optional parameters. */ +export interface VolumeGroupsListByElasticSanNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByElasticSanNext operation. */ +export type VolumeGroupsListByElasticSanNextResponse = VolumeGroupList; + +/** Optional parameters. */ +export interface VolumesCreateOptionalParams + 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 create operation. */ +export type VolumesCreateResponse = Volume; + +/** Optional parameters. */ +export interface VolumesUpdateOptionalParams + 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 VolumesUpdateResponse = Volume; + +/** Optional parameters. */ +export interface VolumesDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface VolumesGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VolumesGetResponse = Volume; + +/** Optional parameters. */ +export interface VolumesListByVolumeGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVolumeGroup operation. */ +export type VolumesListByVolumeGroupResponse = VolumeList; + +/** Optional parameters. */ +export interface VolumesListByVolumeGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByVolumeGroupNext operation. */ +export type VolumesListByVolumeGroupNextResponse = VolumeList; + +/** Optional parameters. */ +export interface ElasticSanManagementOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts b/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts new file mode 100644 index 000000000000..38f580a3bd57 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts @@ -0,0 +1,935 @@ +/* + * 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 ElasticSanOperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSanOperationListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ElasticSanRPOperation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ElasticSanRPOperation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSanRPOperation", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "ElasticSanOperationDisplay" + } + } + } + } +}; + +export const ElasticSanOperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSanOperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + required: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + required: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + required: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorModel: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + 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: "ErrorResponse" + } + } + } + }, + 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 SkuInformationList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuInformationList", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuInformation" + } + } + } + } + } + } +}; + +export const SkuInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuInformation", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + }, + resourceType: { + serializedName: "resourceType", + readOnly: true, + type: { + name: "String" + } + }, + locations: { + serializedName: "locations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + locationInfo: { + serializedName: "locationInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuLocationInfo" + } + } + } + }, + capabilities: { + serializedName: "capabilities", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SKUCapability" + } + } + } + } + } + } +}; + +export const SkuLocationInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuLocationInfo", + modelProperties: { + location: { + serializedName: "location", + readOnly: true, + type: { + name: "String" + } + }, + zones: { + serializedName: "zones", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const SKUCapability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SKUCapability", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ElasticSanList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSanList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ElasticSan" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Sku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + 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 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" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ElasticSanUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSanUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + baseSizeTiB: { + serializedName: "properties.baseSizeTiB", + type: { + name: "Number" + } + }, + extendedCapacitySizeTiB: { + serializedName: "properties.extendedCapacitySizeTiB", + type: { + name: "Number" + } + } + } + } +}; + +export const VolumeGroupList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroupList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VolumeGroup" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const NetworkRuleSet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkRuleSet", + modelProperties: { + virtualNetworkRules: { + serializedName: "virtualNetworkRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualNetworkRule" + } + } + } + } + } + } +}; + +export const VirtualNetworkRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualNetworkRule", + modelProperties: { + virtualNetworkResourceId: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + action: { + defaultValue: "Allow", + isConstant: true, + serializedName: "action", + type: { + name: "String" + } + }, + state: { + serializedName: "state", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "provisioning", + "deprovisioning", + "succeeded", + "failed", + "networkSourceDeleted" + ] + } + } + } + } +}; + +export const VolumeGroupUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroupUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + protocolType: { + serializedName: "properties.protocolType", + type: { + name: "String" + } + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "String" + } + }, + networkAcls: { + serializedName: "properties.networkAcls", + type: { + name: "Composite", + className: "NetworkRuleSet" + } + } + } + } +}; + +export const SourceCreationData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SourceCreationData", + modelProperties: { + createSource: { + defaultValue: "None", + isConstant: true, + serializedName: "createSource", + type: { + name: "String" + } + }, + sourceUri: { + serializedName: "sourceUri", + type: { + name: "String" + } + } + } + } +}; + +export const IscsiTargetInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IscsiTargetInfo", + modelProperties: { + targetIqn: { + serializedName: "targetIqn", + readOnly: true, + type: { + name: "String" + } + }, + targetPortalHostname: { + serializedName: "targetPortalHostname", + readOnly: true, + type: { + name: "String" + } + }, + targetPortalPort: { + serializedName: "targetPortalPort", + readOnly: true, + type: { + name: "Number" + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const VolumeUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + sizeGiB: { + serializedName: "properties.sizeGiB", + type: { + name: "Number" + } + } + } + } +}; + +export const VolumeList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Volume" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VolumeGroup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroup", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + protocolType: { + serializedName: "properties.protocolType", + type: { + name: "String" + } + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "String" + } + }, + networkAcls: { + serializedName: "properties.networkAcls", + type: { + name: "Composite", + className: "NetworkRuleSet" + } + } + } + } +}; + +export const Volume: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Volume", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + volumeId: { + serializedName: "properties.volumeId", + readOnly: true, + type: { + name: "String" + } + }, + creationData: { + serializedName: "properties.creationData", + type: { + name: "Composite", + className: "SourceCreationData" + } + }, + sizeGiB: { + serializedName: "properties.sizeGiB", + type: { + name: "Number" + } + }, + storageTarget: { + serializedName: "properties.storageTarget", + type: { + name: "Composite", + className: "IscsiTargetInfo" + } + } + } + } +}; + +export const ElasticSan: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSan", + modelProperties: { + ...TrackedResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + sku: { + serializedName: "properties.sku", + type: { + name: "Composite", + className: "Sku" + } + }, + availabilityZones: { + serializedName: "properties.availabilityZones", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + baseSizeTiB: { + serializedName: "properties.baseSizeTiB", + required: true, + type: { + name: "Number" + } + }, + extendedCapacitySizeTiB: { + serializedName: "properties.extendedCapacitySizeTiB", + required: true, + type: { + name: "Number" + } + }, + totalVolumeSizeGiB: { + serializedName: "properties.totalVolumeSizeGiB", + readOnly: true, + type: { + name: "Number" + } + }, + volumeGroupCount: { + serializedName: "properties.volumeGroupCount", + readOnly: true, + type: { + name: "Number" + } + }, + totalIops: { + serializedName: "properties.totalIops", + readOnly: true, + type: { + name: "Number" + } + }, + totalMBps: { + serializedName: "properties.totalMBps", + readOnly: true, + type: { + name: "Number" + } + }, + totalSizeTiB: { + serializedName: "properties.totalSizeTiB", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts b/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts new file mode 100644 index 000000000000..ec72b4d23c3a --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts @@ -0,0 +1,199 @@ +/* + * 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 { + ElasticSan as ElasticSanMapper, + ElasticSanUpdate as ElasticSanUpdateMapper, + VolumeGroup as VolumeGroupMapper, + VolumeGroupUpdate as VolumeGroupUpdateMapper, + Volume as VolumeMapper, + VolumeUpdate as VolumeUpdateMapper +} 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 apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-11-20-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\._]*[0-9A-Za-z]$"), + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: ElasticSanMapper +}; + +export const elasticSanName: OperationURLParameter = { + parameterPath: "elasticSanName", + mapper: { + constraints: { + Pattern: new RegExp("^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$"), + MaxLength: 24, + MinLength: 3 + }, + serializedName: "elasticSanName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: ElasticSanUpdateMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: VolumeGroupMapper +}; + +export const volumeGroupName: OperationURLParameter = { + parameterPath: "volumeGroupName", + mapper: { + constraints: { + Pattern: new RegExp("^[A-Za-z0-9]+((-|_)[a-z0-9A-Z]+)*$"), + MaxLength: 63, + MinLength: 3 + }, + serializedName: "volumeGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: VolumeGroupUpdateMapper +}; + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: VolumeMapper +}; + +export const volumeName: OperationURLParameter = { + parameterPath: "volumeName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-z0-9]+(-[a-z0-9A-Z]+)*$"), + MaxLength: 63, + MinLength: 3 + }, + serializedName: "volumeName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: VolumeUpdateMapper +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts b/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts new file mode 100644 index 000000000000..2ff2b1b2fa44 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts @@ -0,0 +1,683 @@ +/* + * 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 { ElasticSans } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ElasticSanManagement } from "../elasticSanManagement"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ElasticSan, + ElasticSansListBySubscriptionNextOptionalParams, + ElasticSansListBySubscriptionOptionalParams, + ElasticSansListByResourceGroupNextOptionalParams, + ElasticSansListByResourceGroupOptionalParams, + ElasticSansListBySubscriptionResponse, + ElasticSansListByResourceGroupResponse, + ElasticSansCreateOptionalParams, + ElasticSansCreateResponse, + ElasticSanUpdate, + ElasticSansUpdateOptionalParams, + ElasticSansUpdateResponse, + ElasticSansDeleteOptionalParams, + ElasticSansGetOptionalParams, + ElasticSansGetResponse, + ElasticSansListBySubscriptionNextResponse, + ElasticSansListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing ElasticSans operations. */ +export class ElasticSansImpl implements ElasticSans { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class ElasticSans class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * Gets a list of ElasticSans in a subscription + * @param options The options parameters. + */ + public listBySubscription( + options?: ElasticSansListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: ElasticSansListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: ElasticSansListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Gets a list of ElasticSan 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?: ElasticSansListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ElasticSansListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ElasticSansListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Gets a list of ElasticSans in a subscription + * @param options The options parameters. + */ + private _listBySubscription( + options?: ElasticSansListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Gets a list of ElasticSan 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?: ElasticSansListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Create ElasticSan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ElasticSansCreateResponse + > + > { + 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, elasticSanName, parameters, options }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create ElasticSan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + elasticSanName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Update a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ElasticSansUpdateResponse + > + > { + 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, elasticSanName, parameters, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Update a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + elasticSanName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Delete a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams + ): Promise, void>> { + 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, elasticSanName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Delete a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + elasticSanName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Get a ElasticSan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, options }, + getOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: ElasticSansListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * 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?: ElasticSansListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticSanList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticSanList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ElasticSan + }, + 201: { + bodyMapper: Mappers.ElasticSan + }, + 202: { + bodyMapper: Mappers.ElasticSan + }, + 204: { + bodyMapper: Mappers.ElasticSan + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ElasticSan + }, + 201: { + bodyMapper: Mappers.ElasticSan + }, + 202: { + bodyMapper: Mappers.ElasticSan + }, + 204: { + bodyMapper: Mappers.ElasticSan + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticSan + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticSanList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticSanList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/index.ts b/sdk/elasticsans/arm-elasticsan/src/operations/index.ts new file mode 100644 index 000000000000..75c3aa932129 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/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 * from "./operations"; +export * from "./skus"; +export * from "./elasticSans"; +export * from "./volumeGroups"; +export * from "./volumes"; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts b/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts new file mode 100644 index 000000000000..3f63b826cc0f --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts @@ -0,0 +1,98 @@ +/* + * 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 { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ElasticSanManagement } from "../elasticSanManagement"; +import { + ElasticSanRPOperation, + OperationsListOptionalParams, + OperationsListResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * Gets a list of ElasticSan operations. + * @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: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Gets a list of ElasticSan operations. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ElasticSan/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ElasticSanOperationListResult + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts b/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts new file mode 100644 index 000000000000..a202cb046733 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts @@ -0,0 +1,96 @@ +/* + * 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 { Skus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ElasticSanManagement } from "../elasticSanManagement"; +import { + SkuInformation, + SkusListOptionalParams, + SkusListResponse +} from "../models"; + +/// +/** Class containing Skus operations. */ +export class SkusImpl implements Skus { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class Skus class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * List all the available Skus in the region and information related to them + * @param options The options parameters. + */ + public list( + options?: SkusListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: SkusListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + } + + private async *listPagingAll( + options?: SkusListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List all the available Skus in the region and information related to them + * @param options The options parameters. + */ + private _list(options?: SkusListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SkuInformationList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts new file mode 100644 index 000000000000..1834f5653e00 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts @@ -0,0 +1,629 @@ +/* + * 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 { VolumeGroups } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ElasticSanManagement } from "../elasticSanManagement"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + VolumeGroup, + VolumeGroupsListByElasticSanNextOptionalParams, + VolumeGroupsListByElasticSanOptionalParams, + VolumeGroupsListByElasticSanResponse, + VolumeGroupsCreateOptionalParams, + VolumeGroupsCreateResponse, + VolumeGroupUpdate, + VolumeGroupsUpdateOptionalParams, + VolumeGroupsUpdateResponse, + VolumeGroupsDeleteOptionalParams, + VolumeGroupsGetOptionalParams, + VolumeGroupsGetResponse, + VolumeGroupsListByElasticSanNextResponse +} from "../models"; + +/// +/** Class containing VolumeGroups operations. */ +export class VolumeGroupsImpl implements VolumeGroups { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class VolumeGroups class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * List VolumeGroups. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + public listByElasticSan( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByElasticSanPagingAll( + resourceGroupName, + elasticSanName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByElasticSanPagingPage( + resourceGroupName, + elasticSanName, + options + ); + } + }; + } + + private async *listByElasticSanPagingPage( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams + ): AsyncIterableIterator { + let result = await this._listByElasticSan( + resourceGroupName, + elasticSanName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByElasticSanNext( + resourceGroupName, + elasticSanName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByElasticSanPagingAll( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByElasticSanPagingPage( + resourceGroupName, + elasticSanName, + options + )) { + yield* page; + } + } + + /** + * List VolumeGroups. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + private _listByElasticSan( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, options }, + listByElasticSanOperationSpec + ); + } + + /** + * Create a Volume Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VolumeGroupsCreateResponse + > + > { + 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, + elasticSanName, + volumeGroupName, + parameters, + options + }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create a Volume Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Update an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VolumeGroupsUpdateResponse + > + > { + 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, + elasticSanName, + volumeGroupName, + parameters, + options + }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Update an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + elasticSanName, + volumeGroupName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Delete an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams + ): Promise, void>> { + 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, elasticSanName, volumeGroupName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Delete an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + elasticSanName, + volumeGroupName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Get an VolumeGroups. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, volumeGroupName, options }, + getOperationSpec + ); + } + + /** + * ListByElasticSanNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param nextLink The nextLink from the previous successful call to the ListByElasticSan method. + * @param options The options parameters. + */ + private _listByElasticSanNext( + resourceGroupName: string, + elasticSanName: string, + nextLink: string, + options?: VolumeGroupsListByElasticSanNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, nextLink, options }, + listByElasticSanNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByElasticSanOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumeGroups", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeGroupList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.VolumeGroup + }, + 201: { + bodyMapper: Mappers.VolumeGroup + }, + 202: { + bodyMapper: Mappers.VolumeGroup + }, + 204: { + bodyMapper: Mappers.VolumeGroup + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.VolumeGroup + }, + 201: { + bodyMapper: Mappers.VolumeGroup + }, + 202: { + bodyMapper: Mappers.VolumeGroup + }, + 204: { + bodyMapper: Mappers.VolumeGroup + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeGroup + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByElasticSanNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeGroupList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts new file mode 100644 index 000000000000..b78167445c26 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts @@ -0,0 +1,673 @@ +/* + * 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 { Volumes } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ElasticSanManagement } from "../elasticSanManagement"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Volume, + VolumesListByVolumeGroupNextOptionalParams, + VolumesListByVolumeGroupOptionalParams, + VolumesCreateOptionalParams, + VolumesCreateResponse, + VolumeUpdate, + VolumesUpdateOptionalParams, + VolumesUpdateResponse, + VolumesDeleteOptionalParams, + VolumesGetOptionalParams, + VolumesGetResponse, + VolumesListByVolumeGroupResponse, + VolumesListByVolumeGroupNextResponse +} from "../models"; + +/// +/** Class containing Volumes operations. */ +export class VolumesImpl implements Volumes { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class Volumes class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * List Volumes in a VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + public listByVolumeGroup( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByVolumeGroupPagingAll( + resourceGroupName, + elasticSanName, + volumeGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByVolumeGroupPagingPage( + resourceGroupName, + elasticSanName, + volumeGroupName, + options + ); + } + }; + } + + private async *listByVolumeGroupPagingPage( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByVolumeGroup( + resourceGroupName, + elasticSanName, + volumeGroupName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByVolumeGroupNext( + resourceGroupName, + elasticSanName, + volumeGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByVolumeGroupPagingAll( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByVolumeGroupPagingPage( + resourceGroupName, + elasticSanName, + volumeGroupName, + options + )) { + yield* page; + } + } + + /** + * Create a Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams + ): Promise< + PollerLike, VolumesCreateResponse> + > { + 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, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options + }, + createOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create a Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Update an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams + ): Promise< + PollerLike, VolumesUpdateResponse> + > { + 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, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options + }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Update an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Delete an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams + ): Promise, void>> { + 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, + elasticSanName, + volumeGroupName, + volumeName, + options + }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Delete an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Get an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + options + }, + getOperationSpec + ); + } + + /** + * List Volumes in a VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + private _listByVolumeGroup( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, volumeGroupName, options }, + listByVolumeGroupOperationSpec + ); + } + + /** + * ListByVolumeGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param nextLink The nextLink from the previous successful call to the ListByVolumeGroup method. + * @param options The options parameters. + */ + private _listByVolumeGroupNext( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + nextLink: string, + options?: VolumesListByVolumeGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, volumeGroupName, nextLink, options }, + listByVolumeGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Volume + }, + 201: { + bodyMapper: Mappers.Volume + }, + 202: { + bodyMapper: Mappers.Volume + }, + 204: { + bodyMapper: Mappers.Volume + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Volume + }, + 201: { + bodyMapper: Mappers.Volume + }, + 202: { + bodyMapper: Mappers.Volume + }, + 204: { + bodyMapper: Mappers.Volume + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Volume + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName, + Parameters.volumeName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByVolumeGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.volumeGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByVolumeGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.VolumeList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.nextLink, + Parameters.volumeGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts new file mode 100644 index 000000000000..c4ffc1b81409 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts @@ -0,0 +1,139 @@ +/* + * 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 { + ElasticSan, + ElasticSansListBySubscriptionOptionalParams, + ElasticSansListByResourceGroupOptionalParams, + ElasticSansCreateOptionalParams, + ElasticSansCreateResponse, + ElasticSanUpdate, + ElasticSansUpdateOptionalParams, + ElasticSansUpdateResponse, + ElasticSansDeleteOptionalParams, + ElasticSansGetOptionalParams, + ElasticSansGetResponse +} from "../models"; + +/// +/** Interface representing a ElasticSans. */ +export interface ElasticSans { + /** + * Gets a list of ElasticSans in a subscription + * @param options The options parameters. + */ + listBySubscription( + options?: ElasticSansListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a list of ElasticSan 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?: ElasticSansListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create ElasticSan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ElasticSansCreateResponse + > + >; + /** + * Create ElasticSan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSan, + options?: ElasticSansCreateOptionalParams + ): Promise; + /** + * Update a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ElasticSansUpdateResponse + > + >; + /** + * Update a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + elasticSanName: string, + parameters: ElasticSanUpdate, + options?: ElasticSansUpdateOptionalParams + ): Promise; + /** + * Delete a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansDeleteOptionalParams + ): Promise; + /** + * Get a ElasticSan. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + options?: ElasticSansGetOptionalParams + ): Promise; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..75c3aa932129 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/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 * from "./operations"; +export * from "./skus"; +export * from "./elasticSans"; +export * from "./volumeGroups"; +export * from "./volumes"; diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..d6267d7bf74d --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/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 { ElasticSanRPOperation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Gets a list of ElasticSan operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.ts new file mode 100644 index 000000000000..3c02561b9778 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/skus.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 { SkuInformation, SkusListOptionalParams } from "../models"; + +/// +/** Interface representing a Skus. */ +export interface Skus { + /** + * List all the available Skus in the region and information related to them + * @param options The options parameters. + */ + list( + options?: SkusListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts new file mode 100644 index 000000000000..c8430eee2609 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts @@ -0,0 +1,147 @@ +/* + * 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 { + VolumeGroup, + VolumeGroupsListByElasticSanOptionalParams, + VolumeGroupsCreateOptionalParams, + VolumeGroupsCreateResponse, + VolumeGroupUpdate, + VolumeGroupsUpdateOptionalParams, + VolumeGroupsUpdateResponse, + VolumeGroupsDeleteOptionalParams, + VolumeGroupsGetOptionalParams, + VolumeGroupsGetResponse +} from "../models"; + +/// +/** Interface representing a VolumeGroups. */ +export interface VolumeGroups { + /** + * List VolumeGroups. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + listByElasticSan( + resourceGroupName: string, + elasticSanName: string, + options?: VolumeGroupsListByElasticSanOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create a Volume Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VolumeGroupsCreateResponse + > + >; + /** + * Create a Volume Group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroup, + options?: VolumeGroupsCreateOptionalParams + ): Promise; + /** + * Update an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + VolumeGroupsUpdateResponse + > + >; + /** + * Update an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + parameters: VolumeGroupUpdate, + options?: VolumeGroupsUpdateOptionalParams + ): Promise; + /** + * Delete an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams + ): Promise, void>>; + /** + * Delete an VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsDeleteOptionalParams + ): Promise; + /** + * Get an VolumeGroups. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumeGroupsGetOptionalParams + ): Promise; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts new file mode 100644 index 000000000000..a6bd659e778d --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts @@ -0,0 +1,157 @@ +/* + * 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 { + Volume, + VolumesListByVolumeGroupOptionalParams, + VolumesCreateOptionalParams, + VolumesCreateResponse, + VolumeUpdate, + VolumesUpdateOptionalParams, + VolumesUpdateResponse, + VolumesDeleteOptionalParams, + VolumesGetOptionalParams, + VolumesGetResponse +} from "../models"; + +/// +/** Interface representing a Volumes. */ +export interface Volumes { + /** + * List Volumes in a VolumeGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param options The options parameters. + */ + listByVolumeGroup( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + options?: VolumesListByVolumeGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create a Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams + ): Promise< + PollerLike, VolumesCreateResponse> + >; + /** + * Create a Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: Volume, + options?: VolumesCreateOptionalParams + ): Promise; + /** + * Update an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams + ): Promise< + PollerLike, VolumesUpdateResponse> + >; + /** + * Update an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + parameters: VolumeUpdate, + options?: VolumesUpdateOptionalParams + ): Promise; + /** + * Delete an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams + ): Promise, void>>; + /** + * Delete an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesDeleteOptionalParams + ): Promise; + /** + * Get an Volume. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + volumeGroupName: string, + volumeName: string, + options?: VolumesGetOptionalParams + ): Promise; +} diff --git a/sdk/elasticsans/arm-elasticsan/test/sampleTest.ts b/sdk/elasticsans/arm-elasticsan/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/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/elasticsans/arm-elasticsan/tsconfig.json b/sdk/elasticsans/arm-elasticsan/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/tsconfig.json @@ -0,0 +1,27 @@ +{ + "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 + }, + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/elasticsans/ci.mgmt.yml b/sdk/elasticsans/ci.mgmt.yml new file mode 100644 index 000000000000..eddc36f8ea96 --- /dev/null +++ b/sdk/elasticsans/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/elasticsans/arm-elasticsan + - sdk/elasticsans/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/elasticsans/arm-elasticsan + - sdk/elasticsans/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: elasticsans + Artifacts: + - name: azure-arm-elasticsan + safeName: azurearmelasticsan + \ No newline at end of file