diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 954a2cda4bcf..1410c86bff56 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -618,7 +618,7 @@ importers: version: file:projects/arm-quantum.tgz '@rush-temp/arm-qumulo': specifier: file:./projects/arm-qumulo.tgz - version: file:projects/arm-qumulo.tgz + version: file:projects/arm-qumulo.tgz(msw@2.6.8(@types/node@22.7.9)(typescript@5.7.2))(vite@5.4.11(@types/node@22.7.9)) '@rush-temp/arm-quota': specifier: file:./projects/arm-quota.tgz version: file:projects/arm-quota.tgz @@ -3248,7 +3248,7 @@ packages: version: 0.0.0 '@rush-temp/arm-qumulo@file:projects/arm-qumulo.tgz': - resolution: {integrity: sha512-DZs1TcFxfCOnRQ1IxlPzxCHq7H2/X1QljZ0IVbCqJ7sd1ngnWFq3U7gh09giZpSdeROGwlu0rnHNqQowjblMnA==, tarball: file:projects/arm-qumulo.tgz} + resolution: {integrity: sha512-BA4qFJe92n66wSpwtpMSu2gItCfZGSqk+VUCTromJSOKfhXgTMzdRB2xdg2GjwYsdKtzZElb/dI8k/orMc9kmQ==, tarball: file:projects/arm-qumulo.tgz} version: 0.0.0 '@rush-temp/arm-quota@file:projects/arm-quota.tgz': @@ -14126,26 +14126,38 @@ snapshots: - '@swc/wasm' - supports-color - '@rush-temp/arm-qumulo@file:projects/arm-qumulo.tgz': + '@rush-temp/arm-qumulo@file:projects/arm-qumulo.tgz(msw@2.6.8(@types/node@22.7.9)(typescript@5.7.2))(vite@5.4.11(@types/node@22.7.9))': dependencies: - '@azure-tools/test-credential': 1.3.1 - '@azure-tools/test-recorder': 3.5.2 - '@azure/abort-controller': 1.1.0 - '@azure/core-lro': 2.7.2 - '@types/chai': 4.3.20 - '@types/mocha': 10.0.10 + '@microsoft/api-extractor': 7.48.0(@types/node@18.19.68) '@types/node': 18.19.68 - chai: 4.5.0 + '@vitest/browser': 2.1.8(@types/node@18.19.68)(playwright@1.49.1)(typescript@5.6.3)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8) + '@vitest/coverage-istanbul': 2.1.8(vitest@2.1.8) dotenv: 16.4.7 - mocha: 11.0.2 - ts-node: 10.9.2(@types/node@18.19.68)(typescript@5.7.2) + eslint: 9.17.0 + playwright: 1.49.1 tslib: 2.8.1 - tsx: 4.19.2 - typescript: 5.7.2 + typescript: 5.6.3 + vitest: 2.1.8(@types/node@18.19.68)(@vitest/browser@2.1.8)(msw@2.6.8(@types/node@22.7.9)(typescript@5.7.2)) transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' + - '@edge-runtime/vm' + - '@vitest/ui' + - bufferutil + - happy-dom + - jiti + - jsdom + - less + - lightningcss + - msw + - safaridriver + - sass + - sass-embedded + - stylus + - sugarss - supports-color + - terser + - utf-8-validate + - vite + - webdriverio '@rush-temp/arm-quota@file:projects/arm-quota.tgz': dependencies: @@ -20350,6 +20362,27 @@ snapshots: '@ungap/structured-clone@1.2.1': {} + '@vitest/browser@2.1.8(@types/node@18.19.68)(playwright@1.49.1)(typescript@5.6.3)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8)': + dependencies: + '@testing-library/dom': 10.4.0 + '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) + '@vitest/mocker': 2.1.8(msw@2.6.8(@types/node@22.7.9)(typescript@5.7.2))(vite@5.4.11(@types/node@22.7.9)) + '@vitest/utils': 2.1.8 + magic-string: 0.30.15 + msw: 2.6.8(@types/node@18.19.68)(typescript@5.6.3) + sirv: 3.0.0 + tinyrainbow: 1.2.0 + vitest: 2.1.8(@types/node@22.7.9)(@vitest/browser@2.1.8)(msw@2.6.8(@types/node@22.7.9)(typescript@5.7.2)) + ws: 8.18.0 + optionalDependencies: + playwright: 1.49.1 + transitivePeerDependencies: + - '@types/node' + - bufferutil + - typescript + - utf-8-validate + - vite + '@vitest/browser@2.1.8(@types/node@18.19.68)(playwright@1.49.1)(typescript@5.7.2)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8)': dependencies: '@testing-library/dom': 10.4.0 @@ -20494,7 +20527,7 @@ snapshots: ajv-formats@3.0.1: dependencies: - ajv: 8.13.0 + ajv: 8.17.1 ajv@6.12.6: dependencies: @@ -22745,6 +22778,31 @@ snapshots: ms@2.1.3: {} + msw@2.6.8(@types/node@18.19.68)(typescript@5.6.3): + dependencies: + '@bundled-es-modules/cookie': 2.0.1 + '@bundled-es-modules/statuses': 1.0.1 + '@bundled-es-modules/tough-cookie': 0.1.6 + '@inquirer/confirm': 5.1.0(@types/node@18.19.68) + '@mswjs/interceptors': 0.37.3 + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/until': 2.1.0 + '@types/cookie': 0.6.0 + '@types/statuses': 2.0.5 + chalk: 4.1.2 + graphql: 16.9.0 + headers-polyfill: 4.0.3 + is-node-process: 1.2.0 + outvariant: 1.4.3 + path-to-regexp: 6.3.0 + strict-event-emitter: 0.5.1 + type-fest: 4.30.1 + yargs: 17.7.2 + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - '@types/node' + msw@2.6.8(@types/node@18.19.68)(typescript@5.7.2): dependencies: '@bundled-es-modules/cookie': 2.0.1 diff --git a/sdk/liftrqumulo/arm-qumulo/CHANGELOG.md b/sdk/liftrqumulo/arm-qumulo/CHANGELOG.md index 4a493ddb1550..0b9fa425d043 100644 --- a/sdk/liftrqumulo/arm-qumulo/CHANGELOG.md +++ b/sdk/liftrqumulo/arm-qumulo/CHANGELOG.md @@ -1,15 +1,60 @@ # Release History - -## 2.0.1 (Unreleased) - + +## 3.0.0 (2024-12-19) + ### Features Added -### Breaking Changes + - Added operation FileSystemsOperations.createOrUpdate + - Added operation FileSystemsOperations.delete + - Added Interface FileSystemResourceProperties + - Added Interface PagedAsyncIterableIterator + - Added Interface PageSettings + - Added Interface RestorePollerOptions + - Added Interface StorageClientOptionalParams + - Added Class StorageClient + - Added Type Alias ContinuablePage + - Interface FileSystemResource has a new optional parameter properties + - Added Enum KnownVersions + - Enum KnownManagedServiceIdentityType has a new value "SystemAssigned,UserAssigned" + - Enum KnownOrigin has a new value "user,system" + - Enum KnownOrigin has a new value system + - Enum KnownOrigin has a new value user + - Added function restorePoller -### Bugs Fixed - -### Other Changes +### Breaking Changes + - Removed operation FileSystems.beginCreateOrUpdate + - Removed operation FileSystems.beginCreateOrUpdateAndWait + - Removed operation FileSystems.beginDelete + - Removed operation FileSystems.beginDeleteAndWait + - Deleted Class QumuloStorage + - Interface FileSystemResource no longer has parameter adminPassword + - Interface FileSystemResource no longer has parameter availabilityZone + - Interface FileSystemResource no longer has parameter clusterLoginUrl + - Interface FileSystemResource no longer has parameter delegatedSubnetId + - Interface FileSystemResource no longer has parameter marketplaceDetails + - Interface FileSystemResource no longer has parameter privateIPs + - Interface FileSystemResource no longer has parameter provisioningState + - Interface FileSystemResource no longer has parameter storageSku + - Interface FileSystemResource no longer has parameter userDetails + - Interface FileSystemsCreateOrUpdateOptionalParams no longer has parameter resumeFrom + - Interface FileSystemsDeleteOptionalParams no longer has parameter resumeFrom + - Type of parameter tags of interface FileSystemResourceUpdate is changed from { + [propertyName: string]: string; + } to Record + - Type of parameter userAssignedIdentities of interface ManagedServiceIdentity is changed from { + [propertyName: string]: UserAssignedIdentity; + } to Record + - Type of parameter tags of interface TrackedResource is changed from { + [propertyName: string]: string; + } to Record + - Enum KnownManagedServiceIdentityType no longer has value SystemAssignedUserAssigned + - Enum KnownOrigin no longer has value System + - Enum KnownOrigin no longer has value User + - Enum KnownOrigin no longer has value UserSystem + - Removed function getContinuationToken + + ## 2.0.0 (2024-07-17) ### Features Added diff --git a/sdk/liftrqumulo/arm-qumulo/README.md b/sdk/liftrqumulo/arm-qumulo/README.md index fe3d67c00096..8fe820fb7a17 100644 --- a/sdk/liftrqumulo/arm-qumulo/README.md +++ b/sdk/liftrqumulo/arm-qumulo/README.md @@ -1,11 +1,14 @@ -# Azure QumuloStorage client library for JavaScript +# Azure Storage client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure QumuloStorage client. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Storage client. -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-qumulo) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-qumulo) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-qumulo) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + + +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-qumulo) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-qumulo) +- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-qumulo?view=azure-node-preview) ## Getting started @@ -22,16 +25,16 @@ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUP ### Install the `@azure/arm-qumulo` package -Install the Azure QumuloStorage client library for JavaScript with `npm`: +Install the Azure Storage client library for JavaScript with `npm`: ```bash npm install @azure/arm-qumulo ``` -### Create and authenticate a `QumuloStorage` +### Create and authenticate a `StorageClient` -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]. +To create a client object to access the Azure Storage API, you will need the `endpoint` of your Azure Storage resource and a `credential`. The Azure Storage client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Storage 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). @@ -41,36 +44,35 @@ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below 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`. +You will also need to **register a new AAD application and grant access to Azure Storage** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). +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-qumulo"); +const { StorageClient } = require("@azure/arm-qumulo"); 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); +const client = new StorageClient(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); +// const client = new StorageClient(credential, subscriptionId); ``` -### JavaScript Bundle +### 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 +### StorageClient -`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. +`StorageClient` is the primary interface for developers using the Azure Storage client library. Explore the methods on this client object to understand the different features of the Azure Storage service that you can access. ## Troubleshooting @@ -85,9 +87,6 @@ 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 @@ -97,10 +96,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [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-qumulo%2FREADME.png) - -[azure_cli]: https://learn.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 diff --git a/sdk/liftrqumulo/arm-qumulo/_meta.json b/sdk/liftrqumulo/arm-qumulo/_meta.json deleted file mode 100644 index 54a34e6d07a4..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/_meta.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "commit": "928047803788f7377fa003a26ba2bdc2e0fcccc0", - "readme": "specification/liftrqumulo/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\liftrqumulo\\resource-manager\\readme.md --use=@autorest/typescript@6.0.23 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.11", - "use": "@autorest/typescript@6.0.23" -} \ No newline at end of file diff --git a/sdk/liftrqumulo/arm-qumulo/api-extractor.json b/sdk/liftrqumulo/arm-qumulo/api-extractor.json index ea17f6b9f990..3e73a52d4202 100644 --- a/sdk/liftrqumulo/arm-qumulo/api-extractor.json +++ b/sdk/liftrqumulo/arm-qumulo/api-extractor.json @@ -1,31 +1,18 @@ { "$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" - }, + "mainEntryPointFilePath": "./dist/esm/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-qumulo.d.ts" }, "messages": { - "tsdocMessageReporting": { - "default": { - "logLevel": "none" - } - }, + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, "extractorMessageReporting": { - "ae-missing-release-tag": { - "logLevel": "none" - }, - "ae-unresolved-link": { - "logLevel": "none" - } + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } } } -} \ No newline at end of file +} diff --git a/sdk/liftrqumulo/arm-qumulo/assets.json b/sdk/liftrqumulo/arm-qumulo/assets.json deleted file mode 100644 index 6476eb7aa2aa..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/liftrqumulo/arm-qumulo", - "Tag": "js/liftrqumulo/arm-qumulo_fb4019299b" -} diff --git a/sdk/liftrqumulo/arm-qumulo/eslint.config.mjs b/sdk/liftrqumulo/arm-qumulo/eslint.config.mjs new file mode 100644 index 000000000000..113bdc3eaf5f --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/eslint.config.mjs @@ -0,0 +1,17 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default [ + ...azsdkEslint.configs.recommended, + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-apiextractor-json-types": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-module": "off", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn" + } + } +]; diff --git a/sdk/liftrqumulo/arm-qumulo/package.json b/sdk/liftrqumulo/arm-qumulo/package.json index 85e44d1484e3..7a0c6fb6018b 100644 --- a/sdk/liftrqumulo/arm-qumulo/package.json +++ b/sdk/liftrqumulo/arm-qumulo/package.json @@ -1,114 +1,152 @@ { "name": "@azure/arm-qumulo", - "sdk-type": "mgmt", - "author": "Microsoft Corporation", - "description": "A generated SDK for QumuloStorage.", - "version": "2.0.1", + "version": "3.0.0", + "description": "A generated SDK for StorageClient.", "engines": { "node": ">=18.0.0" }, - "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.6.0", - "@azure/core-client": "^1.7.0", - "@azure/core-lro": "^2.5.4", - "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.14.0", - "tslib": "^2.2.0" + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false }, + "type": "module", "keywords": [ "node", "azure", + "cloud", "typescript", "browser", "isomorphic" ], + "author": "Microsoft Corporation", "license": "MIT", - "main": "./dist/index.js", - "module": "./dist-esm/src/index.js", - "types": "./types/arm-qumulo.d.ts", - "devDependencies": { - "@azure-tools/test-credential": "^1.1.0", - "@azure-tools/test-recorder": "^3.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", - "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", - "chai": "^4.2.0", - "dotenv": "^16.0.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "tsx": "^4.7.1", - "typescript": "~5.7.2" - }, - "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", + "dist", "README.md", "LICENSE", - "tsconfig.json", "review/*", - "CHANGELOG.md", - "types/*" + "CHANGELOG.md" ], + "sdk-type": "mgmt", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-qumulo/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/api/storageContext.ts", + "prefix": "userAgentInfo" + } + ] + }, + "dependencies": { + "@azure/core-util": "^1.9.2", + "@azure-rest/core-client": "^2.3.1", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.5.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.6.2", + "@azure/core-lro": "^3.1.0", + "@azure/abort-controller": "^2.1.2" + }, + "devDependencies": { + "dotenv": "^16.0.0", + "@microsoft/api-extractor": "^7.40.3", + "@types/node": "^18.0.0", + "eslint": "^9.9.0", + "typescript": "~5.6.2", + "@azure/identity": "^4.2.1", + "@vitest/browser": "^2.0.5", + "@vitest/coverage-istanbul": "^2.0.5", + "playwright": "^1.41.2", + "vitest": "^2.0.5", + "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0" + }, "scripts": { - "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", - "build:node": "echo skipped", - "build:samples": "echo skipped.", - "build:test": "echo skipped", - "check-format": "echo skipped", "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", - "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", - "format": "echo skipped", + "extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", + "pack": "npm pack 2>&1", + "lint": "eslint package.json api-extractor.json src test", + "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser", + "unit-test:node": "dev-tool run test:vitest", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", + "integration-test:node": "echo skipped", + "build:samples": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "execute:samples": "echo skipped", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "generate:client": "echo skipped", + "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", - "test": "npm run integration-test", - "test:browser": "echo skipped", - "test:node": "echo skipped", - "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", - "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test", + "build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", + "test:node": "npm run clean && dev-tool run build-package && npm run unit-test:node && npm run integration-test:node", + "test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test", "update-snippets": "echo skipped" }, - "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/qumuloStorage.ts", - "prefix": "packageDetails" + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" } - ] + }, + "./models": { + "browser": { + "types": "./dist/browser/models/index.d.ts", + "default": "./dist/browser/models/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/index.d.ts", + "default": "./dist/react-native/models/index.js" + }, + "import": { + "types": "./dist/esm/models/index.d.ts", + "default": "./dist/esm/models/index.js" + }, + "require": { + "types": "./dist/commonjs/models/index.d.ts", + "default": "./dist/commonjs/models/index.js" + } + } }, - "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-qumulo", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-qumulo?view=azure-node-preview" - } + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" } diff --git a/sdk/liftrqumulo/arm-qumulo/review/arm-qumulo-models.api.md b/sdk/liftrqumulo/arm-qumulo/review/arm-qumulo-models.api.md new file mode 100644 index 000000000000..98947c96c327 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/review/arm-qumulo-models.api.md @@ -0,0 +1,183 @@ +## API Report File for "@azure/arm-qumulo" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export type ActionType = string; + +// @public +export type CreatedByType = string; + +// @public +export interface FileSystemResource extends TrackedResource { + identity?: ManagedServiceIdentity; + properties?: FileSystemResourceProperties; +} + +// @public +export interface FileSystemResourceProperties { + adminPassword: string; + availabilityZone?: string; + clusterLoginUrl?: string; + delegatedSubnetId: string; + marketplaceDetails: MarketplaceDetails; + privateIPs?: string[]; + readonly provisioningState?: ProvisioningState; + storageSku: string; + userDetails: UserDetails; +} + +// @public +export interface FileSystemResourceUpdate { + identity?: ManagedServiceIdentity; + properties?: FileSystemResourceUpdateProperties; + tags?: Record; +} + +// @public +export interface FileSystemResourceUpdateProperties { + delegatedSubnetId?: string; + marketplaceDetails?: MarketplaceDetails; + userDetails?: UserDetails; +} + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownManagedServiceIdentityType { + "SystemAssigned,UserAssigned" = "SystemAssigned,UserAssigned", + None = "None", + SystemAssigned = "SystemAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownMarketplaceSubscriptionStatus { + PendingFulfillmentStart = "PendingFulfillmentStart", + Subscribed = "Subscribed", + Suspended = "Suspended", + Unsubscribed = "Unsubscribed" +} + +// @public +export enum KnownOrigin { + "user,system" = "user,system", + system = "system", + user = "user" +} + +// @public +export enum KnownProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Creating = "Creating", + Deleted = "Deleted", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownVersions { + v2_stable = "2024-06-19" +} + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: Record; +} + +// @public +export type ManagedServiceIdentityType = string; + +// @public +export interface MarketplaceDetails { + marketplaceSubscriptionId?: string; + readonly marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; + offerId: string; + planId: string; + publisherId?: string; + termUnit?: string; +} + +// @public +export type MarketplaceSubscriptionStatus = string; + +// @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 type Origin = string; + +// @public +export type ProvisioningState = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// @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-qumulo/review/arm-qumulo.api.md b/sdk/liftrqumulo/arm-qumulo/review/arm-qumulo.api.md index 621f68e25b87..e8bb6d7d9339 100644 --- a/sdk/liftrqumulo/arm-qumulo/review/arm-qumulo.api.md +++ b/sdk/liftrqumulo/arm-qumulo/review/arm-qumulo.api.md @@ -4,65 +4,50 @@ ```ts -import * as coreAuth from '@azure/core-auth'; -import * as coreClient from '@azure/core-client'; +import { AbortSignalLike } from '@azure/abort-controller'; +import { ClientOptions } from '@azure-rest/core-client'; +import { OperationOptions } from '@azure-rest/core-client'; import { OperationState } from '@azure/core-lro'; -import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { SimplePollerLike } from '@azure/core-lro'; +import { PathUncheckedResponse } from '@azure-rest/core-client'; +import { Pipeline } from '@azure/core-rest-pipeline'; +import { PollerLike } from '@azure/core-lro'; +import { TokenCredential } from '@azure/core-auth'; // @public export type ActionType = string; // @public -export type CreatedByType = string; - -// @public -export interface ErrorAdditionalInfo { - readonly info?: Record; - readonly type?: string; -} +export type ContinuablePage = TPage & { + continuationToken?: string; +}; // @public -export interface ErrorDetail { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code?: string; - readonly details?: ErrorDetail[]; - readonly message?: string; - readonly target?: string; -} +export type CreatedByType = string; // @public -export interface ErrorResponse { - error?: ErrorDetail; +export interface FileSystemResource extends TrackedResource { + identity?: ManagedServiceIdentity; + properties?: FileSystemResourceProperties; } // @public -export interface FileSystemResource extends TrackedResource { - adminPassword?: string; +export interface FileSystemResourceProperties { + adminPassword: string; availabilityZone?: string; clusterLoginUrl?: string; - delegatedSubnetId?: string; - identity?: ManagedServiceIdentity; - marketplaceDetails?: MarketplaceDetails; + delegatedSubnetId: string; + marketplaceDetails: MarketplaceDetails; privateIPs?: string[]; readonly provisioningState?: ProvisioningState; - storageSku?: string; - userDetails?: UserDetails; -} - -// @public -export interface FileSystemResourceListResult { - nextLink?: string; - value: FileSystemResource[]; + storageSku: string; + userDetails: UserDetails; } // @public export interface FileSystemResourceUpdate { identity?: ManagedServiceIdentity; properties?: FileSystemResourceUpdateProperties; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public @@ -73,93 +58,41 @@ export interface FileSystemResourceUpdateProperties { } // @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, FileSystemsDeleteResponse>>; - 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 FileSystemsCreateOrUpdateHeaders { - azureAsyncOperation?: string; - retryAfter?: number; -} - -// @public -export interface FileSystemsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface FileSystemsCreateOrUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type FileSystemsCreateOrUpdateResponse = FileSystemResource; - -// @public -export interface FileSystemsDeleteHeaders { - azureAsyncOperation?: string; - location?: string; - retryAfter?: number; -} - -// @public -export interface FileSystemsDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface FileSystemsDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type FileSystemsDeleteResponse = FileSystemsDeleteHeaders; - -// @public -export interface FileSystemsGetOptionalParams extends coreClient.OperationOptions { +export interface FileSystemsGetOptionalParams extends OperationOptions { } // @public -export type FileSystemsGetResponse = FileSystemResource; - -// @public -export interface FileSystemsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +export interface FileSystemsListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type FileSystemsListByResourceGroupNextResponse = FileSystemResourceListResult; - -// @public -export interface FileSystemsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +export interface FileSystemsListBySubscriptionOptionalParams extends OperationOptions { } // @public -export type FileSystemsListByResourceGroupResponse = FileSystemResourceListResult; - -// @public -export interface FileSystemsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface FileSystemsOperations { + createOrUpdate: (resourceGroupName: string, fileSystemName: string, resource: FileSystemResource, options?: FileSystemsCreateOrUpdateOptionalParams) => PollerLike, FileSystemResource>; + delete: (resourceGroupName: string, fileSystemName: string, options?: FileSystemsDeleteOptionalParams) => PollerLike, void>; + 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 type FileSystemsListBySubscriptionNextResponse = FileSystemResourceListResult; - -// @public -export interface FileSystemsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +export interface FileSystemsUpdateOptionalParams extends 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" @@ -175,9 +108,9 @@ export enum KnownCreatedByType { // @public export enum KnownManagedServiceIdentityType { + "SystemAssigned,UserAssigned" = "SystemAssigned,UserAssigned", None = "None", SystemAssigned = "SystemAssigned", - SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", UserAssigned = "UserAssigned" } @@ -191,9 +124,9 @@ export enum KnownMarketplaceSubscriptionStatus { // @public export enum KnownOrigin { - System = "system", - User = "user", - UserSystem = "user,system" + "user,system" = "user,system", + system = "system", + user = "user" } // @public @@ -208,14 +141,17 @@ export enum KnownProvisioningState { Updating = "Updating" } +// @public +export enum KnownVersions { + v2_stable = "2024-06-19" +} + // @public export interface ManagedServiceIdentity { readonly principalId?: string; readonly tenantId?: string; type: ManagedServiceIdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentity; - }; + userAssignedIdentities?: Record; } // @public @@ -252,64 +188,61 @@ export interface OperationDisplay { } // @public -export interface OperationListResult { - readonly nextLink?: string; - readonly value?: Operation[]; +export interface OperationsListOptionalParams extends OperationOptions { } // @public -export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; } // @public -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { -} +export type Origin = string; // @public -export type OperationsListNextResponse = OperationListResult; +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} // @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { +export interface PageSettings { + continuationToken?: string; } // @public -export type OperationsListResponse = OperationListResult; +export type ProvisioningState = string; // @public -export type Origin = string; +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} // @public -export type ProvisioningState = string; +export function restorePoller(client: StorageClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; // @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; +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; + updateIntervalInMs?: number; +} + +// @public (undocumented) +export class StorageClient { + constructor(credential: TokenCredential, subscriptionId: string, options?: StorageClientOptionalParams); + readonly fileSystems: FileSystemsOperations; + readonly operations: OperationsOperations; + readonly pipeline: Pipeline; } // @public -export interface Resource { - readonly id?: string; - readonly name?: string; - readonly systemData?: SystemData; - readonly type?: string; +export interface StorageClientOptionalParams extends ClientOptions { + apiVersion?: string; } // @public @@ -325,9 +258,7 @@ export interface SystemData { // @public export interface TrackedResource extends Resource { location: string; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public diff --git a/sdk/liftrqumulo/arm-qumulo/sample.env b/sdk/liftrqumulo/arm-qumulo/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/liftrqumulo/arm-qumulo/sample.env +++ b/sdk/liftrqumulo/arm-qumulo/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsCreateOrUpdateSample.ts b/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsCreateOrUpdateSample.ts deleted file mode 100644 index 135350ea4c15..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsCreateOrUpdateSample.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { FileSystemResource, QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a FileSystemResource - * - * @summary Create a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_CreateOrUpdate_MaximumSet_Gen.json - */ -async function fileSystemsCreateOrUpdate() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "hfcmtgaes"; - const resource: FileSystemResource = { - adminPassword: "fakeTestSecretPlaceholder", - availabilityZone: "eqdvbdiuwmhhzqzmksmwllpddqquwt", - clusterLoginUrl: "ykaynsjvhihdthkkvvodjrgc", - delegatedSubnetId: "jykmxrf", - identity: { type: "None", userAssignedIdentities: { key7679: {} } }, - location: "pnb", - marketplaceDetails: { - marketplaceSubscriptionId: "xaqtkloiyovmexqhn", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "s", - planId: "fwtpz", - publisherId: "czxcfrwodazyaft", - termUnit: "cfwwczmygsimcyvoclcw", - }, - privateIPs: ["gzken"], - storageSku: "yhyzby", - tags: { key7090: "rurrdiaqp" }, - userDetails: { email: "aqsnzyroo" }, - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginCreateOrUpdateAndWait( - resourceGroupName, - fileSystemName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a FileSystemResource - * - * @summary Create a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_CreateOrUpdate_MinimumSet_Gen.json - */ -async function fileSystemsCreateOrUpdateMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaaaaaaaaaaaaaaaaaaa"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgopenapi"; - const fileSystemName = "aaaaaaaa"; - const resource: FileSystemResource = { - adminPassword: "fakeTestSecretPlaceholder", - delegatedSubnetId: "aaaaaaaaaa", - location: "aaaaaaaaaaaaaaaaaaaaaaaaa", - marketplaceDetails: { - marketplaceSubscriptionId: "aaaaaaaaaaaaa", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "aaaaaaaaaaaaaaaaaaaaaaaaa", - planId: "aaaaaa", - }, - storageSku: "Standard", - userDetails: { email: "viptslwulnpaupfljvnjeq" }, - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginCreateOrUpdateAndWait( - resourceGroupName, - fileSystemName, - resource, - ); - console.log(result); -} - -async function main() { - fileSystemsCreateOrUpdate(); - fileSystemsCreateOrUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsDeleteSample.ts b/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsDeleteSample.ts deleted file mode 100644 index 6e77bade3149..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsDeleteSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a FileSystemResource - * - * @summary Delete a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Delete_MaximumSet_Gen.json - */ -async function fileSystemsDelete() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "xoschzkccroahrykedlvbbnsddq"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginDeleteAndWait( - resourceGroupName, - fileSystemName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a FileSystemResource - * - * @summary Delete a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Delete_MinimumSet_Gen.json - */ -async function fileSystemsDeleteMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "jgtskkiplquyrlkaxvhdg"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginDeleteAndWait( - resourceGroupName, - fileSystemName, - ); - console.log(result); -} - -async function main() { - fileSystemsDelete(); - fileSystemsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsGetSample.ts b/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsGetSample.ts deleted file mode 100644 index aa1f036b3f47..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsGetSample.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a FileSystemResource - * - * @summary Get a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Get_MaximumSet_Gen.json - */ -async function fileSystemsGet() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "sihbehcisdqtqqyfiewiiaphgh"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.get( - resourceGroupName, - fileSystemName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a FileSystemResource - * - * @summary Get a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Get_MinimumSet_Gen.json - */ -async function fileSystemsGetMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.get( - resourceGroupName, - fileSystemName, - ); - console.log(result); -} - -async function main() { - fileSystemsGet(); - fileSystemsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsListByResourceGroupSample.ts b/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsListByResourceGroupSample.ts deleted file mode 100644 index 220c3a1195ec..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsListByResourceGroupSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List FileSystemResource resources by resource group - * - * @summary List FileSystemResource resources by resource group - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListByResourceGroup_MaximumSet_Gen.json - */ -async function fileSystemsListByResourceGroup() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List FileSystemResource resources by resource group - * - * @summary List FileSystemResource resources by resource group - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListByResourceGroup_MinimumSet_Gen.json - */ -async function fileSystemsListByResourceGroupMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - fileSystemsListByResourceGroup(); - fileSystemsListByResourceGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsListBySubscriptionSample.ts b/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsListBySubscriptionSample.ts deleted file mode 100644 index b9cffe2047d7..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsListBySubscriptionSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List FileSystemResource resources by subscription ID - * - * @summary List FileSystemResource resources by subscription ID - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListBySubscription_MaximumSet_Gen.json - */ -async function fileSystemsListBySubscription() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List FileSystemResource resources by subscription ID - * - * @summary List FileSystemResource resources by subscription ID - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListBySubscription_MinimumSet_Gen.json - */ -async function fileSystemsListBySubscriptionMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - fileSystemsListBySubscription(); - fileSystemsListBySubscriptionMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsUpdateSample.ts b/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsUpdateSample.ts deleted file mode 100644 index e2d2a3c034f5..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples-dev/fileSystemsUpdateSample.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { FileSystemResourceUpdate, QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a FileSystemResource - * - * @summary Update a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Update_MaximumSet_Gen.json - */ -async function fileSystemsUpdate() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "ahpixnvykleksjlr"; - const properties: FileSystemResourceUpdate = { - identity: { type: "None", userAssignedIdentities: { key7679: {} } }, - properties: { - delegatedSubnetId: "bqaryqsjlackxphpmzffgoqsvm", - marketplaceDetails: { - marketplaceSubscriptionId: "xaqtkloiyovmexqhn", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "s", - planId: "fwtpz", - publisherId: "czxcfrwodazyaft", - termUnit: "cfwwczmygsimcyvoclcw", - }, - userDetails: { email: "aqsnzyroo" }, - }, - tags: { key357: "ztkkvhfia" }, - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.update( - resourceGroupName, - fileSystemName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a FileSystemResource - * - * @summary Update a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Update_MinimumSet_Gen.json - */ -async function fileSystemsUpdateMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "aaaaaaaaaaaaaaaaa"; - const properties: FileSystemResourceUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.update( - resourceGroupName, - fileSystemName, - properties, - ); - console.log(result); -} - -async function main() { - fileSystemsUpdate(); - fileSystemsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples-dev/operationsListSample.ts b/sdk/liftrqumulo/arm-qumulo/samples-dev/operationsListSample.ts deleted file mode 100644 index 25e53deaa673..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsList() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); - operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/README.md b/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/README.md deleted file mode 100644 index 924da1f1dafd..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [fileSystemsCreateOrUpdateSample.js][filesystemscreateorupdatesample] | Create a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_CreateOrUpdate_MaximumSet_Gen.json | -| [fileSystemsDeleteSample.js][filesystemsdeletesample] | Delete a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Delete_MaximumSet_Gen.json | -| [fileSystemsGetSample.js][filesystemsgetsample] | Get a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Get_MaximumSet_Gen.json | -| [fileSystemsListByResourceGroupSample.js][filesystemslistbyresourcegroupsample] | List FileSystemResource resources by resource group x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_ListByResourceGroup_MaximumSet_Gen.json | -| [fileSystemsListBySubscriptionSample.js][filesystemslistbysubscriptionsample] | List FileSystemResource resources by subscription ID x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_ListBySubscription_MaximumSet_Gen.json | -| [fileSystemsUpdateSample.js][filesystemsupdatesample] | Update a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Update_MaximumSet_Gen.json | -| [operationsListSample.js][operationslistsample] | List the operations for the provider x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/Operations_List_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node fileSystemsCreateOrUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env LIFTRQUMULO_SUBSCRIPTION_ID="" LIFTRQUMULO_RESOURCE_GROUP="" node fileSystemsCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[filesystemscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsCreateOrUpdateSample.js -[filesystemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsDeleteSample.js -[filesystemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsGetSample.js -[filesystemslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsListByResourceGroupSample.js -[filesystemslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsListBySubscriptionSample.js -[filesystemsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsUpdateSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/operationsListSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-qumulo?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-qumulo/README.md diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsCreateOrUpdateSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsCreateOrUpdateSample.js deleted file mode 100644 index f98ef5639a5e..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsCreateOrUpdateSample.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a FileSystemResource - * - * @summary Create a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_CreateOrUpdate_MaximumSet_Gen.json - */ -async function fileSystemsCreateOrUpdateMaximumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "nauwwbfoqehgbhdsmkewoboyxeqg"; - const resource = { - adminPassword: "ekceujoecaashtjlsgcymnrdozk", - availabilityZone: "maseyqhlnhoiwbabcqabtedbjpip", - clusterLoginUrl: "jjqhgevy", - delegatedSubnetId: "neqctctqdmjezfgt", - identity: { type: "None", userAssignedIdentities: { key4522: {} } }, - initialCapacity: 9, - location: "przdlsmlzsszphnixq", - marketplaceDetails: { - marketplaceSubscriptionId: "ujrcqvxfnhxxheoth", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "eiyhbmpwgezcmzrrfoiskuxlcvwojf", - planId: "x", - publisherId: "wfmokfdjbwpjhz", - }, - privateIPs: ["kslguxrwbwkrj"], - provisioningState: "Accepted", - storageSku: "Standard", - tags: { key6565: "cgdhmupta" }, - userDetails: { email: "viptslwulnpaupfljvnjeq" }, - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginCreateOrUpdateAndWait( - resourceGroupName, - fileSystemName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a FileSystemResource - * - * @summary Create a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_CreateOrUpdate_MinimumSet_Gen.json - */ -async function fileSystemsCreateOrUpdateMinimumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaaaaaaaaaaaaaaaaaaa"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgopenapi"; - const fileSystemName = "aaaaaaaa"; - const resource = { - adminPassword: "ekceujoecaashtjlsgcymnrdozk", - delegatedSubnetId: "aaaaaaaaaa", - initialCapacity: 9, - location: "aaaaaaaaaaaaaaaaaaaaaaaaa", - marketplaceDetails: { - marketplaceSubscriptionId: "aaaaaaaaaaaaa", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "aaaaaaaaaaaaaaaaaaaaaaaaa", - planId: "aaaaaa", - publisherId: "aa", - }, - provisioningState: "Accepted", - storageSku: "Standard", - userDetails: { email: "viptslwulnpaupfljvnjeq" }, - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginCreateOrUpdateAndWait( - resourceGroupName, - fileSystemName, - resource, - ); - console.log(result); -} - -async function main() { - fileSystemsCreateOrUpdateMaximumSetGen(); - fileSystemsCreateOrUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsDeleteSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsDeleteSample.js deleted file mode 100644 index 21783e2ceac7..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsDeleteSample.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a FileSystemResource - * - * @summary Delete a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Delete_MaximumSet_Gen.json - */ -async function fileSystemsDeleteMaximumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "nauwwbfoqehgbhdsmkewoboyxeqg"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginDeleteAndWait(resourceGroupName, fileSystemName); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a FileSystemResource - * - * @summary Delete a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Delete_MinimumSet_Gen.json - */ -async function fileSystemsDeleteMinimumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "nauwwbfoqehgbhdsmkewoboyxeqg"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginDeleteAndWait(resourceGroupName, fileSystemName); - console.log(result); -} - -async function main() { - fileSystemsDeleteMaximumSetGen(); - fileSystemsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsGetSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsGetSample.js deleted file mode 100644 index 8c22f46c0829..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsGetSample.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a FileSystemResource - * - * @summary Get a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Get_MaximumSet_Gen.json - */ -async function fileSystemsGetMaximumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "nauwwbfoqehgbhdsmkewoboyxeqg"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.get(resourceGroupName, fileSystemName); - console.log(result); -} - -/** - * This sample demonstrates how to Get a FileSystemResource - * - * @summary Get a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Get_MinimumSet_Gen.json - */ -async function fileSystemsGetMinimumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.get(resourceGroupName, fileSystemName); - console.log(result); -} - -async function main() { - fileSystemsGetMaximumSetGen(); - fileSystemsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsListByResourceGroupSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsListByResourceGroupSample.js deleted file mode 100644 index 856c9d386cd4..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsListByResourceGroupSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List FileSystemResource resources by resource group - * - * @summary List FileSystemResource resources by resource group - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_ListByResourceGroup_MaximumSet_Gen.json - */ -async function fileSystemsListByResourceGroupMaximumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List FileSystemResource resources by resource group - * - * @summary List FileSystemResource resources by resource group - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_ListByResourceGroup_MinimumSet_Gen.json - */ -async function fileSystemsListByResourceGroupMinimumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - fileSystemsListByResourceGroupMaximumSetGen(); - fileSystemsListByResourceGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsListBySubscriptionSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsListBySubscriptionSample.js deleted file mode 100644 index cb15b836d2dc..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsListBySubscriptionSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List FileSystemResource resources by subscription ID - * - * @summary List FileSystemResource resources by subscription ID - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_ListBySubscription_MaximumSet_Gen.json - */ -async function fileSystemsListBySubscriptionMaximumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List FileSystemResource resources by subscription ID - * - * @summary List FileSystemResource resources by subscription ID - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_ListBySubscription_MinimumSet_Gen.json - */ -async function fileSystemsListBySubscriptionMinimumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - fileSystemsListBySubscriptionMaximumSetGen(); - fileSystemsListBySubscriptionMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsUpdateSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsUpdateSample.js deleted file mode 100644 index f20640062628..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/fileSystemsUpdateSample.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a FileSystemResource - * - * @summary Update a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Update_MaximumSet_Gen.json - */ -async function fileSystemsUpdateMaximumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "nauwwbfoqehgbhdsmkewoboyxeqg"; - const properties = { - identity: { type: "None", userAssignedIdentities: { key4522: {} } }, - properties: { - clusterLoginUrl: "adabmuthwrbjshzfbo", - delegatedSubnetId: "vjfirtaljehawmflyfianw", - marketplaceDetails: { - marketplaceSubscriptionId: "ujrcqvxfnhxxheoth", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "eiyhbmpwgezcmzrrfoiskuxlcvwojf", - planId: "x", - publisherId: "wfmokfdjbwpjhz", - }, - privateIPs: ["eugjqbaoucgjsopzfrq"], - userDetails: { email: "aa" }, - }, - tags: { key7534: "jsgqvqbagquvxowbrkanyhzvo" }, - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.update(resourceGroupName, fileSystemName, properties); - console.log(result); -} - -/** - * This sample demonstrates how to Update a FileSystemResource - * - * @summary Update a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Update_MinimumSet_Gen.json - */ -async function fileSystemsUpdateMinimumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "aaaaaaaaaaaaaaaaa"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.update(resourceGroupName, fileSystemName, properties); - console.log(result); -} - -async function main() { - fileSystemsUpdateMaximumSetGen(); - fileSystemsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/operationsListSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/operationsListSample.js deleted file mode 100644 index d16aa63b8ec5..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/operationsListSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsListMaximumSetGen(); - operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/package.json b/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/package.json deleted file mode 100644 index d081842c17f3..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-qumulo-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/liftrqumulo/arm-qumulo" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-qumulo", - "dependencies": { - "@azure/arm-qumulo": "latest", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - } -} diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/sample.env b/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# 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-qumulo/samples/v1/typescript/README.md b/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/README.md deleted file mode 100644 index df61c5a6aa87..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [fileSystemsCreateOrUpdateSample.ts][filesystemscreateorupdatesample] | Create a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_CreateOrUpdate_MaximumSet_Gen.json | -| [fileSystemsDeleteSample.ts][filesystemsdeletesample] | Delete a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Delete_MaximumSet_Gen.json | -| [fileSystemsGetSample.ts][filesystemsgetsample] | Get a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Get_MaximumSet_Gen.json | -| [fileSystemsListByResourceGroupSample.ts][filesystemslistbyresourcegroupsample] | List FileSystemResource resources by resource group x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_ListByResourceGroup_MaximumSet_Gen.json | -| [fileSystemsListBySubscriptionSample.ts][filesystemslistbysubscriptionsample] | List FileSystemResource resources by subscription ID x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_ListBySubscription_MaximumSet_Gen.json | -| [fileSystemsUpdateSample.ts][filesystemsupdatesample] | Update a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Update_MaximumSet_Gen.json | -| [operationsListSample.ts][operationslistsample] | List the operations for the provider x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/Operations_List_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/fileSystemsCreateOrUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env LIFTRQUMULO_SUBSCRIPTION_ID="" LIFTRQUMULO_RESOURCE_GROUP="" node dist/fileSystemsCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[filesystemscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsCreateOrUpdateSample.ts -[filesystemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsDeleteSample.ts -[filesystemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsGetSample.ts -[filesystemslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsListByResourceGroupSample.ts -[filesystemslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsListBySubscriptionSample.ts -[filesystemsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsUpdateSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/operationsListSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-qumulo?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-qumulo/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/package.json b/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/package.json deleted file mode 100644 index a7ea211f1507..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-qumulo-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=18.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/liftrqumulo/arm-qumulo" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-qumulo", - "dependencies": { - "@azure/arm-qumulo": "latest", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.7.2", - "rimraf": "latest" - } -} diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/sample.env b/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# 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-qumulo/samples/v1/typescript/src/fileSystemsCreateOrUpdateSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsCreateOrUpdateSample.ts deleted file mode 100644 index 018e7cda3087..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsCreateOrUpdateSample.ts +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { FileSystemResource, QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a FileSystemResource - * - * @summary Create a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_CreateOrUpdate_MaximumSet_Gen.json - */ -async function fileSystemsCreateOrUpdateMaximumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "nauwwbfoqehgbhdsmkewoboyxeqg"; - const resource: FileSystemResource = { - adminPassword: "ekceujoecaashtjlsgcymnrdozk", - availabilityZone: "maseyqhlnhoiwbabcqabtedbjpip", - clusterLoginUrl: "jjqhgevy", - delegatedSubnetId: "neqctctqdmjezfgt", - identity: { type: "None", userAssignedIdentities: { key4522: {} } }, - initialCapacity: 9, - location: "przdlsmlzsszphnixq", - marketplaceDetails: { - marketplaceSubscriptionId: "ujrcqvxfnhxxheoth", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "eiyhbmpwgezcmzrrfoiskuxlcvwojf", - planId: "x", - publisherId: "wfmokfdjbwpjhz" - }, - privateIPs: ["kslguxrwbwkrj"], - provisioningState: "Accepted", - storageSku: "Standard", - tags: { key6565: "cgdhmupta" }, - userDetails: { email: "viptslwulnpaupfljvnjeq" } - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginCreateOrUpdateAndWait( - resourceGroupName, - fileSystemName, - resource - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a FileSystemResource - * - * @summary Create a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_CreateOrUpdate_MinimumSet_Gen.json - */ -async function fileSystemsCreateOrUpdateMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaaaaaaaaaaaaaaaaaaa"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgopenapi"; - const fileSystemName = "aaaaaaaa"; - const resource: FileSystemResource = { - adminPassword: "ekceujoecaashtjlsgcymnrdozk", - delegatedSubnetId: "aaaaaaaaaa", - initialCapacity: 9, - location: "aaaaaaaaaaaaaaaaaaaaaaaaa", - marketplaceDetails: { - marketplaceSubscriptionId: "aaaaaaaaaaaaa", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "aaaaaaaaaaaaaaaaaaaaaaaaa", - planId: "aaaaaa", - publisherId: "aa" - }, - provisioningState: "Accepted", - storageSku: "Standard", - userDetails: { email: "viptslwulnpaupfljvnjeq" } - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginCreateOrUpdateAndWait( - resourceGroupName, - fileSystemName, - resource - ); - console.log(result); -} - -async function main() { - fileSystemsCreateOrUpdateMaximumSetGen(); - fileSystemsCreateOrUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsDeleteSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsDeleteSample.ts deleted file mode 100644 index f00859b84576..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsDeleteSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a FileSystemResource - * - * @summary Delete a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Delete_MaximumSet_Gen.json - */ -async function fileSystemsDeleteMaximumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "nauwwbfoqehgbhdsmkewoboyxeqg"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginDeleteAndWait( - resourceGroupName, - fileSystemName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a FileSystemResource - * - * @summary Delete a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Delete_MinimumSet_Gen.json - */ -async function fileSystemsDeleteMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "nauwwbfoqehgbhdsmkewoboyxeqg"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginDeleteAndWait( - resourceGroupName, - fileSystemName - ); - console.log(result); -} - -async function main() { - fileSystemsDeleteMaximumSetGen(); - fileSystemsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsGetSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsGetSample.ts deleted file mode 100644 index 6a2f0ccdc458..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsGetSample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a FileSystemResource - * - * @summary Get a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Get_MaximumSet_Gen.json - */ -async function fileSystemsGetMaximumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "nauwwbfoqehgbhdsmkewoboyxeqg"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.get( - resourceGroupName, - fileSystemName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a FileSystemResource - * - * @summary Get a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Get_MinimumSet_Gen.json - */ -async function fileSystemsGetMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.get( - resourceGroupName, - fileSystemName - ); - console.log(result); -} - -async function main() { - fileSystemsGetMaximumSetGen(); - fileSystemsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsListByResourceGroupSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsListByResourceGroupSample.ts deleted file mode 100644 index 5dd9778c9c55..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsListByResourceGroupSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List FileSystemResource resources by resource group - * - * @summary List FileSystemResource resources by resource group - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_ListByResourceGroup_MaximumSet_Gen.json - */ -async function fileSystemsListByResourceGroupMaximumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List FileSystemResource resources by resource group - * - * @summary List FileSystemResource resources by resource group - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_ListByResourceGroup_MinimumSet_Gen.json - */ -async function fileSystemsListByResourceGroupMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - fileSystemsListByResourceGroupMaximumSetGen(); - fileSystemsListByResourceGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsListBySubscriptionSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsListBySubscriptionSample.ts deleted file mode 100644 index 4d3a688212b6..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsListBySubscriptionSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List FileSystemResource resources by subscription ID - * - * @summary List FileSystemResource resources by subscription ID - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_ListBySubscription_MaximumSet_Gen.json - */ -async function fileSystemsListBySubscriptionMaximumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List FileSystemResource resources by subscription ID - * - * @summary List FileSystemResource resources by subscription ID - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_ListBySubscription_MinimumSet_Gen.json - */ -async function fileSystemsListBySubscriptionMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - fileSystemsListBySubscriptionMaximumSetGen(); - fileSystemsListBySubscriptionMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsUpdateSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsUpdateSample.ts deleted file mode 100644 index d08ae61e706a..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/fileSystemsUpdateSample.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { FileSystemResourceUpdate, QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a FileSystemResource - * - * @summary Update a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Update_MaximumSet_Gen.json - */ -async function fileSystemsUpdateMaximumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "ulseeqylxb"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "nauwwbfoqehgbhdsmkewoboyxeqg"; - const properties: FileSystemResourceUpdate = { - identity: { type: "None", userAssignedIdentities: { key4522: {} } }, - properties: { - clusterLoginUrl: "adabmuthwrbjshzfbo", - delegatedSubnetId: "vjfirtaljehawmflyfianw", - marketplaceDetails: { - marketplaceSubscriptionId: "ujrcqvxfnhxxheoth", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "eiyhbmpwgezcmzrrfoiskuxlcvwojf", - planId: "x", - publisherId: "wfmokfdjbwpjhz" - }, - privateIPs: ["eugjqbaoucgjsopzfrq"], - userDetails: { email: "aa" } - }, - tags: { key7534: "jsgqvqbagquvxowbrkanyhzvo" } - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.update( - resourceGroupName, - fileSystemName, - properties - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a FileSystemResource - * - * @summary Update a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/FileSystems_Update_MinimumSet_Gen.json - */ -async function fileSystemsUpdateMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "aaaaaaaaaaaaaaaaa"; - const properties: FileSystemResourceUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.update( - resourceGroupName, - fileSystemName, - properties - ); - console.log(result); -} - -async function main() { - fileSystemsUpdateMaximumSetGen(); - fileSystemsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/operationsListSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/operationsListSample.ts deleted file mode 100644 index adc694708333..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsListMaximumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2022-10-12/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsListMaximumSetGen(); - operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/tsconfig.json b/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v1/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/README.md b/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/README.md deleted file mode 100644 index a56904cd7ea2..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [fileSystemsCreateOrUpdateSample.js][filesystemscreateorupdatesample] | Create a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_CreateOrUpdate_MaximumSet_Gen.json | -| [fileSystemsDeleteSample.js][filesystemsdeletesample] | Delete a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Delete_MaximumSet_Gen.json | -| [fileSystemsGetSample.js][filesystemsgetsample] | Get a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Get_MaximumSet_Gen.json | -| [fileSystemsListByResourceGroupSample.js][filesystemslistbyresourcegroupsample] | List FileSystemResource resources by resource group x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListByResourceGroup_MaximumSet_Gen.json | -| [fileSystemsListBySubscriptionSample.js][filesystemslistbysubscriptionsample] | List FileSystemResource resources by subscription ID x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListBySubscription_MaximumSet_Gen.json | -| [fileSystemsUpdateSample.js][filesystemsupdatesample] | Update a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Update_MaximumSet_Gen.json | -| [operationsListSample.js][operationslistsample] | List the operations for the provider x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/Operations_List_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node fileSystemsCreateOrUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env LIFTRQUMULO_SUBSCRIPTION_ID="" LIFTRQUMULO_RESOURCE_GROUP="" node fileSystemsCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[filesystemscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsCreateOrUpdateSample.js -[filesystemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsDeleteSample.js -[filesystemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsGetSample.js -[filesystemslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsListByResourceGroupSample.js -[filesystemslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsListBySubscriptionSample.js -[filesystemsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsUpdateSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/operationsListSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-qumulo?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-qumulo/README.md diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsCreateOrUpdateSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsCreateOrUpdateSample.js deleted file mode 100644 index 1ea7c27018ce..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsCreateOrUpdateSample.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a FileSystemResource - * - * @summary Create a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_CreateOrUpdate_MaximumSet_Gen.json - */ -async function fileSystemsCreateOrUpdate() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "hfcmtgaes"; - const resource = { - adminPassword: "fakeTestSecretPlaceholder", - availabilityZone: "eqdvbdiuwmhhzqzmksmwllpddqquwt", - clusterLoginUrl: "ykaynsjvhihdthkkvvodjrgc", - delegatedSubnetId: "jykmxrf", - identity: { type: "None", userAssignedIdentities: { key7679: {} } }, - location: "pnb", - marketplaceDetails: { - marketplaceSubscriptionId: "xaqtkloiyovmexqhn", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "s", - planId: "fwtpz", - publisherId: "czxcfrwodazyaft", - termUnit: "cfwwczmygsimcyvoclcw", - }, - privateIPs: ["gzken"], - storageSku: "yhyzby", - tags: { key7090: "rurrdiaqp" }, - userDetails: { email: "aqsnzyroo" }, - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginCreateOrUpdateAndWait( - resourceGroupName, - fileSystemName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a FileSystemResource - * - * @summary Create a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_CreateOrUpdate_MinimumSet_Gen.json - */ -async function fileSystemsCreateOrUpdateMinimumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaaaaaaaaaaaaaaaaaaa"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgopenapi"; - const fileSystemName = "aaaaaaaa"; - const resource = { - adminPassword: "fakeTestSecretPlaceholder", - delegatedSubnetId: "aaaaaaaaaa", - location: "aaaaaaaaaaaaaaaaaaaaaaaaa", - marketplaceDetails: { - marketplaceSubscriptionId: "aaaaaaaaaaaaa", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "aaaaaaaaaaaaaaaaaaaaaaaaa", - planId: "aaaaaa", - }, - storageSku: "Standard", - userDetails: { email: "viptslwulnpaupfljvnjeq" }, - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginCreateOrUpdateAndWait( - resourceGroupName, - fileSystemName, - resource, - ); - console.log(result); -} - -async function main() { - fileSystemsCreateOrUpdate(); - fileSystemsCreateOrUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsDeleteSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsDeleteSample.js deleted file mode 100644 index 31b30a15a99a..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsDeleteSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a FileSystemResource - * - * @summary Delete a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Delete_MaximumSet_Gen.json - */ -async function fileSystemsDelete() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "xoschzkccroahrykedlvbbnsddq"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginDeleteAndWait(resourceGroupName, fileSystemName); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a FileSystemResource - * - * @summary Delete a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Delete_MinimumSet_Gen.json - */ -async function fileSystemsDeleteMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "jgtskkiplquyrlkaxvhdg"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginDeleteAndWait(resourceGroupName, fileSystemName); - console.log(result); -} - -async function main() { - fileSystemsDelete(); - fileSystemsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsGetSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsGetSample.js deleted file mode 100644 index 36de0a3c73d2..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsGetSample.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a FileSystemResource - * - * @summary Get a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Get_MaximumSet_Gen.json - */ -async function fileSystemsGet() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "sihbehcisdqtqqyfiewiiaphgh"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.get(resourceGroupName, fileSystemName); - console.log(result); -} - -/** - * This sample demonstrates how to Get a FileSystemResource - * - * @summary Get a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Get_MinimumSet_Gen.json - */ -async function fileSystemsGetMinimumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.get(resourceGroupName, fileSystemName); - console.log(result); -} - -async function main() { - fileSystemsGet(); - fileSystemsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsListByResourceGroupSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsListByResourceGroupSample.js deleted file mode 100644 index b70c0df7855c..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsListByResourceGroupSample.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List FileSystemResource resources by resource group - * - * @summary List FileSystemResource resources by resource group - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListByResourceGroup_MaximumSet_Gen.json - */ -async function fileSystemsListByResourceGroup() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List FileSystemResource resources by resource group - * - * @summary List FileSystemResource resources by resource group - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListByResourceGroup_MinimumSet_Gen.json - */ -async function fileSystemsListByResourceGroupMinimumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - fileSystemsListByResourceGroup(); - fileSystemsListByResourceGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsListBySubscriptionSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsListBySubscriptionSample.js deleted file mode 100644 index 19d2b17845c6..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsListBySubscriptionSample.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List FileSystemResource resources by subscription ID - * - * @summary List FileSystemResource resources by subscription ID - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListBySubscription_MaximumSet_Gen.json - */ -async function fileSystemsListBySubscription() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List FileSystemResource resources by subscription ID - * - * @summary List FileSystemResource resources by subscription ID - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListBySubscription_MinimumSet_Gen.json - */ -async function fileSystemsListBySubscriptionMinimumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - fileSystemsListBySubscription(); - fileSystemsListBySubscriptionMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsUpdateSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsUpdateSample.js deleted file mode 100644 index b21fe1abb08c..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/fileSystemsUpdateSample.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a FileSystemResource - * - * @summary Update a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Update_MaximumSet_Gen.json - */ -async function fileSystemsUpdate() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "ahpixnvykleksjlr"; - const properties = { - identity: { type: "None", userAssignedIdentities: { key7679: {} } }, - properties: { - delegatedSubnetId: "bqaryqsjlackxphpmzffgoqsvm", - marketplaceDetails: { - marketplaceSubscriptionId: "xaqtkloiyovmexqhn", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "s", - planId: "fwtpz", - publisherId: "czxcfrwodazyaft", - termUnit: "cfwwczmygsimcyvoclcw", - }, - userDetails: { email: "aqsnzyroo" }, - }, - tags: { key357: "ztkkvhfia" }, - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.update(resourceGroupName, fileSystemName, properties); - console.log(result); -} - -/** - * This sample demonstrates how to Update a FileSystemResource - * - * @summary Update a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Update_MinimumSet_Gen.json - */ -async function fileSystemsUpdateMinimumSetGen() { - const subscriptionId = process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "aaaaaaaaaaaaaaaaa"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.update(resourceGroupName, fileSystemName, properties); - console.log(result); -} - -async function main() { - fileSystemsUpdate(); - fileSystemsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/operationsListSample.js b/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/operationsListSample.js deleted file mode 100644 index 8d2d110837ea..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/operationsListSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { QumuloStorage } = require("@azure/arm-qumulo"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsList() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); - operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/package.json b/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/package.json deleted file mode 100644 index 20653f75663d..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-qumulo-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/liftrqumulo/arm-qumulo" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-qumulo", - "dependencies": { - "@azure/arm-qumulo": "latest", - "dotenv": "latest", - "@azure/identity": "^4.0.1" - } -} diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/sample.env b/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# 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-qumulo/samples/v2/typescript/README.md b/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/README.md deleted file mode 100644 index b2a80c0a7dc3..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [fileSystemsCreateOrUpdateSample.ts][filesystemscreateorupdatesample] | Create a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_CreateOrUpdate_MaximumSet_Gen.json | -| [fileSystemsDeleteSample.ts][filesystemsdeletesample] | Delete a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Delete_MaximumSet_Gen.json | -| [fileSystemsGetSample.ts][filesystemsgetsample] | Get a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Get_MaximumSet_Gen.json | -| [fileSystemsListByResourceGroupSample.ts][filesystemslistbyresourcegroupsample] | List FileSystemResource resources by resource group x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListByResourceGroup_MaximumSet_Gen.json | -| [fileSystemsListBySubscriptionSample.ts][filesystemslistbysubscriptionsample] | List FileSystemResource resources by subscription ID x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListBySubscription_MaximumSet_Gen.json | -| [fileSystemsUpdateSample.ts][filesystemsupdatesample] | Update a FileSystemResource x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Update_MaximumSet_Gen.json | -| [operationsListSample.ts][operationslistsample] | List the operations for the provider x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/Operations_List_MaximumSet_Gen.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/fileSystemsCreateOrUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env LIFTRQUMULO_SUBSCRIPTION_ID="" LIFTRQUMULO_RESOURCE_GROUP="" node dist/fileSystemsCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[filesystemscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsCreateOrUpdateSample.ts -[filesystemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsDeleteSample.ts -[filesystemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsGetSample.ts -[filesystemslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsListByResourceGroupSample.ts -[filesystemslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsListBySubscriptionSample.ts -[filesystemsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsUpdateSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/operationsListSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-qumulo?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-qumulo/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/package.json b/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/package.json deleted file mode 100644 index a521c75679a2..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-qumulo-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=18.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/liftrqumulo/arm-qumulo" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/liftrqumulo/arm-qumulo", - "dependencies": { - "@azure/arm-qumulo": "latest", - "dotenv": "latest", - "@azure/identity": "^4.0.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.7.2", - "rimraf": "latest" - } -} diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/sample.env b/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# 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-qumulo/samples/v2/typescript/src/fileSystemsCreateOrUpdateSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsCreateOrUpdateSample.ts deleted file mode 100644 index 135350ea4c15..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsCreateOrUpdateSample.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { FileSystemResource, QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a FileSystemResource - * - * @summary Create a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_CreateOrUpdate_MaximumSet_Gen.json - */ -async function fileSystemsCreateOrUpdate() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "hfcmtgaes"; - const resource: FileSystemResource = { - adminPassword: "fakeTestSecretPlaceholder", - availabilityZone: "eqdvbdiuwmhhzqzmksmwllpddqquwt", - clusterLoginUrl: "ykaynsjvhihdthkkvvodjrgc", - delegatedSubnetId: "jykmxrf", - identity: { type: "None", userAssignedIdentities: { key7679: {} } }, - location: "pnb", - marketplaceDetails: { - marketplaceSubscriptionId: "xaqtkloiyovmexqhn", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "s", - planId: "fwtpz", - publisherId: "czxcfrwodazyaft", - termUnit: "cfwwczmygsimcyvoclcw", - }, - privateIPs: ["gzken"], - storageSku: "yhyzby", - tags: { key7090: "rurrdiaqp" }, - userDetails: { email: "aqsnzyroo" }, - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginCreateOrUpdateAndWait( - resourceGroupName, - fileSystemName, - resource, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create a FileSystemResource - * - * @summary Create a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_CreateOrUpdate_MinimumSet_Gen.json - */ -async function fileSystemsCreateOrUpdateMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaaaaaaaaaaaaaaaaaaa"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgopenapi"; - const fileSystemName = "aaaaaaaa"; - const resource: FileSystemResource = { - adminPassword: "fakeTestSecretPlaceholder", - delegatedSubnetId: "aaaaaaaaaa", - location: "aaaaaaaaaaaaaaaaaaaaaaaaa", - marketplaceDetails: { - marketplaceSubscriptionId: "aaaaaaaaaaaaa", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "aaaaaaaaaaaaaaaaaaaaaaaaa", - planId: "aaaaaa", - }, - storageSku: "Standard", - userDetails: { email: "viptslwulnpaupfljvnjeq" }, - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginCreateOrUpdateAndWait( - resourceGroupName, - fileSystemName, - resource, - ); - console.log(result); -} - -async function main() { - fileSystemsCreateOrUpdate(); - fileSystemsCreateOrUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsDeleteSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsDeleteSample.ts deleted file mode 100644 index 6e77bade3149..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsDeleteSample.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a FileSystemResource - * - * @summary Delete a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Delete_MaximumSet_Gen.json - */ -async function fileSystemsDelete() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "xoschzkccroahrykedlvbbnsddq"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginDeleteAndWait( - resourceGroupName, - fileSystemName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Delete a FileSystemResource - * - * @summary Delete a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Delete_MinimumSet_Gen.json - */ -async function fileSystemsDeleteMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "jgtskkiplquyrlkaxvhdg"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.beginDeleteAndWait( - resourceGroupName, - fileSystemName, - ); - console.log(result); -} - -async function main() { - fileSystemsDelete(); - fileSystemsDeleteMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsGetSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsGetSample.ts deleted file mode 100644 index aa1f036b3f47..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsGetSample.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a FileSystemResource - * - * @summary Get a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Get_MaximumSet_Gen.json - */ -async function fileSystemsGet() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "sihbehcisdqtqqyfiewiiaphgh"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.get( - resourceGroupName, - fileSystemName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Get a FileSystemResource - * - * @summary Get a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Get_MinimumSet_Gen.json - */ -async function fileSystemsGetMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "aaaaaaaaaaaaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.get( - resourceGroupName, - fileSystemName, - ); - console.log(result); -} - -async function main() { - fileSystemsGet(); - fileSystemsGetMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsListByResourceGroupSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsListByResourceGroupSample.ts deleted file mode 100644 index 220c3a1195ec..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsListByResourceGroupSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List FileSystemResource resources by resource group - * - * @summary List FileSystemResource resources by resource group - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListByResourceGroup_MaximumSet_Gen.json - */ -async function fileSystemsListByResourceGroup() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List FileSystemResource resources by resource group - * - * @summary List FileSystemResource resources by resource group - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListByResourceGroup_MinimumSet_Gen.json - */ -async function fileSystemsListByResourceGroupMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - fileSystemsListByResourceGroup(); - fileSystemsListByResourceGroupMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsListBySubscriptionSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsListBySubscriptionSample.ts deleted file mode 100644 index b9cffe2047d7..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsListBySubscriptionSample.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List FileSystemResource resources by subscription ID - * - * @summary List FileSystemResource resources by subscription ID - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListBySubscription_MaximumSet_Gen.json - */ -async function fileSystemsListBySubscription() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List FileSystemResource resources by subscription ID - * - * @summary List FileSystemResource resources by subscription ID - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_ListBySubscription_MinimumSet_Gen.json - */ -async function fileSystemsListBySubscriptionMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.fileSystems.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - fileSystemsListBySubscription(); - fileSystemsListBySubscriptionMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsUpdateSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsUpdateSample.ts deleted file mode 100644 index e2d2a3c034f5..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/fileSystemsUpdateSample.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { FileSystemResourceUpdate, QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a FileSystemResource - * - * @summary Update a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Update_MaximumSet_Gen.json - */ -async function fileSystemsUpdate() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "382E8C7A-AC80-4D70-8580-EFE99537B9B7"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "ahpixnvykleksjlr"; - const properties: FileSystemResourceUpdate = { - identity: { type: "None", userAssignedIdentities: { key7679: {} } }, - properties: { - delegatedSubnetId: "bqaryqsjlackxphpmzffgoqsvm", - marketplaceDetails: { - marketplaceSubscriptionId: "xaqtkloiyovmexqhn", - marketplaceSubscriptionStatus: "PendingFulfillmentStart", - offerId: "s", - planId: "fwtpz", - publisherId: "czxcfrwodazyaft", - termUnit: "cfwwczmygsimcyvoclcw", - }, - userDetails: { email: "aqsnzyroo" }, - }, - tags: { key357: "ztkkvhfia" }, - }; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.update( - resourceGroupName, - fileSystemName, - properties, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Update a FileSystemResource - * - * @summary Update a FileSystemResource - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/FileSystems_Update_MinimumSet_Gen.json - */ -async function fileSystemsUpdateMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || "aaaaaaa"; - const resourceGroupName = - process.env["LIFTRQUMULO_RESOURCE_GROUP"] || "rgQumulo"; - const fileSystemName = "aaaaaaaaaaaaaaaaa"; - const properties: FileSystemResourceUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const result = await client.fileSystems.update( - resourceGroupName, - fileSystemName, - properties, - ); - console.log(result); -} - -async function main() { - fileSystemsUpdate(); - fileSystemsUpdateMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/operationsListSample.ts b/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/operationsListSample.ts deleted file mode 100644 index 25e53deaa673..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { QumuloStorage } from "@azure/arm-qumulo"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/Operations_List_MaximumSet_Gen.json - */ -async function operationsList() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/liftrqumulo/resource-manager/Qumulo.Storage/stable/2024-06-19/examples/Operations_List_MinimumSet_Gen.json - */ -async function operationsListMinimumSetGen() { - const subscriptionId = - process.env["LIFTRQUMULO_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new QumuloStorage(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); - operationsListMinimumSetGen(); -} - -main().catch(console.error); diff --git a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/tsconfig.json b/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/samples/v2/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} diff --git a/sdk/liftrqumulo/arm-qumulo/src/api/fileSystems/index.ts b/sdk/liftrqumulo/arm-qumulo/src/api/fileSystems/index.ts new file mode 100644 index 000000000000..920130b8aa06 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/api/fileSystems/index.ts @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + StorageContext as Client, + FileSystemsCreateOrUpdateOptionalParams, + FileSystemsDeleteOptionalParams, + FileSystemsGetOptionalParams, + FileSystemsListByResourceGroupOptionalParams, + FileSystemsListBySubscriptionOptionalParams, + FileSystemsUpdateOptionalParams, +} from "../index.js"; +import { + FileSystemResource, + fileSystemResourceSerializer, + fileSystemResourceDeserializer, + FileSystemResourceUpdate, + fileSystemResourceUpdateSerializer, + _FileSystemResourceListResult, + _fileSystemResourceListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _fileSystemsGetSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + fileSystemName: string, + options: FileSystemsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems/{fileSystemName}", + subscriptionId, + resourceGroupName, + fileSystemName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _fileSystemsGetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return fileSystemResourceDeserializer(result.body); +} + +/** Get a FileSystemResource */ +export async function fileSystemsGet( + context: Client, + subscriptionId: string, + resourceGroupName: string, + fileSystemName: string, + options: FileSystemsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _fileSystemsGetSend( + context, + subscriptionId, + resourceGroupName, + fileSystemName, + options, + ); + return _fileSystemsGetDeserialize(result); +} + +export function _fileSystemsCreateOrUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + fileSystemName: string, + resource: FileSystemResource, + options: FileSystemsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems/{fileSystemName}", + subscriptionId, + resourceGroupName, + fileSystemName, + ) + .put({ + ...operationOptionsToRequestParameters(options), + body: fileSystemResourceSerializer(resource), + }); +} + +export async function _fileSystemsCreateOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return fileSystemResourceDeserializer(result.body); +} + +/** Create a FileSystemResource */ +export function fileSystemsCreateOrUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + fileSystemName: string, + resource: FileSystemResource, + options: FileSystemsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, FileSystemResource> { + return getLongRunningPoller( + context, + _fileSystemsCreateOrUpdateDeserialize, + ["200", "201"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _fileSystemsCreateOrUpdateSend( + context, + subscriptionId, + resourceGroupName, + fileSystemName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + }, + ) as PollerLike, FileSystemResource>; +} + +export function _fileSystemsUpdateSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + fileSystemName: string, + properties: FileSystemResourceUpdate, + options: FileSystemsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems/{fileSystemName}", + subscriptionId, + resourceGroupName, + fileSystemName, + ) + .patch({ + ...operationOptionsToRequestParameters(options), + body: fileSystemResourceUpdateSerializer(properties), + }); +} + +export async function _fileSystemsUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return fileSystemResourceDeserializer(result.body); +} + +/** Update a FileSystemResource */ +export async function fileSystemsUpdate( + context: Client, + subscriptionId: string, + resourceGroupName: string, + fileSystemName: string, + properties: FileSystemResourceUpdate, + options: FileSystemsUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _fileSystemsUpdateSend( + context, + subscriptionId, + resourceGroupName, + fileSystemName, + properties, + options, + ); + return _fileSystemsUpdateDeserialize(result); +} + +export function _fileSystemsDeleteSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + fileSystemName: string, + options: FileSystemsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems/{fileSystemName}", + subscriptionId, + resourceGroupName, + fileSystemName, + ) + .delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _fileSystemsDeleteDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return; +} + +/** Delete a FileSystemResource */ +export function fileSystemsDelete( + context: Client, + subscriptionId: string, + resourceGroupName: string, + fileSystemName: string, + options: FileSystemsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller( + context, + _fileSystemsDeleteDeserialize, + ["202", "204", "200"], + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _fileSystemsDeleteSend( + context, + subscriptionId, + resourceGroupName, + fileSystemName, + options, + ), + resourceLocationConfig: "location", + }, + ) as PollerLike, void>; +} + +export function _fileSystemsListByResourceGroupSend( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: FileSystemsListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems", + subscriptionId, + resourceGroupName, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _fileSystemsListByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_FileSystemResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _fileSystemResourceListResultDeserializer(result.body); +} + +/** List FileSystemResource resources by resource group */ +export function fileSystemsListByResourceGroup( + context: Client, + subscriptionId: string, + resourceGroupName: string, + options: FileSystemsListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _fileSystemsListByResourceGroupSend( + context, + subscriptionId, + resourceGroupName, + options, + ), + _fileSystemsListByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _fileSystemsListBySubscriptionSend( + context: Client, + subscriptionId: string, + options: FileSystemsListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Qumulo.Storage/fileSystems", + subscriptionId, + ) + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _fileSystemsListBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_FileSystemResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _fileSystemResourceListResultDeserializer(result.body); +} + +/** List FileSystemResource resources by subscription ID */ +export function fileSystemsListBySubscription( + context: Client, + subscriptionId: string, + options: FileSystemsListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _fileSystemsListBySubscriptionSend(context, subscriptionId, options), + _fileSystemsListBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/liftrqumulo/arm-qumulo/src/api/index.ts b/sdk/liftrqumulo/arm-qumulo/src/api/index.ts new file mode 100644 index 000000000000..6a6fef8af798 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/api/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + OperationsListOptionalParams, + FileSystemsGetOptionalParams, + FileSystemsCreateOrUpdateOptionalParams, + FileSystemsUpdateOptionalParams, + FileSystemsDeleteOptionalParams, + FileSystemsListByResourceGroupOptionalParams, + FileSystemsListBySubscriptionOptionalParams, +} from "./options.js"; +export { + createStorage, + StorageContext, + StorageClientOptionalParams, +} from "./storageContext.js"; +export { + fileSystemsGet, + fileSystemsCreateOrUpdate, + fileSystemsUpdate, + fileSystemsDelete, + fileSystemsListByResourceGroup, + fileSystemsListBySubscription, +} from "./fileSystems/index.js"; +export { operationsList } from "./operations/index.js"; diff --git a/sdk/liftrqumulo/arm-qumulo/src/api/operations/index.ts b/sdk/liftrqumulo/arm-qumulo/src/api/operations/index.ts new file mode 100644 index 000000000000..e0921dea53a7 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/api/operations/index.ts @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + StorageContext as Client, + OperationsListOptionalParams, +} from "../index.js"; +import { + _OperationListResult, + _operationListResultDeserializer, + Operation, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _operationsListSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path("/providers/Qumulo.Storage/operations") + .get({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _operationsListDeserialize( + result: PathUncheckedResponse, +): Promise<_OperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + throw createRestError(result); + } + + return _operationListResultDeserializer(result.body); +} + +/** List the operations for the provider */ +export function operationsList( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _operationsListSend(context, options), + _operationsListDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/liftrqumulo/arm-qumulo/src/api/options.ts b/sdk/liftrqumulo/arm-qumulo/src/api/options.ts new file mode 100644 index 000000000000..5b841e20acc7 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/api/options.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface FileSystemsGetOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface FileSystemsCreateOrUpdateOptionalParams + extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface FileSystemsUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface FileSystemsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface FileSystemsListByResourceGroupOptionalParams + extends OperationOptions {} + +/** Optional parameters. */ +export interface FileSystemsListBySubscriptionOptionalParams + extends OperationOptions {} diff --git a/sdk/liftrqumulo/arm-qumulo/src/api/storageContext.ts b/sdk/liftrqumulo/arm-qumulo/src/api/storageContext.ts new file mode 100644 index 000000000000..6f8b6edd4801 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/api/storageContext.ts @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; +import { TokenCredential } from "@azure/core-auth"; + +export interface StorageContext extends Client {} + +/** Optional parameters for the client. */ +export interface StorageClientOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; +} + +export function createStorage( + credential: TokenCredential, + options: StorageClientOptionalParams = {}, +): StorageContext { + const endpointUrl = + options.endpoint ?? options.baseUrl ?? `https://management.azure.com`; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-qumulo/1.0.0-beta.1`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { + scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`], + }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + const apiVersion = options.apiVersion ?? "2024-06-19"; + clientContext.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version")) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return clientContext; +} diff --git a/sdk/liftrqumulo/arm-qumulo/src/classic/fileSystems/index.ts b/sdk/liftrqumulo/arm-qumulo/src/classic/fileSystems/index.ts new file mode 100644 index 000000000000..e27bd7774cca --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/classic/fileSystems/index.ts @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { StorageContext } from "../../api/storageContext.js"; +import { + fileSystemsGet, + fileSystemsCreateOrUpdate, + fileSystemsUpdate, + fileSystemsDelete, + fileSystemsListByResourceGroup, + fileSystemsListBySubscription, +} from "../../api/fileSystems/index.js"; +import { + FileSystemResource, + FileSystemResourceUpdate, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; +import { + FileSystemsGetOptionalParams, + FileSystemsCreateOrUpdateOptionalParams, + FileSystemsUpdateOptionalParams, + FileSystemsDeleteOptionalParams, + FileSystemsListByResourceGroupOptionalParams, + FileSystemsListBySubscriptionOptionalParams, +} from "../../api/options.js"; + +/** Interface representing a FileSystems operations. */ +export interface FileSystemsOperations { + /** Get a FileSystemResource */ + get: ( + resourceGroupName: string, + fileSystemName: string, + options?: FileSystemsGetOptionalParams, + ) => Promise; + /** Create a FileSystemResource */ + createOrUpdate: ( + resourceGroupName: string, + fileSystemName: string, + resource: FileSystemResource, + options?: FileSystemsCreateOrUpdateOptionalParams, + ) => PollerLike, FileSystemResource>; + /** Update a FileSystemResource */ + update: ( + resourceGroupName: string, + fileSystemName: string, + properties: FileSystemResourceUpdate, + options?: FileSystemsUpdateOptionalParams, + ) => Promise; + /** Delete a FileSystemResource */ + delete: ( + resourceGroupName: string, + fileSystemName: string, + options?: FileSystemsDeleteOptionalParams, + ) => PollerLike, void>; + /** List FileSystemResource resources by resource group */ + listByResourceGroup: ( + resourceGroupName: string, + options?: FileSystemsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** List FileSystemResource resources by subscription ID */ + listBySubscription: ( + options?: FileSystemsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getFileSystems( + context: StorageContext, + subscriptionId: string, +) { + return { + get: ( + resourceGroupName: string, + fileSystemName: string, + options?: FileSystemsGetOptionalParams, + ) => + fileSystemsGet( + context, + subscriptionId, + resourceGroupName, + fileSystemName, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + fileSystemName: string, + resource: FileSystemResource, + options?: FileSystemsCreateOrUpdateOptionalParams, + ) => + fileSystemsCreateOrUpdate( + context, + subscriptionId, + resourceGroupName, + fileSystemName, + resource, + options, + ), + update: ( + resourceGroupName: string, + fileSystemName: string, + properties: FileSystemResourceUpdate, + options?: FileSystemsUpdateOptionalParams, + ) => + fileSystemsUpdate( + context, + subscriptionId, + resourceGroupName, + fileSystemName, + properties, + options, + ), + delete: ( + resourceGroupName: string, + fileSystemName: string, + options?: FileSystemsDeleteOptionalParams, + ) => + fileSystemsDelete( + context, + subscriptionId, + resourceGroupName, + fileSystemName, + options, + ), + listByResourceGroup: ( + resourceGroupName: string, + options?: FileSystemsListByResourceGroupOptionalParams, + ) => + fileSystemsListByResourceGroup( + context, + subscriptionId, + resourceGroupName, + options, + ), + listBySubscription: ( + options?: FileSystemsListBySubscriptionOptionalParams, + ) => fileSystemsListBySubscription(context, subscriptionId, options), + }; +} + +export function getFileSystemsOperations( + context: StorageContext, + subscriptionId: string, +): FileSystemsOperations { + return { + ...getFileSystems(context, subscriptionId), + }; +} diff --git a/sdk/liftrqumulo/arm-qumulo/src/classic/index.ts b/sdk/liftrqumulo/arm-qumulo/src/classic/index.ts new file mode 100644 index 000000000000..532dfb11a951 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/classic/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { FileSystemsOperations } from "./fileSystems/index.js"; +export { OperationsOperations } from "./operations/index.js"; diff --git a/sdk/liftrqumulo/arm-qumulo/src/classic/operations/index.ts b/sdk/liftrqumulo/arm-qumulo/src/classic/operations/index.ts new file mode 100644 index 000000000000..83dc476a142c --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/classic/operations/index.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { StorageContext } from "../../api/storageContext.js"; +import { operationsList } from "../../api/operations/index.js"; +import { Operation } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { OperationsListOptionalParams } from "../../api/options.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** List the operations for the provider */ + list: ( + options?: OperationsListOptionalParams, + ) => PagedAsyncIterableIterator; +} + +export function getOperations(context: StorageContext) { + return { + list: (options?: OperationsListOptionalParams) => + operationsList(context, options), + }; +} + +export function getOperationsOperations( + context: StorageContext, +): OperationsOperations { + return { + ...getOperations(context), + }; +} diff --git a/sdk/liftrqumulo/arm-qumulo/src/helpers/serializerHelpers.ts b/sdk/liftrqumulo/arm-qumulo/src/helpers/serializerHelpers.ts new file mode 100644 index 000000000000..4baaac77c8be --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/helpers/serializerHelpers.ts @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export function serializeRecord< + T extends string | number | boolean | Date | null, + R, +>(item: Record): Record; +export function serializeRecord( + item: Record, + serializer: (item: T) => R, +): Record; +export function serializeRecord( + item: Record, + serializer?: (item: T) => R, +): Record { + return Object.keys(item).reduce( + (acc, key) => { + if (isSupportedRecordType(item[key])) { + acc[key] = item[key] as any; + } else if (serializer) { + const value = item[key]; + if (value !== undefined) { + acc[key] = serializer(value); + } + } else { + console.warn(`Don't know how to serialize ${item[key]}`); + acc[key] = item[key] as any; + } + return acc; + }, + {} as Record, + ); +} + +function isSupportedRecordType(t: any) { + return ( + ["number", "string", "boolean", "null"].includes(typeof t) || + t instanceof Date + ); +} diff --git a/sdk/liftrqumulo/arm-qumulo/src/index.ts b/sdk/liftrqumulo/arm-qumulo/src/index.ts index 620407ccea2f..a0abe21bed3a 100644 --- a/sdk/liftrqumulo/arm-qumulo/src/index.ts +++ b/sdk/liftrqumulo/arm-qumulo/src/index.ts @@ -1,13 +1,54 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. -/// -export { getContinuationToken } from "./pagingHelper"; -export * from "./models"; -export { QumuloStorage } from "./qumuloStorage"; -export * from "./operationsInterfaces"; +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; + +export { StorageClient } from "./storageClient.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + FileSystemResource, + FileSystemResourceProperties, + MarketplaceDetails, + KnownMarketplaceSubscriptionStatus, + MarketplaceSubscriptionStatus, + KnownProvisioningState, + ProvisioningState, + UserDetails, + ManagedServiceIdentity, + KnownManagedServiceIdentityType, + ManagedServiceIdentityType, + UserAssignedIdentity, + TrackedResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + FileSystemResourceUpdate, + FileSystemResourceUpdateProperties, + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + KnownVersions, +} from "./models/index.js"; +export { + OperationsListOptionalParams, + FileSystemsGetOptionalParams, + FileSystemsCreateOrUpdateOptionalParams, + FileSystemsUpdateOptionalParams, + FileSystemsDeleteOptionalParams, + FileSystemsListByResourceGroupOptionalParams, + FileSystemsListBySubscriptionOptionalParams, + StorageClientOptionalParams, +} from "./api/index.js"; +export { + FileSystemsOperations, + OperationsOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; diff --git a/sdk/liftrqumulo/arm-qumulo/src/logger.ts b/sdk/liftrqumulo/arm-qumulo/src/logger.ts new file mode 100644 index 000000000000..931f1716c223 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-qumulo"); diff --git a/sdk/liftrqumulo/arm-qumulo/src/lroImpl.ts b/sdk/liftrqumulo/arm-qumulo/src/lroImpl.ts deleted file mode 100644 index 5f88efab981b..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/src/lroImpl.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { AbortSignalLike } from "@azure/abort-controller"; -import { LongRunningOperation, LroResponse } from "@azure/core-lro"; - -export function createLroSpec(inputs: { - sendOperationFn: (args: any, spec: any) => Promise>; - args: Record; - spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record; -}): LongRunningOperation { - const { args, spec, sendOperationFn } = inputs; - return { - requestMethod: spec.httpMethod, - requestPath: spec.path!, - sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: ( - path: string, - options?: { abortSignal?: AbortSignalLike }, - ) => { - const { requestBody, ...restSpec } = spec; - return sendOperationFn(args, { - ...restSpec, - httpMethod: "GET", - path, - abortSignal: options?.abortSignal, - }); - }, - }; -} diff --git a/sdk/liftrqumulo/arm-qumulo/src/models/index.ts b/sdk/liftrqumulo/arm-qumulo/src/models/index.ts index a38e1b22b334..606d1d1a4c1a 100644 --- a/sdk/liftrqumulo/arm-qumulo/src/models/index.ts +++ b/sdk/liftrqumulo/arm-qumulo/src/models/index.ts @@ -1,539 +1,31 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -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; - /** Term Unit */ - termUnit?: 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; -} - -/** 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; -} - -/** Concrete tracked resource types can be created by aliasing this type using a specific property type. */ -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?: string; - /** 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; - /** Availability zone */ - availabilityZone?: string; -} - -/** Defines headers for FileSystems_createOrUpdate operation. */ -export interface FileSystemsCreateOrUpdateHeaders { - /** A link to the status monitor */ - azureAsyncOperation?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** Defines headers for FileSystems_delete operation. */ -export interface FileSystemsDeleteHeaders { - /** A link to the status monitor */ - azureAsyncOperation?: string; - /** The Location header contains the URL where the status of the long running operation can be checked. */ - location?: string; - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; -} - -/** 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 MarketplaceSubscriptionStatus} that the service accepts. */ -export enum KnownMarketplaceSubscriptionStatus { - /** Fulfillment has not started */ - PendingFulfillmentStart = "PendingFulfillmentStart", - /** Marketplace offer is subscribed */ - Subscribed = "Subscribed", - /** Marketplace offer is suspended because of non payment */ - Suspended = "Suspended", - /** Marketplace offer is unsubscribed */ - Unsubscribed = "Unsubscribed", -} - -/** - * Defines values for MarketplaceSubscriptionStatus. \ - * {@link KnownMarketplaceSubscriptionStatus} can be used interchangeably with MarketplaceSubscriptionStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **PendingFulfillmentStart**: Fulfillment has not started \ - * **Subscribed**: Marketplace offer is subscribed \ - * **Suspended**: Marketplace offer is suspended because of non payment \ - * **Unsubscribed**: Marketplace offer is unsubscribed - */ -export type MarketplaceSubscriptionStatus = string; - -/** Known values of {@link ProvisioningState} that the service accepts. */ -export enum KnownProvisioningState { - /** File system resource creation request accepted */ - Accepted = "Accepted", - /** File system resource creation started */ - Creating = "Creating", - /** File system resource is being updated */ - Updating = "Updating", - /** File system resource deletion started */ - Deleting = "Deleting", - /** File system resource creation successful */ - Succeeded = "Succeeded", - /** File system resource creation failed */ - Failed = "Failed", - /** File system resource creation canceled */ - Canceled = "Canceled", - /** File system resource is deleted */ - Deleted = "Deleted", -} - -/** - * Defines values for ProvisioningState. \ - * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Accepted**: File system resource creation request accepted \ - * **Creating**: File system resource creation started \ - * **Updating**: File system resource is being updated \ - * **Deleting**: File system resource deletion started \ - * **Succeeded**: File system resource creation successful \ - * **Failed**: File system resource creation failed \ - * **Canceled**: File system resource creation canceled \ - * **Deleted**: File system resource is deleted - */ -export type ProvisioningState = 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; - -/** 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; -} - -/** Contains response data for the delete operation. */ -export type FileSystemsDeleteResponse = FileSystemsDeleteHeaders; - -/** 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; -} +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + FileSystemResource, + FileSystemResourceProperties, + MarketplaceDetails, + KnownMarketplaceSubscriptionStatus, + MarketplaceSubscriptionStatus, + KnownProvisioningState, + ProvisioningState, + UserDetails, + ManagedServiceIdentity, + KnownManagedServiceIdentityType, + ManagedServiceIdentityType, + UserAssignedIdentity, + TrackedResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + FileSystemResourceUpdate, + FileSystemResourceUpdateProperties, + Operation, + OperationDisplay, + KnownOrigin, + Origin, + KnownActionType, + ActionType, + KnownVersions, +} from "./models.js"; diff --git a/sdk/liftrqumulo/arm-qumulo/src/models/mappers.ts b/sdk/liftrqumulo/arm-qumulo/src/models/mappers.ts deleted file mode 100644 index b427a1d4aa60..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/src/models/mappers.ts +++ /dev/null @@ -1,661 +0,0 @@ -/* - * 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", - type: { - name: "String", - }, - }, - termUnit: { - serializedName: "termUnit", - type: { - name: "String", - }, - }, - marketplaceSubscriptionStatus: { - serializedName: "marketplaceSubscriptionStatus", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -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", - }, - }, - }, - }, -}; - -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: "String", - }, - }, - storageSku: { - serializedName: "properties.storageSku", - type: { - name: "String", - }, - }, - userDetails: { - serializedName: "properties.userDetails", - type: { - name: "Composite", - className: "UserDetails", - }, - }, - delegatedSubnetId: { - serializedName: "properties.delegatedSubnetId", - 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", - type: { - name: "String", - }, - }, - availabilityZone: { - serializedName: "properties.availabilityZone", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const FileSystemsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FileSystemsCreateOrUpdateHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const FileSystemsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FileSystemsDeleteHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; diff --git a/sdk/liftrqumulo/arm-qumulo/src/models/models.ts b/sdk/liftrqumulo/arm-qumulo/src/models/models.ts new file mode 100644 index 000000000000..1010fefd3c5a --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/models/models.ts @@ -0,0 +1,627 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** Concrete tracked resource types can be created by aliasing this type using a specific property type. */ +export interface FileSystemResource extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: FileSystemResourceProperties; + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; +} + +export function fileSystemResourceSerializer(item: FileSystemResource): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : fileSystemResourcePropertiesSerializer(item["properties"]), + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentitySerializer(item["identity"]), + }; +} + +export function fileSystemResourceDeserializer(item: any): FileSystemResource { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : fileSystemResourcePropertiesDeserializer(item["properties"]), + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentityDeserializer(item["identity"]), + }; +} + +/** Properties specific to the Qumulo File System resource */ +export interface FileSystemResourceProperties { + /** Marketplace details */ + marketplaceDetails: MarketplaceDetails; + /** Provisioning State of the resource */ + readonly provisioningState?: ProvisioningState; + /** Storage Sku */ + storageSku: string; + /** 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; + /** Availability zone */ + availabilityZone?: string; +} + +export function fileSystemResourcePropertiesSerializer( + item: FileSystemResourceProperties, +): any { + return { + marketplaceDetails: marketplaceDetailsSerializer( + item["marketplaceDetails"], + ), + storageSku: item["storageSku"], + userDetails: userDetailsSerializer(item["userDetails"]), + delegatedSubnetId: item["delegatedSubnetId"], + clusterLoginUrl: item["clusterLoginUrl"], + privateIPs: !item["privateIPs"] + ? item["privateIPs"] + : item["privateIPs"].map((p: any) => { + return p; + }), + adminPassword: item["adminPassword"], + availabilityZone: item["availabilityZone"], + }; +} + +export function fileSystemResourcePropertiesDeserializer( + item: any, +): FileSystemResourceProperties { + return { + marketplaceDetails: marketplaceDetailsDeserializer( + item["marketplaceDetails"], + ), + provisioningState: item["provisioningState"], + storageSku: item["storageSku"], + userDetails: userDetailsDeserializer(item["userDetails"]), + delegatedSubnetId: item["delegatedSubnetId"], + clusterLoginUrl: item["clusterLoginUrl"], + privateIPs: !item["privateIPs"] + ? item["privateIPs"] + : item["privateIPs"].map((p: any) => { + return p; + }), + adminPassword: item["adminPassword"], + availabilityZone: item["availabilityZone"], + }; +} + +/** 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; + /** Term Unit */ + termUnit?: string; + /** Marketplace subscription status */ + readonly marketplaceSubscriptionStatus?: MarketplaceSubscriptionStatus; +} + +export function marketplaceDetailsSerializer(item: MarketplaceDetails): any { + return { + marketplaceSubscriptionId: item["marketplaceSubscriptionId"], + planId: item["planId"], + offerId: item["offerId"], + publisherId: item["publisherId"], + termUnit: item["termUnit"], + }; +} + +export function marketplaceDetailsDeserializer(item: any): MarketplaceDetails { + return { + marketplaceSubscriptionId: item["marketplaceSubscriptionId"], + planId: item["planId"], + offerId: item["offerId"], + publisherId: item["publisherId"], + termUnit: item["termUnit"], + marketplaceSubscriptionStatus: item["marketplaceSubscriptionStatus"], + }; +} + +/** Marketplace subscription status of the file system resource */ +export enum KnownMarketplaceSubscriptionStatus { + /** Fulfillment has not started */ + PendingFulfillmentStart = "PendingFulfillmentStart", + /** Marketplace offer is subscribed */ + Subscribed = "Subscribed", + /** Marketplace offer is suspended because of non payment */ + Suspended = "Suspended", + /** Marketplace offer is unsubscribed */ + Unsubscribed = "Unsubscribed", +} + +/** + * Marketplace subscription status of the file system resource \ + * {@link KnownMarketplaceSubscriptionStatus} can be used interchangeably with MarketplaceSubscriptionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PendingFulfillmentStart**: Fulfillment has not started \ + * **Subscribed**: Marketplace offer is subscribed \ + * **Suspended**: Marketplace offer is suspended because of non payment \ + * **Unsubscribed**: Marketplace offer is unsubscribed + */ +export type MarketplaceSubscriptionStatus = string; + +/** Provisioning State of the File system resource */ +export enum KnownProvisioningState { + /** File system resource creation request accepted */ + Accepted = "Accepted", + /** File system resource creation started */ + Creating = "Creating", + /** File system resource is being updated */ + Updating = "Updating", + /** File system resource deletion started */ + Deleting = "Deleting", + /** File system resource creation successful */ + Succeeded = "Succeeded", + /** File system resource creation failed */ + Failed = "Failed", + /** File system resource creation canceled */ + Canceled = "Canceled", + /** File system resource is deleted */ + Deleted = "Deleted", +} + +/** + * Provisioning State of the File system resource \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Accepted**: File system resource creation request accepted \ + * **Creating**: File system resource creation started \ + * **Updating**: File system resource is being updated \ + * **Deleting**: File system resource deletion started \ + * **Succeeded**: File system resource creation successful \ + * **Failed**: File system resource creation failed \ + * **Canceled**: File system resource creation canceled \ + * **Deleted**: File system resource is deleted + */ +export type ProvisioningState = string; + +/** User Details of Qumulo FileSystem resource */ +export interface UserDetails { + /** User Email */ + email: string; +} + +export function userDetailsSerializer(item: UserDetails): any { + return { email: item["email"] }; +} + +export function userDetailsDeserializer(item: any): UserDetails { + return { + email: item["email"], + }; +} + +/** 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. */ + readonly principalId?: string; + /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */ + readonly tenantId?: string; + /** The type of managed identity assigned to this resource. */ + type: ManagedServiceIdentityType; + /** The identities assigned to this resource by the user. */ + userAssignedIdentities?: Record; +} + +export function managedServiceIdentitySerializer( + item: ManagedServiceIdentity, +): any { + return { + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentityRecordSerializer(item["userAssignedIdentities"]), + }; +} + +export function managedServiceIdentityDeserializer( + item: any, +): ManagedServiceIdentity { + return { + principalId: item["principalId"], + tenantId: item["tenantId"], + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentityRecordDeserializer(item["userAssignedIdentities"]), + }; +} + +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +export enum KnownManagedServiceIdentityType { + /** No managed identity. */ + None = "None", + /** System assigned managed identity. */ + SystemAssigned = "SystemAssigned", + /** User assigned managed identity. */ + UserAssigned = "UserAssigned", + /** System and user assigned managed identity. */ + "SystemAssigned,UserAssigned" = "SystemAssigned,UserAssigned", +} + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). \ + * {@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**: No managed identity. \ + * **SystemAssigned**: System assigned managed identity. \ + * **UserAssigned**: User assigned managed identity. \ + * **SystemAssigned,UserAssigned**: System and user assigned managed identity. + */ +export type ManagedServiceIdentityType = string; + +export function userAssignedIdentityRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] + ? item[key] + : userAssignedIdentitySerializer(item[key]); + }); + return result; +} + +export function userAssignedIdentityRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] + ? item[key] + : userAssignedIdentityDeserializer(item[key]); + }); + return result; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** The principal ID of the assigned identity. */ + readonly principalId?: string; + /** The client ID of the assigned identity. */ + readonly clientId?: string; +} + +export function userAssignedIdentitySerializer( + item: UserAssignedIdentity, +): any { + return item; +} + +export function userAssignedIdentityDeserializer( + item: any, +): UserAssignedIdentity { + return { + principalId: item["principalId"], + clientId: item["clientId"], + }; +} + +/** 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?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer(item: TrackedResource): any { + return { tags: item["tags"], location: item["location"] }; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: item["tags"], + location: item["location"], + }; +} + +/** 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} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource): any { + return item; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["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; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] + ? item["createdAt"] + : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@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**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** 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?: Record; + /** The updatable properties of the FileSystemResource. */ + properties?: FileSystemResourceUpdateProperties; +} + +export function fileSystemResourceUpdateSerializer( + item: FileSystemResourceUpdate, +): any { + return { + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentitySerializer(item["identity"]), + tags: item["tags"], + properties: !item["properties"] + ? item["properties"] + : fileSystemResourceUpdatePropertiesSerializer(item["properties"]), + }; +} + +/** 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; +} + +export function fileSystemResourceUpdatePropertiesSerializer( + item: FileSystemResourceUpdateProperties, +): any { + return { + marketplaceDetails: !item["marketplaceDetails"] + ? item["marketplaceDetails"] + : marketplaceDetailsSerializer(item["marketplaceDetails"]), + userDetails: !item["userDetails"] + ? item["userDetails"] + : userDetailsSerializer(item["userDetails"]), + delegatedSubnetId: item["delegatedSubnetId"], + }; +} + +/** 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; +} + +export function _fileSystemResourceListResultDeserializer( + item: any, +): _FileSystemResourceListResult { + return { + value: fileSystemResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function fileSystemResourceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return fileSystemResourceSerializer(item); + }); +} + +export function fileSystemResourceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return fileSystemResourceDeserializer(item); + }); +} + +/** 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 { + /** The Operation items on this page */ + value: Operation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _operationListResultDeserializer( + item: any, +): _OperationListResult { + return { + value: operationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function operationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationDeserializer(item); + }); +} + +/** 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" */ + readonly name?: string; + /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ + 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" */ + readonly origin?: Origin; + /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ + readonly actionType?: ActionType; +} + +export function operationDeserializer(item: any): Operation { + return { + name: item["name"], + isDataAction: item["isDataAction"], + display: !item["display"] + ? item["display"] + : operationDisplayDeserializer(item["display"]), + origin: item["origin"], + actionType: item["actionType"], + }; +} + +/** Localized display information for and operation. */ +export interface OperationDisplay { + /** The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ + readonly provider?: string; + /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ + readonly resource?: string; + /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ + readonly operation?: string; + /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ + readonly description?: string; +} + +export function operationDisplayDeserializer(item: any): OperationDisplay { + return { + provider: item["provider"], + resource: item["resource"], + operation: item["operation"], + description: item["description"], + }; +} + +/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ +export enum KnownOrigin { + /** Indicates the operation is initiated by a user. */ + user = "user", + /** Indicates the operation is initiated by a system. */ + system = "system", + /** Indicates the operation is initiated by a user or system. */ + "user,system" = "user,system", +} + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" \ + * {@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**: Indicates the operation is initiated by a user. \ + * **system**: Indicates the operation is initiated by a system. \ + * **user,system**: Indicates the operation is initiated by a user or system. + */ +export type Origin = string; + +/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +export enum KnownActionType { + /** Actions are for internal-only APIs. */ + Internal = "Internal", +} + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. \ + * {@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**: Actions are for internal-only APIs. + */ +export type ActionType = string; + +/** The available API versions. */ +export enum KnownVersions { + /** The 2024-06-19 Stable API version. */ + v2_stable = "2024-06-19", +} diff --git a/sdk/liftrqumulo/arm-qumulo/src/models/parameters.ts b/sdk/liftrqumulo/arm-qumulo/src/models/parameters.ts deleted file mode 100644 index 8e4e6777dae0..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/src/models/parameters.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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: "2024-06-19", - 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: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9_-]*$"), - }, - 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-qumulo/src/operations/fileSystems.ts b/sdk/liftrqumulo/arm-qumulo/src/operations/fileSystems.ts deleted file mode 100644 index 8e03fc76f9a4..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/src/operations/fileSystems.ts +++ /dev/null @@ -1,643 +0,0 @@ -/* - * 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 { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; -import { - FileSystemResource, - FileSystemsListBySubscriptionNextOptionalParams, - FileSystemsListBySubscriptionOptionalParams, - FileSystemsListBySubscriptionResponse, - FileSystemsListByResourceGroupNextOptionalParams, - FileSystemsListByResourceGroupOptionalParams, - FileSystemsListByResourceGroupResponse, - FileSystemsGetOptionalParams, - FileSystemsGetResponse, - FileSystemsCreateOrUpdateOptionalParams, - FileSystemsCreateOrUpdateResponse, - FileSystemResourceUpdate, - FileSystemsUpdateOptionalParams, - FileSystemsUpdateResponse, - FileSystemsDeleteOptionalParams, - FileSystemsDeleteResponse, - 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< - SimplePollerLike< - OperationState, - FileSystemsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, fileSystemName, resource, options }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - FileSystemsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "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< - SimplePollerLike< - OperationState, - FileSystemsDeleteResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = 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 = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, fileSystemName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - FileSystemsDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - 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: { - headersMapper: Mappers.FileSystemsDeleteHeaders, - }, - 201: { - headersMapper: Mappers.FileSystemsDeleteHeaders, - }, - 202: { - headersMapper: Mappers.FileSystemsDeleteHeaders, - }, - 204: { - headersMapper: Mappers.FileSystemsDeleteHeaders, - }, - 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-qumulo/src/operations/index.ts b/sdk/liftrqumulo/arm-qumulo/src/operations/index.ts deleted file mode 100644 index 9283434b5869..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/src/operations/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * 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-qumulo/src/operations/operations.ts b/sdk/liftrqumulo/arm-qumulo/src/operations/operations.ts deleted file mode 100644 index afebfe3e50c0..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/src/operations/operations.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * 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-qumulo/src/operationsInterfaces/fileSystems.ts b/sdk/liftrqumulo/arm-qumulo/src/operationsInterfaces/fileSystems.ts deleted file mode 100644 index 503ff450aebf..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/src/operationsInterfaces/fileSystems.ts +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - FileSystemResource, - FileSystemsListBySubscriptionOptionalParams, - FileSystemsListByResourceGroupOptionalParams, - FileSystemsGetOptionalParams, - FileSystemsGetResponse, - FileSystemsCreateOrUpdateOptionalParams, - FileSystemsCreateOrUpdateResponse, - FileSystemResourceUpdate, - FileSystemsUpdateOptionalParams, - FileSystemsUpdateResponse, - FileSystemsDeleteOptionalParams, - FileSystemsDeleteResponse, -} 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< - SimplePollerLike< - OperationState, - 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< - SimplePollerLike< - OperationState, - FileSystemsDeleteResponse - > - >; - /** - * 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-qumulo/src/operationsInterfaces/index.ts b/sdk/liftrqumulo/arm-qumulo/src/operationsInterfaces/index.ts deleted file mode 100644 index 9283434b5869..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/src/operationsInterfaces/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * 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-qumulo/src/operationsInterfaces/operations.ts b/sdk/liftrqumulo/arm-qumulo/src/operationsInterfaces/operations.ts deleted file mode 100644 index 251f5f582e64..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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-qumulo/src/pagingHelper.ts b/sdk/liftrqumulo/arm-qumulo/src/pagingHelper.ts deleted file mode 100644 index 205cccc26592..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/src/pagingHelper.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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-qumulo/src/qumuloStorage.ts b/sdk/liftrqumulo/arm-qumulo/src/qumuloStorage.ts deleted file mode 100644 index 87fcdfdfcd9d..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/src/qumuloStorage.ts +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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-qumulo/2.0.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 || "2024-06-19"; - 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-qumulo/src/restorePollerHelpers.ts b/sdk/liftrqumulo/arm-qumulo/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..90f8197d396c --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/restorePollerHelpers.ts @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { StorageClient } from "./storageClient.js"; +import { + _fileSystemsCreateOrUpdateDeserialize, + _fileSystemsDeleteDeserialize, +} from "./api/fileSystems/index.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import { + OperationOptions, + PathUncheckedResponse, +} from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { + PollerLike, + OperationState, + deserializeState, + ResourceLocationConfig, +} from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: StorageClient, + serializedState: string, + sourceOperation: ( + ...args: any[] + ) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + }, + ); +} + +interface DeserializationHelper { + deserializer: Function; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems/{fileSystemName}": + { + deserializer: _fileSystemsCreateOrUpdateDeserialize, + expectedStatuses: ["200", "201"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Qumulo.Storage/fileSystems/{fileSystemName}": + { + deserializer: _fileSystemsDeleteDeserialize, + expectedStatuses: ["202", "204", "200"], + }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- + ) { + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}`, + ).test(pathParts[j] || ""); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/liftrqumulo/arm-qumulo/src/static-helpers/pagingHelpers.ts b/sdk/liftrqumulo/arm-qumulo/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..97a81e74e301 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + Client, + createRestError, + PathUncheckedResponse, +} from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator< + TElement, + TPage, + TPageSettings + >; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: ( + settings?: TPageSettings, + ) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: ( + pageLink?: string, + ) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: ( + settings?: TPageSettings, + ) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + const result = + pageLink === undefined + ? await getInitialResponse() + : await client.pathUnchecked(pageLink).get(); + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator( + pagedResult, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator< + TElement, + TPage, + TPageSettings extends PageSettings, +>( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator< + TElement, + TPage, + TPageSettings extends PageSettings, +>( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage( + pageLink ?? pagedResult.firstPageLink, + ); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if ( + typeof nextLink !== "string" && + typeof nextLink !== "undefined" && + nextLink !== null + ) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest( + response: PathUncheckedResponse, + expectedStatuses: string[], +): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/liftrqumulo/arm-qumulo/src/static-helpers/pollingHelpers.ts b/sdk/liftrqumulo/arm-qumulo/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..2edbf783be53 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + createHttpPoller, + OperationResponse, +} from "@azure/core-lro"; + +import { + Client, + PathUncheckedResponse, + createRestError, +} from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; +} +export function getLongRunningPoller< + TResponse extends PathUncheckedResponse, + TResult = void, +>( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error( + "Either restoreFrom or getInitialResponse must be specified", + ); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error( + "getInitialResponse is required when initializing a new poller", + ); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client.pathUnchecked(path).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/liftrqumulo/arm-qumulo/src/storageClient.ts b/sdk/liftrqumulo/arm-qumulo/src/storageClient.ts new file mode 100644 index 000000000000..f2821530e9a0 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/src/storageClient.ts @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + getOperationsOperations, + OperationsOperations, +} from "./classic/operations/index.js"; +import { + getFileSystemsOperations, + FileSystemsOperations, +} from "./classic/fileSystems/index.js"; +import { + createStorage, + StorageContext, + StorageClientOptionalParams, +} from "./api/index.js"; +import { Pipeline } from "@azure/core-rest-pipeline"; +import { TokenCredential } from "@azure/core-auth"; + +export { StorageClientOptionalParams } from "./api/storageContext.js"; + +export class StorageClient { + private _client: StorageContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + constructor( + credential: TokenCredential, + subscriptionId: string, + options: StorageClientOptionalParams = {}, + ) { + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createStorage(credential, { + ...options, + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.operations = getOperationsOperations(this._client); + this.fileSystems = getFileSystemsOperations(this._client, subscriptionId); + } + + /** The operation groups for Operations */ + public readonly operations: OperationsOperations; + /** The operation groups for FileSystems */ + public readonly fileSystems: FileSystemsOperations; +} diff --git a/sdk/liftrqumulo/arm-qumulo/test/liftrqumulo_operations_test.spec.ts b/sdk/liftrqumulo/arm-qumulo/test/liftrqumulo_operations_test.spec.ts deleted file mode 100644 index 21bc56e761e6..000000000000 --- a/sdk/liftrqumulo/arm-qumulo/test/liftrqumulo_operations_test.spec.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { QumuloStorage } from "../src/qumuloStorage"; - -const replaceableVariables: Record = { - SUBSCRIPTION_ID: "azure_subscription_id" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("liftrqumulo test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: QumuloStorage; - let location: string; - let resourceGroup: string; - let fileSystemName: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new QumuloStorage(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "myjstest"; - fileSystemName = "myfileSystem"; - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("operation list test", async function () { - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - }); -}) diff --git a/sdk/liftrqumulo/arm-qumulo/test/public/sampleTest.spec.ts b/sdk/liftrqumulo/arm-qumulo/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..d4919ac91ac5 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/test/public/sampleTest.spec.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createRecorder } from "./utils/recordedClient.js"; +import { assert, beforeEach, afterEach, it, describe } from "vitest"; + +describe("My test", () => { + // let recorder: Recorder; + + beforeEach(async function () { + // recorder = await createRecorder(this); + }); + + afterEach(async function () { + // await recorder.stop(); + }); + + it("sample test", async function () { + assert.equal(1, 1); + }); +}); diff --git a/sdk/liftrqumulo/arm-qumulo/test/public/utils/recordedClient.ts b/sdk/liftrqumulo/arm-qumulo/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..6e425fdcfdf9 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/test/public/utils/recordedClient.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + Recorder, + RecorderStartOptions, + VitestTestContext, +} from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export async function createRecorder( + context: VitestTestContext, +): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/liftrqumulo/arm-qumulo/tsconfig.browser.config.json b/sdk/liftrqumulo/arm-qumulo/tsconfig.browser.config.json new file mode 100644 index 000000000000..091177fcb991 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/tsconfig.browser.config.json @@ -0,0 +1,10 @@ +{ + "extends": "./.tshy/build.json", + "include": ["src/**/*.ts", "src/**/*.mts", "test/**/*.spec.ts"], + "exclude": ["test/**/node/**/*.ts"], + "compilerOptions": { + "outDir": "./dist-test/browser", + "rootDir": ".", + "skipLibCheck": true + } +} diff --git a/sdk/liftrqumulo/arm-qumulo/tsconfig.json b/sdk/liftrqumulo/arm-qumulo/tsconfig.json index 09305e40c732..72266609583d 100644 --- a/sdk/liftrqumulo/arm-qumulo/tsconfig.json +++ b/sdk/liftrqumulo/arm-qumulo/tsconfig.json @@ -1,33 +1,16 @@ { + "extends": "../../../tsconfig", "compilerOptions": { - "module": "es6", - "moduleResolution": "node", - "strict": true, - "target": "es6", - "sourceMap": true, - "declarationMap": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "forceConsistentCasingInFileNames": true, - "lib": [ - "es6", - "dom" - ], - "declaration": true, - "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-qumulo": [ - "./src/index" - ] - } + "module": "NodeNext", + "moduleResolution": "NodeNext", + "rootDir": ".", + "skipLibCheck": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" - ], - "exclude": [ - "node_modules" + "src/**/*.ts", + "src/**/*.mts", + "src/**/*.cts", + "test/**/*.ts", + "test/**/*.ts" ] -} \ No newline at end of file +} diff --git a/sdk/liftrqumulo/arm-qumulo/tsp-location.yaml b/sdk/liftrqumulo/arm-qumulo/tsp-location.yaml new file mode 100644 index 000000000000..140e4703ba42 --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/liftrqumulo/Qumulo.Storage.Management +commit: 8251abed195b52225b415e0fcbe9872852502d61 +repo: ../azure-rest-api-specs +additionalDirectories: diff --git a/sdk/liftrqumulo/arm-qumulo/vitest.browser.config.ts b/sdk/liftrqumulo/arm-qumulo/vitest.browser.config.ts new file mode 100644 index 000000000000..da68c1d231aa --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/vitest.browser.config.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig } from "vitest/config"; +import { relativeRecordingsPath } from "@azure-tools/test-recorder"; + +process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath(); + +export default defineConfig({ + define: { + "process.env": process.env, + }, + test: { + reporters: ["basic", "junit"], + outputFile: { + junit: "test-results.browser.xml", + }, + browser: { + enabled: true, + headless: true, + name: "chromium", + provider: "playwright", + }, + fakeTimers: { + toFake: ["setTimeout", "Date"], + }, + watch: false, + include: ["dist-test/browser/**/*.spec.js"], + coverage: { + include: ["dist-test/browser/**/*.spec.js"], + provider: "istanbul", + reporter: ["text", "json", "html"], + reportsDirectory: "coverage-browser", + }, + testTimeout: 1200000, + hookTimeout: 1200000, + }, +}); diff --git a/sdk/liftrqumulo/arm-qumulo/vitest.config.ts b/sdk/liftrqumulo/arm-qumulo/vitest.config.ts new file mode 100644 index 000000000000..2cf5d0e02c2e --- /dev/null +++ b/sdk/liftrqumulo/arm-qumulo/vitest.config.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig } from "vitest/config"; +import { relativeRecordingsPath } from "@azure-tools/test-recorder"; + +export default defineConfig({ + test: { + reporters: ["basic", "junit"], + outputFile: { + junit: "test-results.browser.xml", + }, + fakeTimers: { + toFake: ["setTimeout", "Date"], + }, + watch: false, + include: ["test/**/*.spec.ts"], + exclude: ["test/**/browser/*.spec.ts"], + coverage: { + include: ["src/**/*.ts"], + exclude: [ + "src/**/*-browser.mts", + "src/**/*-react-native.mts", + "vitest*.config.ts", + "samples-dev/**/*.ts", + ], + provider: "istanbul", + reporter: ["text", "json", "html"], + reportsDirectory: "coverage", + }, + testTimeout: 1200000, + hookTimeout: 1200000, + }, +}); diff --git a/sdk/liftrqumulo/ci.mgmt.yml b/sdk/liftrqumulo/ci.mgmt.yml index 7ffd2c168db3..ab3e8e284a9b 100644 --- a/sdk/liftrqumulo/ci.mgmt.yml +++ b/sdk/liftrqumulo/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: