diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 9e1d6b32806e..3cb1586ab5f9 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -112,6 +112,7 @@ specifiers: '@rush-temp/arm-kubernetesconfiguration': file:./projects/arm-kubernetesconfiguration.tgz '@rush-temp/arm-kusto': file:./projects/arm-kusto.tgz '@rush-temp/arm-labservices': file:./projects/arm-labservices.tgz + '@rush-temp/arm-liftrqumulo': file:./projects/arm-liftrqumulo.tgz '@rush-temp/arm-links': file:./projects/arm-links.tgz '@rush-temp/arm-loadtesting': file:./projects/arm-loadtesting.tgz '@rush-temp/arm-locks': file:./projects/arm-locks.tgz @@ -437,6 +438,7 @@ dependencies: '@rush-temp/arm-kubernetesconfiguration': file:projects/arm-kubernetesconfiguration.tgz '@rush-temp/arm-kusto': file:projects/arm-kusto.tgz '@rush-temp/arm-labservices': file:projects/arm-labservices.tgz + '@rush-temp/arm-liftrqumulo': file:projects/arm-liftrqumulo.tgz '@rush-temp/arm-links': file:projects/arm-links.tgz '@rush-temp/arm-loadtesting': file:projects/arm-loadtesting.tgz '@rush-temp/arm-locks': file:projects/arm-locks.tgz @@ -1967,7 +1969,7 @@ packages: rollup: 2.79.1 dev: false - /@rollup/plugin-typescript/10.0.1_bgwi2fgwyi362qsw25gfipc3ca: + /@rollup/plugin-typescript/10.0.1_bhcmvni67fkldpaxrtldxbogce: resolution: {integrity: sha512-wBykxRLlX7EzL8BmUqMqk5zpx2onnmRMSw/l9M1sVfkJvdwfxogZQVNUM9gVMJbjRLDR5H6U0OMOrlDGmIV45A==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1984,7 +1986,7 @@ packages: resolve: 1.22.1 rollup: 2.79.1 tslib: 2.5.0 - typescript: 4.9.4 + typescript: 4.9.5 dev: false /@rollup/plugin-virtual/2.1.0_rollup@2.79.1: @@ -3807,7 +3809,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20230130 + typescript: 5.0.0-dev.20230131 dev: false /downlevel-dts/0.7.0: @@ -3816,7 +3818,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 4.9.4 + typescript: 4.9.5 dev: false /downlevel-dts/0.8.0: @@ -3825,7 +3827,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 4.9.4 + typescript: 4.9.5 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8311,7 +8313,7 @@ packages: hasBin: true dev: false - /ts-node/10.9.1_gjo33tkf7m2dtuw6tmxt3xwf4q: + /ts-node/10.9.1_7iyetdgfmqiorh7qupktbe7tm4: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -8337,12 +8339,12 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.8.4 + typescript: 4.9.5 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: false - /ts-node/10.9.1_hrxs3cimgx563ee773t2eh6j4y: + /ts-node/10.9.1_gjo33tkf7m2dtuw6tmxt3xwf4q: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -8368,12 +8370,12 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.2.4 + typescript: 4.8.4 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: false - /ts-node/10.9.1_laqv367ntbladgchwutjrnj4ky: + /ts-node/10.9.1_hrxs3cimgx563ee773t2eh6j4y: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -8392,19 +8394,19 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 - '@types/node': 17.0.45 + '@types/node': 14.18.36 acorn: 8.8.2 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.6.4 + typescript: 4.2.4 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: false - /ts-node/10.9.1_ocil65wecyuhsmrrocoajouipe: + /ts-node/10.9.1_laqv367ntbladgchwutjrnj4ky: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -8423,14 +8425,14 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 - '@types/node': 14.18.36 + '@types/node': 17.0.45 acorn: 8.8.2 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.9.4 + typescript: 4.6.4 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: false @@ -8647,14 +8649,14 @@ packages: hasBin: true dev: false - /typescript/4.9.4: - resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} + /typescript/4.9.5: + resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} hasBin: true dev: false - /typescript/5.0.0-dev.20230130: - resolution: {integrity: sha512-4zmbh58Vt3HDAD0AvHr1ccmAkKKODriYMNajcSzUylVgXCXrNGTJOReMp54GBs67KfQFaLOpVZlLrlD2FKn9Kg==} + /typescript/5.0.0-dev.20230131: + resolution: {integrity: sha512-A1VAxSLhrW5D7zq7nLkE36JAfDL72gJrN8p5Y6zvvndkOGtfgJp3//M0iqCRfLe0l8noJb8cRI+kdpgSuC1giw==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -12542,6 +12544,33 @@ packages: - supports-color dev: false + file:projects/arm-liftrqumulo.tgz: + resolution: {integrity: sha512-HJvkShQpMrB5NP/zqe3H7ruL0o/WMPuDIVkA4qkCMGMiH5e5m8f+KlTsQ+sVSDk5o7ExOetcVuycaLDw6FgHUA==, tarball: file:projects/arm-liftrqumulo.tgz} + name: '@rush-temp/arm-liftrqumulo' + version: 0.0.0 + dependencies: + '@azure/identity': 2.1.0 + '@microsoft/api-extractor': 7.34.0 + '@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.4 + '@types/node': 14.18.36 + chai: 4.3.7 + 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_p2gydaekoyjvl5wd3ixslt7iq4 + tslib: 2.5.0 + typescript: 4.8.4 + uglify-js: 3.17.4 + transitivePeerDependencies: + - supports-color + dev: false + file:projects/arm-links.tgz: resolution: {integrity: sha512-JV+thrIXDv0aY2koGSPbjA+V6SsS44i+n2wG1Id7aPi5Y89HSYBrAcmuNy8PSpjzyz6BfIPU/B+I7rMquHP5eQ==, tarball: file:projects/arm-links.tgz} name: '@rush-temp/arm-links' @@ -16460,7 +16489,7 @@ packages: name: '@rush-temp/dev-tool' version: 0.0.0 dependencies: - '@_ts/max': /typescript/4.9.4 + '@_ts/max': /typescript/4.9.5 '@_ts/min': /typescript/4.2.4 '@microsoft/api-extractor': 7.34.0 '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 @@ -17890,7 +17919,7 @@ packages: version: 0.0.0 dependencies: '@microsoft/api-extractor': 7.34.0 - '@rollup/plugin-typescript': 10.0.1_bgwi2fgwyi362qsw25gfipc3ca + '@rollup/plugin-typescript': 10.0.1_bhcmvni67fkldpaxrtldxbogce '@types/chai': 4.3.4 '@types/mocha': 7.0.2 '@types/node': 14.18.36 @@ -17922,9 +17951,9 @@ packages: rollup: 2.79.1 rollup-plugin-shim: 1.0.0 rollup-plugin-sourcemaps: 0.6.3_p2gydaekoyjvl5wd3ixslt7iq4 - ts-node: 10.9.1_ocil65wecyuhsmrrocoajouipe + ts-node: 10.9.1_7iyetdgfmqiorh7qupktbe7tm4 tslib: 2.5.0 - typescript: 4.9.4 + typescript: 4.9.5 util: 0.12.5 uuid: 9.0.0 transitivePeerDependencies: diff --git a/rush.json b/rush.json index fcad1dcc9519..e9ca1d6049a1 100644 --- a/rush.json +++ b/rush.json @@ -1933,6 +1933,11 @@ "packageName": "@azure/arm-servicenetworking", "projectFolder": "sdk/servicenetworking/arm-servicenetworking", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-liftrqumulo", + "projectFolder": "sdk/liftrqumulo/arm-liftrqumulo", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/liftrqumulo/arm-liftrqumulo/CHANGELOG.md b/sdk/liftrqumulo/arm-liftrqumulo/CHANGELOG.md new file mode 100644 index 000000000000..87e1895225ba --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-01-31) + +The package of @azure/arm-liftrqumulo 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/liftrqumulo/arm-liftrqumulo/LICENSE b/sdk/liftrqumulo/arm-liftrqumulo/LICENSE new file mode 100644 index 000000000000..3a1d9b6f24f7 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2023 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/liftrqumulo/arm-liftrqumulo/README.md b/sdk/liftrqumulo/arm-liftrqumulo/README.md new file mode 100644 index 000000000000..3652f4e6b91f --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/README.md @@ -0,0 +1,109 @@ +# Azure QumuloStorage client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure QumuloStorage client. + + + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-liftrqumulo) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-liftrqumulo) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-liftrqumulo?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-liftrqumulo` package + +Install the Azure QumuloStorage client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-liftrqumulo +``` + +### Create and authenticate a `QumuloStorage` + +To create a client object to access the Azure QumuloStorage API, you will need the `endpoint` of your Azure QumuloStorage resource and a `credential`. The Azure QumuloStorage client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure QumuloStorage 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 QumuloStorage** 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 { QumuloStorage } = require("@azure/arm-liftrqumulo"); +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 QumuloStorage(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new QumuloStorage(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 + +### QumuloStorage + +`QumuloStorage` is the primary interface for developers using the Azure QumuloStorage client library. Explore the methods on this client object to understand the different features of the Azure QumuloStorage 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%2Fliftrqumulo%2Farm-liftrqumulo%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/liftrqumulo/arm-liftrqumulo/_meta.json b/sdk/liftrqumulo/arm-liftrqumulo/_meta.json new file mode 100644 index 000000000000..79a44a255f68 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f", + "readme": "specification/liftrqumulo/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --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/liftrqumulo/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.5", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.6.1", + "use": "@autorest/typescript@6.0.0-rc.5" +} \ No newline at end of file diff --git a/sdk/liftrqumulo/arm-liftrqumulo/api-extractor.json b/sdk/liftrqumulo/arm-liftrqumulo/api-extractor.json new file mode 100644 index 000000000000..cf540a6b0a77 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/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-liftrqumulo.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/liftrqumulo/arm-liftrqumulo/package.json b/sdk/liftrqumulo/arm-liftrqumulo/package.json new file mode 100644 index 000000000000..8f477607bbda --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/package.json @@ -0,0 +1,114 @@ +{ + "name": "@azure/arm-liftrqumulo", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for QumuloStorage.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=14.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.6.1", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.8.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-liftrqumulo.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.8.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", + "mocha": "^7.1.1", + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@types/node": "^14.0.0", + "@azure/dev-tool": "^1.0.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-liftrqumulo", + "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/qumuloStorage.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/liftrqumulo/arm-liftrqumulo/review/arm-liftrqumulo.api.md b/sdk/liftrqumulo/arm-liftrqumulo/review/arm-liftrqumulo.api.md new file mode 100644 index 000000000000..a757e9ae537e --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/review/arm-liftrqumulo.api.md @@ -0,0 +1,315 @@ +## API Report File for "@azure/arm-liftrqumulo" + +> 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 ActionType = string; + +// @public +export type CreatedByType = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface FileSystemResource extends TrackedResource { + adminPassword: string; + availabilityZone?: string; + clusterLoginUrl?: string; + delegatedSubnetId: string; + identity?: ManagedServiceIdentity; + initialCapacity: number; + marketplaceDetails: MarketplaceDetails; + privateIPs?: string[]; + readonly provisioningState?: ProvisioningState; + storageSku: StorageSku; + userDetails: UserDetails; +} + +// @public +export interface FileSystemResourceListResult { + nextLink?: string; + value: FileSystemResource[]; +} + +// @public +export interface FileSystemResourceUpdate { + identity?: ManagedServiceIdentity; + properties?: FileSystemResourceUpdateProperties; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface FileSystemResourceUpdateProperties { + clusterLoginUrl?: string; + delegatedSubnetId?: string; + marketplaceDetails?: MarketplaceDetails; + privateIPs?: string[]; + userDetails?: UserDetails; +} + +// @public +export interface FileSystems { + beginCreateOrUpdate(resourceGroupName: string, fileSystemName: string, resource: FileSystemResource, options?: FileSystemsCreateOrUpdateOptionalParams): Promise, FileSystemsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, fileSystemName: string, resource: FileSystemResource, options?: FileSystemsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, fileSystemName: string, options?: FileSystemsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, fileSystemName: string, options?: FileSystemsDeleteOptionalParams): Promise; + get(resourceGroupName: string, fileSystemName: string, options?: FileSystemsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: FileSystemsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: FileSystemsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, fileSystemName: string, properties: FileSystemResourceUpdate, options?: FileSystemsUpdateOptionalParams): Promise; +} + +// @public +export interface FileSystemsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FileSystemsCreateOrUpdateResponse = FileSystemResource; + +// @public +export interface FileSystemsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface FileSystemsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileSystemsGetResponse = FileSystemResource; + +// @public +export interface FileSystemsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileSystemsListByResourceGroupNextResponse = FileSystemResourceListResult; + +// @public +export interface FileSystemsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileSystemsListByResourceGroupResponse = FileSystemResourceListResult; + +// @public +export interface FileSystemsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileSystemsListBySubscriptionNextResponse = FileSystemResourceListResult; + +// @public +export interface FileSystemsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileSystemsListBySubscriptionResponse = FileSystemResourceListResult; + +// @public +export interface FileSystemsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FileSystemsUpdateResponse = FileSystemResource; + +// @public +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity; + }; +} + +// @public +export type ManagedServiceIdentityType = string; + +// @public +export interface MarketplaceDetails { + marketplaceSubscriptionId?: string; + readonly marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; + offerId: string; + planId: string; + publisherId: string; +} + +// @public +export type MarketplaceSubscriptionStatus = "PendingFulfillmentStart" | "Subscribed" | "Suspended" | "Unsubscribed"; + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; + +// @public +export type ProvisioningState = "Accepted" | "Creating" | "Updating" | "Deleting" | "Succeeded" | "Failed" | "Canceled" | "Deleted" | "NotSpecified"; + +// @public (undocumented) +export class QumuloStorage extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: QumuloStorageOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + fileSystems: FileSystems; + // (undocumented) + operations: Operations; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface QumuloStorageOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export type StorageSku = "Standard" | "Performance"; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export interface UserDetails { + email: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/liftrqumulo/arm-liftrqumulo/rollup.config.js b/sdk/liftrqumulo/arm-liftrqumulo/rollup.config.js new file mode 100644 index 000000000000..3f89d7309da5 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/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/liftrqumulo/arm-liftrqumulo/sample.env b/sdk/liftrqumulo/arm-liftrqumulo/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/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/liftrqumulo/arm-liftrqumulo/src/index.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/index.ts new file mode 100644 index 000000000000..620407ccea2f --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/src/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export { getContinuationToken } from "./pagingHelper"; +export * from "./models"; +export { QumuloStorage } from "./qumuloStorage"; +export * from "./operationsInterfaces"; diff --git a/sdk/liftrqumulo/arm-liftrqumulo/src/lroImpl.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/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/liftrqumulo/arm-liftrqumulo/src/models/index.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/models/index.ts new file mode 100644 index 000000000000..f91db4ecbdd2 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/src/models/index.ts @@ -0,0 +1,477 @@ +/* + * 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"; + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** The response of a FileSystemResource list operation. */ +export interface FileSystemResourceListResult { + /** The FileSystemResource items on this page */ + value: FileSystemResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** MarketplaceDetails of Qumulo FileSystem resource */ +export interface MarketplaceDetails { + /** Marketplace Subscription Id */ + marketplaceSubscriptionId?: string; + /** Plan Id */ + planId: string; + /** Offer Id */ + offerId: string; + /** Publisher Id */ + publisherId: string; + /** + * Marketplace subscription status + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; +} + +/** User Details of Qumulo FileSystem resource */ +export interface UserDetails { + /** User Email */ + email: string; +} + +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ + type: ManagedServiceIdentityType; + /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** + * The principal ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** 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 type used for update operations of the FileSystemResource. */ +export interface FileSystemResourceUpdate { + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The updatable properties of the FileSystemResource. */ + properties?: FileSystemResourceUpdateProperties; +} + +/** The updatable properties of the FileSystemResource. */ +export interface FileSystemResourceUpdateProperties { + /** Marketplace details */ + marketplaceDetails?: MarketplaceDetails; + /** User Details */ + userDetails?: UserDetails; + /** Delegated subnet id for Vnet injection */ + delegatedSubnetId?: string; + /** File system Id of the resource */ + clusterLoginUrl?: string; + /** Private IPs of the resource */ + privateIPs?: string[]; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + +/** A FileSystem Resource by Qumulo */ +export interface FileSystemResource extends TrackedResource { + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; + /** Marketplace details */ + marketplaceDetails: MarketplaceDetails; + /** + * Provisioning State of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Storage Sku */ + storageSku: StorageSku; + /** User Details */ + userDetails: UserDetails; + /** Delegated subnet id for Vnet injection */ + delegatedSubnetId: string; + /** File system Id of the resource */ + clusterLoginUrl?: string; + /** Private IPs of the resource */ + privateIPs?: string[]; + /** Initial administrator password of the resource */ + adminPassword: string; + /** Storage capacity in TB */ + initialCapacity: number; + /** Availability zone */ + availabilityZone?: string; +} + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system" +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal" +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", + /** SystemAssignedUserAssigned */ + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned" +} + +/** + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned, UserAssigned** + */ +export type ManagedServiceIdentityType = 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; +/** Defines values for MarketplaceSubscriptionStatus. */ +export type MarketplaceSubscriptionStatus = + | "PendingFulfillmentStart" + | "Subscribed" + | "Suspended" + | "Unsubscribed"; +/** Defines values for ProvisioningState. */ +export type ProvisioningState = + | "Accepted" + | "Creating" + | "Updating" + | "Deleting" + | "Succeeded" + | "Failed" + | "Canceled" + | "Deleted" + | "NotSpecified"; +/** Defines values for StorageSku. */ +export type StorageSku = "Standard" | "Performance"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface FileSystemsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type FileSystemsListBySubscriptionResponse = FileSystemResourceListResult; + +/** Optional parameters. */ +export interface FileSystemsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type FileSystemsListByResourceGroupResponse = FileSystemResourceListResult; + +/** Optional parameters. */ +export interface FileSystemsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FileSystemsGetResponse = FileSystemResource; + +/** Optional parameters. */ +export interface FileSystemsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type FileSystemsCreateOrUpdateResponse = FileSystemResource; + +/** Optional parameters. */ +export interface FileSystemsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type FileSystemsUpdateResponse = FileSystemResource; + +/** Optional parameters. */ +export interface FileSystemsDeleteOptionalParams + 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 FileSystemsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type FileSystemsListBySubscriptionNextResponse = FileSystemResourceListResult; + +/** Optional parameters. */ +export interface FileSystemsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type FileSystemsListByResourceGroupNextResponse = FileSystemResourceListResult; + +/** Optional parameters. */ +export interface QumuloStorageOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/liftrqumulo/arm-liftrqumulo/src/models/mappers.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/models/mappers.ts new file mode 100644 index 000000000000..cc3cd9ecb642 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/src/models/mappers.ts @@ -0,0 +1,653 @@ +/* + * 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 OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const FileSystemResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileSystemResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FileSystemResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const MarketplaceDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MarketplaceDetails", + modelProperties: { + marketplaceSubscriptionId: { + serializedName: "marketplaceSubscriptionId", + type: { + name: "String" + } + }, + planId: { + serializedName: "planId", + required: true, + type: { + name: "String" + } + }, + offerId: { + serializedName: "offerId", + required: true, + type: { + name: "String" + } + }, + publisherId: { + serializedName: "publisherId", + required: true, + type: { + name: "String" + } + }, + marketplaceSubscriptionStatus: { + serializedName: "marketplaceSubscriptionStatus", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "PendingFulfillmentStart", + "Subscribed", + "Suspended", + "Unsubscribed" + ] + } + } + } + } +}; + +export const UserDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserDetails", + modelProperties: { + email: { + serializedName: "email", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ManagedServiceIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedServiceIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "Uuid" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } + } + } + } + } +}; + +export const UserAssignedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "Uuid" + } + } + } + } +}; + +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" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +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 FileSystemResourceUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileSystemResourceUpdate", + modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "FileSystemResourceUpdateProperties" + } + } + } + } +}; + +export const FileSystemResourceUpdateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileSystemResourceUpdateProperties", + modelProperties: { + marketplaceDetails: { + serializedName: "marketplaceDetails", + type: { + name: "Composite", + className: "MarketplaceDetails" + } + }, + userDetails: { + serializedName: "userDetails", + type: { + name: "Composite", + className: "UserDetails" + } + }, + delegatedSubnetId: { + serializedName: "delegatedSubnetId", + type: { + name: "String" + } + }, + clusterLoginUrl: { + serializedName: "clusterLoginUrl", + type: { + name: "String" + } + }, + privateIPs: { + serializedName: "privateIPs", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const FileSystemResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FileSystemResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, + marketplaceDetails: { + serializedName: "properties.marketplaceDetails", + type: { + name: "Composite", + className: "MarketplaceDetails" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "Accepted", + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Canceled", + "Deleted", + "NotSpecified" + ] + } + }, + storageSku: { + serializedName: "properties.storageSku", + required: true, + type: { + name: "Enum", + allowedValues: ["Standard", "Performance"] + } + }, + userDetails: { + serializedName: "properties.userDetails", + type: { + name: "Composite", + className: "UserDetails" + } + }, + delegatedSubnetId: { + serializedName: "properties.delegatedSubnetId", + required: true, + type: { + name: "String" + } + }, + clusterLoginUrl: { + serializedName: "properties.clusterLoginUrl", + type: { + name: "String" + } + }, + privateIPs: { + serializedName: "properties.privateIPs", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + adminPassword: { + serializedName: "properties.adminPassword", + required: true, + type: { + name: "String" + } + }, + initialCapacity: { + serializedName: "properties.initialCapacity", + required: true, + type: { + name: "Number" + } + }, + availabilityZone: { + serializedName: "properties.availabilityZone", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/liftrqumulo/arm-liftrqumulo/src/models/parameters.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/models/parameters.ts new file mode 100644 index 000000000000..ccb148739f5a --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/src/models/parameters.ts @@ -0,0 +1,127 @@ +/* + * 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 { + FileSystemResource as FileSystemResourceMapper, + FileSystemResourceUpdate as FileSystemResourceUpdateMapper +} 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: "2022-10-12-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const fileSystemName: OperationURLParameter = { + parameterPath: "fileSystemName", + mapper: { + serializedName: "fileSystemName", + 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 resource: OperationParameter = { + parameterPath: "resource", + mapper: FileSystemResourceMapper +}; + +export const properties: OperationParameter = { + parameterPath: "properties", + mapper: FileSystemResourceUpdateMapper +}; diff --git a/sdk/liftrqumulo/arm-liftrqumulo/src/operations/fileSystems.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/operations/fileSystems.ts new file mode 100644 index 000000000000..83ed8e8eb29d --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/src/operations/fileSystems.ts @@ -0,0 +1,626 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { FileSystems } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { QumuloStorage } from "../qumuloStorage"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + FileSystemResource, + FileSystemsListBySubscriptionNextOptionalParams, + FileSystemsListBySubscriptionOptionalParams, + FileSystemsListBySubscriptionResponse, + FileSystemsListByResourceGroupNextOptionalParams, + FileSystemsListByResourceGroupOptionalParams, + FileSystemsListByResourceGroupResponse, + FileSystemsGetOptionalParams, + FileSystemsGetResponse, + FileSystemsCreateOrUpdateOptionalParams, + FileSystemsCreateOrUpdateResponse, + FileSystemResourceUpdate, + FileSystemsUpdateOptionalParams, + FileSystemsUpdateResponse, + FileSystemsDeleteOptionalParams, + FileSystemsListBySubscriptionNextResponse, + FileSystemsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing FileSystems operations. */ +export class FileSystemsImpl implements FileSystems { + private readonly client: QumuloStorage; + + /** + * Initialize a new instance of the class FileSystems class. + * @param client Reference to the service client + */ + constructor(client: QumuloStorage) { + this.client = client; + } + + /** + * List FileSystemResource resources by subscription ID + * @param options The options parameters. + */ + public listBySubscription( + options?: FileSystemsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: FileSystemsListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: FileSystemsListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: FileSystemsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * List FileSystemResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: FileSystemsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: FileSystemsListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: FileSystemsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: FileSystemsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * List FileSystemResource resources by subscription ID + * @param options The options parameters. + */ + private _listBySubscription( + options?: FileSystemsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * List FileSystemResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: FileSystemsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Get a FileSystemResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fileSystemName Name of the File System resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + fileSystemName: string, + options?: FileSystemsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, fileSystemName, options }, + getOperationSpec + ); + } + + /** + * Create a FileSystemResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fileSystemName Name of the File System resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + fileSystemName: string, + resource: FileSystemResource, + options?: FileSystemsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + FileSystemsCreateOrUpdateResponse + > + > { + 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, fileSystemName, resource, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create a FileSystemResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fileSystemName Name of the File System resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + fileSystemName: string, + resource: FileSystemResource, + options?: FileSystemsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + fileSystemName, + resource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Update a FileSystemResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fileSystemName Name of the File System resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + fileSystemName: string, + properties: FileSystemResourceUpdate, + options?: FileSystemsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, fileSystemName, properties, options }, + updateOperationSpec + ); + } + + /** + * Delete a FileSystemResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fileSystemName Name of the File System resource + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + fileSystemName: string, + options?: FileSystemsDeleteOptionalParams + ): 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, fileSystemName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Delete a FileSystemResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fileSystemName Name of the File System resource + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + fileSystemName: string, + options?: FileSystemsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + fileSystemName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: FileSystemsListBySubscriptionNextOptionalParams + ): 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?: FileSystemsListByResourceGroupNextOptionalParams + ): 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/Qumulo.Storage/fileSystems", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FileSystemResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FileSystemResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems/{fileSystemName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FileSystemResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.fileSystemName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems/{fileSystemName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.FileSystemResource + }, + 201: { + bodyMapper: Mappers.FileSystemResource + }, + 202: { + bodyMapper: Mappers.FileSystemResource + }, + 204: { + bodyMapper: Mappers.FileSystemResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.resource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.fileSystemName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems/{fileSystemName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.FileSystemResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.properties, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.fileSystemName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems/{fileSystemName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.fileSystemName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FileSystemResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FileSystemResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/liftrqumulo/arm-liftrqumulo/src/operations/index.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/operations/index.ts new file mode 100644 index 000000000000..9283434b5869 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/src/operations/index.ts @@ -0,0 +1,10 @@ +/* + * 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 "./fileSystems"; diff --git a/sdk/liftrqumulo/arm-liftrqumulo/src/operations/operations.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/operations/operations.ts new file mode 100644 index 000000000000..eb32699d3552 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/src/operations/operations.ts @@ -0,0 +1,149 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { QumuloStorage } from "../qumuloStorage"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: QumuloStorage; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: QumuloStorage) { + this.client = client; + } + + /** + * List the operations for the provider + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List the operations for the provider + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Qumulo.Storage/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/liftrqumulo/arm-liftrqumulo/src/operationsInterfaces/fileSystems.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/operationsInterfaces/fileSystems.ts new file mode 100644 index 000000000000..03bb06da7790 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/src/operationsInterfaces/fileSystems.ts @@ -0,0 +1,121 @@ +/* + * 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 { + FileSystemResource, + FileSystemsListBySubscriptionOptionalParams, + FileSystemsListByResourceGroupOptionalParams, + FileSystemsGetOptionalParams, + FileSystemsGetResponse, + FileSystemsCreateOrUpdateOptionalParams, + FileSystemsCreateOrUpdateResponse, + FileSystemResourceUpdate, + FileSystemsUpdateOptionalParams, + FileSystemsUpdateResponse, + FileSystemsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a FileSystems. */ +export interface FileSystems { + /** + * List FileSystemResource resources by subscription ID + * @param options The options parameters. + */ + listBySubscription( + options?: FileSystemsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * List FileSystemResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: FileSystemsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a FileSystemResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fileSystemName Name of the File System resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + fileSystemName: string, + options?: FileSystemsGetOptionalParams + ): Promise; + /** + * Create a FileSystemResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fileSystemName Name of the File System resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + fileSystemName: string, + resource: FileSystemResource, + options?: FileSystemsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + FileSystemsCreateOrUpdateResponse + > + >; + /** + * Create a FileSystemResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fileSystemName Name of the File System resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + fileSystemName: string, + resource: FileSystemResource, + options?: FileSystemsCreateOrUpdateOptionalParams + ): Promise; + /** + * Update a FileSystemResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fileSystemName Name of the File System resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + fileSystemName: string, + properties: FileSystemResourceUpdate, + options?: FileSystemsUpdateOptionalParams + ): Promise; + /** + * Delete a FileSystemResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fileSystemName Name of the File System resource + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + fileSystemName: string, + options?: FileSystemsDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a FileSystemResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fileSystemName Name of the File System resource + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + fileSystemName: string, + options?: FileSystemsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/liftrqumulo/arm-liftrqumulo/src/operationsInterfaces/index.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..9283434b5869 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/src/operationsInterfaces/index.ts @@ -0,0 +1,10 @@ +/* + * 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 "./fileSystems"; diff --git a/sdk/liftrqumulo/arm-liftrqumulo/src/operationsInterfaces/operations.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..5cf5581845bd --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/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 { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * List the operations for the provider + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/liftrqumulo/arm-liftrqumulo/src/pagingHelper.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/liftrqumulo/arm-liftrqumulo/src/qumuloStorage.ts b/sdk/liftrqumulo/arm-liftrqumulo/src/qumuloStorage.ts new file mode 100644 index 000000000000..9d8a6cbb8181 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/src/qumuloStorage.ts @@ -0,0 +1,142 @@ +/* + * 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, FileSystemsImpl } from "./operations"; +import { Operations, FileSystems } from "./operationsInterfaces"; +import { QumuloStorageOptionalParams } from "./models"; + +export class QumuloStorage extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the QumuloStorage 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?: QumuloStorageOptionalParams + ) { + 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: QumuloStorageOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-liftrqumulo/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com" + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2022-10-12-preview"; + this.operations = new OperationsImpl(this); + this.fileSystems = new FileSystemsImpl(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; + fileSystems: FileSystems; +} diff --git a/sdk/liftrqumulo/arm-liftrqumulo/test/sampleTest.ts b/sdk/liftrqumulo/arm-liftrqumulo/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/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/liftrqumulo/arm-liftrqumulo/tsconfig.json b/sdk/liftrqumulo/arm-liftrqumulo/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/liftrqumulo/arm-liftrqumulo/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/liftrqumulo/ci.mgmt.yml b/sdk/liftrqumulo/ci.mgmt.yml new file mode 100644 index 000000000000..9a3722dcdc5b --- /dev/null +++ b/sdk/liftrqumulo/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/liftrqumulo/arm-liftrqumulo + - sdk/liftrqumulo/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/liftrqumulo/arm-liftrqumulo + - sdk/liftrqumulo/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: liftrqumulo + Artifacts: + - name: azure-arm-liftrqumulo + safeName: azurearmliftrqumulo + \ No newline at end of file