From 7ef4e49f334f7b6e38eb8567fb0dab477acee979 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 21 Jan 2025 19:10:52 +0000 Subject: [PATCH] CodeGen from PR 28910 in Azure/azure-rest-api-specs Merge 177c793cbe9bdb428e6025e4b19e006cd3dbb3e3 into a809dd5480dae39870b8094af9e6440591c90281 --- common/config/rush/pnpm-lock.yaml | 41 +- .../arm-storagecache/CHANGELOG.md | 48 +- sdk/storagecache/arm-storagecache/LICENSE | 2 +- sdk/storagecache/arm-storagecache/README.md | 3 +- sdk/storagecache/arm-storagecache/_meta.json | 8 +- .../arm-storagecache/package.json | 104 +-- .../review/arm-storagecache.api.md | 164 +++++ sdk/storagecache/arm-storagecache/sample.env | 5 +- .../amlFilesystemsArchiveSample.ts | 8 +- .../amlFilesystemsCancelArchiveSample.ts | 8 +- .../amlFilesystemsCreateOrUpdateSample.ts | 8 +- .../samples-dev/amlFilesystemsDeleteSample.ts | 8 +- .../samples-dev/amlFilesystemsGetSample.ts | 8 +- ...amlFilesystemsListByResourceGroupSample.ts | 8 +- .../samples-dev/amlFilesystemsListSample.ts | 8 +- .../samples-dev/amlFilesystemsUpdateSample.ts | 8 +- .../samples-dev/ascOperationsGetSample.ts | 8 +- .../samples-dev/ascUsagesListSample.ts | 8 +- .../samples-dev/cachesCreateOrUpdateSample.ts | 10 +- .../samples-dev/cachesDebugInfoSample.ts | 8 +- .../samples-dev/cachesDeleteSample.ts | 8 +- .../samples-dev/cachesFlushSample.ts | 8 +- .../samples-dev/cachesGetSample.ts | 8 +- .../cachesListByResourceGroupSample.ts | 8 +- .../samples-dev/cachesListSample.ts | 8 +- .../cachesPausePrimingJobSample.ts | 8 +- .../cachesResumePrimingJobSample.ts | 8 +- .../cachesSpaceAllocationSample.ts | 8 +- .../cachesStartPrimingJobSample.ts | 8 +- .../samples-dev/cachesStartSample.ts | 8 +- .../samples-dev/cachesStopPrimingJobSample.ts | 8 +- .../samples-dev/cachesStopSample.ts | 8 +- .../samples-dev/cachesUpdateSample.ts | 10 +- .../cachesUpgradeFirmwareSample.ts | 8 +- .../samples-dev/checkAmlFsSubnetsSample.ts | 8 +- .../getRequiredAmlFsSubnetsSizeSample.ts | 8 +- .../importJobsCreateOrUpdateSample.ts | 8 +- .../samples-dev/importJobsDeleteSample.ts | 8 +- .../samples-dev/importJobsGetSample.ts | 8 +- .../importJobsListByAmlFilesystemSample.ts | 8 +- .../samples-dev/importJobsUpdateSample.ts | 8 +- .../samples-dev/operationsListSample.ts | 8 +- .../samples-dev/skusListSample.ts | 8 +- .../samples-dev/storageTargetFlushSample.ts | 8 +- .../storageTargetInvalidateSample.ts | 8 +- .../samples-dev/storageTargetResumeSample.ts | 8 +- .../samples-dev/storageTargetSuspendSample.ts | 8 +- .../storageTargetsCreateOrUpdateSample.ts | 12 +- .../samples-dev/storageTargetsDeleteSample.ts | 8 +- .../storageTargetsDnsRefreshSample.ts | 8 +- .../samples-dev/storageTargetsGetSample.ts | 8 +- .../storageTargetsListByCacheSample.ts | 8 +- .../storageTargetsRestoreDefaultsSample.ts | 8 +- .../samples-dev/usageModelsListSample.ts | 8 +- .../src/amlFilesystemsArchiveSample.ts | 8 +- .../src/amlFilesystemsCancelArchiveSample.ts | 8 +- .../src/amlFilesystemsCreateOrUpdateSample.ts | 8 +- .../src/amlFilesystemsDeleteSample.ts | 8 +- .../typescript/src/amlFilesystemsGetSample.ts | 8 +- ...amlFilesystemsListByResourceGroupSample.ts | 8 +- .../src/amlFilesystemsListSample.ts | 8 +- .../src/amlFilesystemsUpdateSample.ts | 8 +- .../typescript/src/ascOperationsGetSample.ts | 8 +- .../v8/typescript/src/ascUsagesListSample.ts | 8 +- .../src/cachesCreateOrUpdateSample.ts | 10 +- .../typescript/src/cachesDebugInfoSample.ts | 8 +- .../v8/typescript/src/cachesDeleteSample.ts | 8 +- .../v8/typescript/src/cachesFlushSample.ts | 8 +- .../v8/typescript/src/cachesGetSample.ts | 8 +- .../src/cachesListByResourceGroupSample.ts | 8 +- .../v8/typescript/src/cachesListSample.ts | 8 +- .../src/cachesPausePrimingJobSample.ts | 8 +- .../src/cachesResumePrimingJobSample.ts | 8 +- .../src/cachesSpaceAllocationSample.ts | 8 +- .../src/cachesStartPrimingJobSample.ts | 8 +- .../v8/typescript/src/cachesStartSample.ts | 8 +- .../src/cachesStopPrimingJobSample.ts | 8 +- .../v8/typescript/src/cachesStopSample.ts | 8 +- .../v8/typescript/src/cachesUpdateSample.ts | 10 +- .../src/cachesUpgradeFirmwareSample.ts | 8 +- .../typescript/src/checkAmlFsSubnetsSample.ts | 8 +- .../src/getRequiredAmlFsSubnetsSizeSample.ts | 8 +- .../src/importJobsCreateOrUpdateSample.ts | 8 +- .../typescript/src/importJobsDeleteSample.ts | 8 +- .../v8/typescript/src/importJobsGetSample.ts | 8 +- .../importJobsListByAmlFilesystemSample.ts | 8 +- .../typescript/src/importJobsUpdateSample.ts | 8 +- .../v8/typescript/src/operationsListSample.ts | 8 +- .../v8/typescript/src/skusListSample.ts | 8 +- .../src/storageTargetFlushSample.ts | 8 +- .../src/storageTargetInvalidateSample.ts | 8 +- .../src/storageTargetResumeSample.ts | 8 +- .../src/storageTargetSuspendSample.ts | 8 +- .../src/storageTargetsCreateOrUpdateSample.ts | 12 +- .../src/storageTargetsDeleteSample.ts | 8 +- .../src/storageTargetsDnsRefreshSample.ts | 8 +- .../typescript/src/storageTargetsGetSample.ts | 8 +- .../src/storageTargetsListByCacheSample.ts | 8 +- .../storageTargetsRestoreDefaultsSample.ts | 8 +- .../typescript/src/usageModelsListSample.ts | 8 +- .../arm-storagecache/src/index.ts | 8 +- .../arm-storagecache/src/models/index.ts | 311 +++++++- .../arm-storagecache/src/models/mappers.ts | 289 ++++++++ .../arm-storagecache/src/models/parameters.ts | 32 +- .../src/operations/amlFilesystems.ts | 14 +- .../src/operations/ascOperations.ts | 10 +- .../src/operations/ascUsages.ts | 12 +- .../src/operations/autoExportJobs.ts | 687 ++++++++++++++++++ .../arm-storagecache/src/operations/caches.ts | 14 +- .../src/operations/importJobs.ts | 18 +- .../arm-storagecache/src/operations/index.ts | 21 +- .../src/operations/operations.ts | 12 +- .../arm-storagecache/src/operations/skus.ts | 12 +- .../src/operations/storageTargetOperations.ts | 12 +- .../src/operations/storageTargets.ts | 14 +- .../src/operations/usageModels.ts | 12 +- .../operationsInterfaces/amlFilesystems.ts | 2 +- .../src/operationsInterfaces/ascOperations.ts | 2 +- .../src/operationsInterfaces/ascUsages.ts | 2 +- .../operationsInterfaces/autoExportJobs.ts | 172 +++++ .../src/operationsInterfaces/caches.ts | 2 +- .../src/operationsInterfaces/importJobs.ts | 6 +- .../src/operationsInterfaces/index.ts | 21 +- .../src/operationsInterfaces/operations.ts | 2 +- .../src/operationsInterfaces/skus.ts | 2 +- .../storageTargetOperations.ts | 2 +- .../operationsInterfaces/storageTargets.ts | 2 +- .../src/operationsInterfaces/usageModels.ts | 2 +- .../src/storageCacheManagementClient.ts | 18 +- .../arm-storagecache/test/sampleTest.ts | 40 + .../test/storagecache_operations_test.spec.ts | 79 +- .../tsconfig.browser.config.json | 6 + .../arm-storagecache/tsconfig.json | 12 +- .../arm-storagecache/tsconfig.samples.json | 10 + .../arm-storagecache/tsconfig.src.json | 3 + .../arm-storagecache/tsconfig.test.json | 6 + .../arm-storagecache/vitest.browser.config.ts | 17 + .../arm-storagecache/vitest.config.ts | 16 + .../arm-storagecache/vitest.esm.config.ts | 12 + 139 files changed, 2312 insertions(+), 729 deletions(-) create mode 100644 sdk/storagecache/arm-storagecache/src/operations/autoExportJobs.ts create mode 100644 sdk/storagecache/arm-storagecache/src/operationsInterfaces/autoExportJobs.ts create mode 100644 sdk/storagecache/arm-storagecache/test/sampleTest.ts create mode 100644 sdk/storagecache/arm-storagecache/tsconfig.browser.config.json create mode 100644 sdk/storagecache/arm-storagecache/tsconfig.samples.json create mode 100644 sdk/storagecache/arm-storagecache/tsconfig.src.json create mode 100644 sdk/storagecache/arm-storagecache/tsconfig.test.json create mode 100644 sdk/storagecache/arm-storagecache/vitest.browser.config.ts create mode 100644 sdk/storagecache/arm-storagecache/vitest.config.ts create mode 100644 sdk/storagecache/arm-storagecache/vitest.esm.config.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index ff023c844e1a..520838515df6 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -750,7 +750,7 @@ importers: version: file:projects/arm-storageactions.tgz '@rush-temp/arm-storagecache': specifier: file:./projects/arm-storagecache.tgz - version: file:projects/arm-storagecache.tgz + version: file:projects/arm-storagecache.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.12(@types/node@22.7.9)) '@rush-temp/arm-storageimportexport': specifier: file:./projects/arm-storageimportexport.tgz version: file:projects/arm-storageimportexport.tgz @@ -3461,7 +3461,7 @@ packages: version: 0.0.0 '@rush-temp/arm-storagecache@file:projects/arm-storagecache.tgz': - resolution: {integrity: sha512-k0d7BswwX7slBNI1udId1vryA6pEcrUW1vhOxMCOr8qnTPXpBoCWGpiUgEqWAb7Ij/YbD9xFECxxGCVSU9CGOA==, tarball: file:projects/arm-storagecache.tgz} + resolution: {integrity: sha512-A9VB++AVp5y6f8OkdIpfrJxDd7hY0LCfExYWHBTiBDUhztU1tJq6IJNBkG0nXjoh0Y5SO76P2tT/2nT/kZX5pA==, tarball: file:projects/arm-storagecache.tgz} version: 0.0.0 '@rush-temp/arm-storageimportexport@file:projects/arm-storageimportexport.tgz': @@ -15963,25 +15963,36 @@ snapshots: - '@swc/wasm' - supports-color - '@rush-temp/arm-storagecache@file:projects/arm-storagecache.tgz': + '@rush-temp/arm-storagecache@file:projects/arm-storagecache.tgz(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3))(vite@5.4.12(@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 '@types/node': 18.19.71 - chai: 4.5.0 + '@vitest/browser': 2.1.8(@types/node@18.19.71)(playwright@1.49.1)(typescript@5.6.3)(vite@5.4.12(@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.1.0 - ts-node: 10.9.2(@types/node@18.19.71)(typescript@5.7.3) + playwright: 1.49.1 tslib: 2.8.1 - typescript: 5.7.3 + typescript: 5.6.3 + vitest: 2.1.8(@types/node@18.19.71)(@vitest/browser@2.1.8)(msw@2.7.0(@types/node@22.7.9)(typescript@5.7.3)) transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' + - '@edge-runtime/vm' + - '@vitest/ui' + - bufferutil + - happy-dom + - jsdom + - less + - lightningcss + - msw + - safaridriver + - sass + - sass-embedded + - stylus + - sugarss - supports-color + - terser + - utf-8-validate + - vite + - webdriverio '@rush-temp/arm-storageimportexport@file:projects/arm-storageimportexport.tgz': dependencies: @@ -25115,7 +25126,7 @@ snapshots: resolve-import: 1.4.6 rimraf: 5.0.10 sync-content: 1.0.2 - typescript: 5.5.4 + typescript: 5.7.3 walk-up-path: 3.0.1 tshy@2.0.1: diff --git a/sdk/storagecache/arm-storagecache/CHANGELOG.md b/sdk/storagecache/arm-storagecache/CHANGELOG.md index 19e2948331e1..e007ad523aee 100644 --- a/sdk/storagecache/arm-storagecache/CHANGELOG.md +++ b/sdk/storagecache/arm-storagecache/CHANGELOG.md @@ -1,15 +1,45 @@ # Release History - -## 8.0.1 (Unreleased) - + +## 8.1.0 (2025-01-21) + ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group AutoExportJobs + - Added Interface AutoExportJob + - Added Interface AutoExportJobsCreateOrUpdateHeaders + - Added Interface AutoExportJobsCreateOrUpdateOptionalParams + - Added Interface AutoExportJobsDeleteHeaders + - Added Interface AutoExportJobsDeleteOptionalParams + - Added Interface AutoExportJobsGetOptionalParams + - Added Interface AutoExportJobsListByAmlFilesystemNextOptionalParams + - Added Interface AutoExportJobsListByAmlFilesystemOptionalParams + - Added Interface AutoExportJobsListResult + - Added Interface AutoExportJobsUpdateHeaders + - Added Interface AutoExportJobsUpdateOptionalParams + - Added Interface AutoExportJobUpdate + - Added Type Alias AutoExportJobAdminStatus + - Added Type Alias AutoExportJobProvisioningStateType + - Added Type Alias AutoExportJobsCreateOrUpdateResponse + - Added Type Alias AutoExportJobsDeleteResponse + - Added Type Alias AutoExportJobsGetResponse + - Added Type Alias AutoExportJobsListByAmlFilesystemNextResponse + - Added Type Alias AutoExportJobsListByAmlFilesystemResponse + - Added Type Alias AutoExportJobsUpdateResponse + - Added Type Alias AutoExportStatusType + - Added Type Alias ImportJobAdminStatus + - Interface ImportJob has a new optional parameter adminStatus + - Interface ImportJob has a new optional parameter importedDirectories + - Interface ImportJob has a new optional parameter importedFiles + - Interface ImportJob has a new optional parameter importedSymlinks + - Interface ImportJob has a new optional parameter preexistingDirectories + - Interface ImportJob has a new optional parameter preexistingFiles + - Interface ImportJob has a new optional parameter preexistingSymlinks + - Added Enum KnownAutoExportJobAdminStatus + - Added Enum KnownAutoExportJobProvisioningStateType + - Added Enum KnownAutoExportStatusType + - Added Enum KnownImportJobAdminStatus + + ## 8.0.0 (2024-05-13) ### Features Added diff --git a/sdk/storagecache/arm-storagecache/LICENSE b/sdk/storagecache/arm-storagecache/LICENSE index 7d5934740965..2ad4de7b17f0 100644 --- a/sdk/storagecache/arm-storagecache/LICENSE +++ b/sdk/storagecache/arm-storagecache/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2024 Microsoft +Copyright (c) 2025 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/storagecache/arm-storagecache/README.md b/sdk/storagecache/arm-storagecache/README.md index e92971930fe9..325c63ade94e 100644 --- a/sdk/storagecache/arm-storagecache/README.md +++ b/sdk/storagecache/arm-storagecache/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure StorageCacheManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). @@ -64,8 +63,8 @@ const client = new StorageCacheManagementClient(new DefaultAzureCredential(), su // const client = new StorageCacheManagementClient(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 diff --git a/sdk/storagecache/arm-storagecache/_meta.json b/sdk/storagecache/arm-storagecache/_meta.json index 96f1e547b890..a5c6500fb89f 100644 --- a/sdk/storagecache/arm-storagecache/_meta.json +++ b/sdk/storagecache/arm-storagecache/_meta.json @@ -1,8 +1,8 @@ { - "commit": "fdc2e7b8efa15b521c7af6b041f226d5a090d5e1", + "commit": "9ca8aaa881c30a59bb1bfe4081209485f91187b5", "readme": "specification/storagecache/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\\storagecache\\resource-manager\\readme.md --use=@autorest/typescript@6.0.21 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/storagecache/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.7", - "use": "@autorest/typescript@6.0.21" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.18", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/storagecache/arm-storagecache/package.json b/sdk/storagecache/arm-storagecache/package.json index 43a94594f298..5131ad6021cc 100644 --- a/sdk/storagecache/arm-storagecache/package.json +++ b/sdk/storagecache/arm-storagecache/package.json @@ -3,18 +3,18 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for StorageCacheManagementClient.", - "version": "8.0.1", + "version": "8.1.0", "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/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.9.0", + "@azure/core-client": "^1.9.2", "@azure/core-lro": "^2.5.4", - "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.14.0", - "tslib": "^2.2.0" + "@azure/core-paging": "^1.6.2", + "@azure/core-rest-pipeline": "^1.18.2", + "tslib": "^2.8.1" }, "keywords": [ "node", @@ -24,22 +24,22 @@ "isomorphic" ], "license": "MIT", - "main": "./dist/index.js", + "main": "./dist/commonjs/index.js", "module": "./dist-esm/src/index.js", - "types": "./types/arm-storagecache.d.ts", + "types": "./dist/commonjs/index.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.1.0", - "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.1.0", + "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", - "@types/mocha": "^10.0.0", + "@azure/identity": "^4.6.0", "@types/node": "^18.0.0", - "chai": "^4.2.0", + "@vitest/browser": "^2.1.8", + "@vitest/coverage-istanbul": "^2.1.8", "dotenv": "^16.0.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "typescript": "~5.7.2" + "playwright": "^1.49.1", + "typescript": "~5.6.2", + "vitest": "^2.1.8" }, "repository": { "type": "git", @@ -49,24 +49,14 @@ "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/*" + "review/", + "CHANGELOG.md" ], "scripts": { - "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", + "build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", "build:browser": "echo skipped", "build:node": "echo skipped", "build:samples": "echo skipped.", @@ -78,7 +68,7 @@ "format": "echo skipped", "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'", + "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", "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", @@ -88,7 +78,7 @@ "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", + "unit-test:node": "dev-tool run test:vitest", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -102,12 +92,44 @@ }, "autoPublish": true, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagecache/arm-storagecache", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" + "type": "module", + "tshy": { + "project": "./tsconfig.src.json", + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-storagecache?view=azure-node-preview" + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false + }, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "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" + } + } } -} +} \ No newline at end of file diff --git a/sdk/storagecache/arm-storagecache/review/arm-storagecache.api.md b/sdk/storagecache/arm-storagecache/review/arm-storagecache.api.md index 7941e13106ec..9b4305c37440 100644 --- a/sdk/storagecache/arm-storagecache/review/arm-storagecache.api.md +++ b/sdk/storagecache/arm-storagecache/review/arm-storagecache.api.md @@ -349,6 +349,127 @@ export interface AscUsagesListOptionalParams extends coreClient.OperationOptions // @public export type AscUsagesListResponse = ResourceUsagesListResult; +// @public +export interface AutoExportJob extends TrackedResource { + adminStatus?: AutoExportJobAdminStatus; + autoExportPrefixes?: string[]; + readonly currentIterationFilesDiscovered?: number; + readonly currentIterationFilesExported?: number; + readonly currentIterationFilesFailed?: number; + readonly currentIterationMiBDiscovered?: number; + readonly currentIterationMiBExported?: number; + readonly exportIterationCount?: number; + readonly lastCompletionTimeUTC?: Date; + readonly lastStartedTimeUTC?: Date; + readonly lastSuccessfulIterationCompletionTimeUTC?: Date; + readonly provisioningState?: AutoExportJobProvisioningStateType; + state?: AutoExportStatusType; + readonly statusCode?: string; + readonly statusMessage?: string; + readonly totalFilesExported?: number; + readonly totalFilesFailed?: number; + readonly totalMiBExported?: number; +} + +// @public +export type AutoExportJobAdminStatus = string; + +// @public +export type AutoExportJobProvisioningStateType = string; + +// @public +export interface AutoExportJobs { + beginCreateOrUpdate(resourceGroupName: string, amlFilesystemName: string, autoExportJobName: string, autoExportJob: AutoExportJob, options?: AutoExportJobsCreateOrUpdateOptionalParams): Promise, AutoExportJobsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, amlFilesystemName: string, autoExportJobName: string, autoExportJob: AutoExportJob, options?: AutoExportJobsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, amlFilesystemName: string, autoExportJobName: string, options?: AutoExportJobsDeleteOptionalParams): Promise, AutoExportJobsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, amlFilesystemName: string, autoExportJobName: string, options?: AutoExportJobsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, amlFilesystemName: string, autoExportJobName: string, autoExportJob: AutoExportJobUpdate, options?: AutoExportJobsUpdateOptionalParams): Promise, AutoExportJobsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, amlFilesystemName: string, autoExportJobName: string, autoExportJob: AutoExportJobUpdate, options?: AutoExportJobsUpdateOptionalParams): Promise; + get(resourceGroupName: string, amlFilesystemName: string, autoExportJobName: string, options?: AutoExportJobsGetOptionalParams): Promise; + listByAmlFilesystem(resourceGroupName: string, amlFilesystemName: string, options?: AutoExportJobsListByAmlFilesystemOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AutoExportJobsCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + +// @public +export interface AutoExportJobsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AutoExportJobsCreateOrUpdateResponse = AutoExportJob; + +// @public +export interface AutoExportJobsDeleteHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface AutoExportJobsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AutoExportJobsDeleteResponse = AutoExportJobsDeleteHeaders; + +// @public +export interface AutoExportJobsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoExportJobsGetResponse = AutoExportJob; + +// @public +export interface AutoExportJobsListByAmlFilesystemNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoExportJobsListByAmlFilesystemNextResponse = AutoExportJobsListResult; + +// @public +export interface AutoExportJobsListByAmlFilesystemOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoExportJobsListByAmlFilesystemResponse = AutoExportJobsListResult; + +// @public +export interface AutoExportJobsListResult { + nextLink?: string; + value?: AutoExportJob[]; +} + +// @public +export interface AutoExportJobsUpdateHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface AutoExportJobsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AutoExportJobsUpdateResponse = AutoExportJob; + +// @public +export interface AutoExportJobUpdate { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type AutoExportStatusType = string; + // @public export interface BlobNfsTarget { target?: string; @@ -822,13 +943,20 @@ export type HealthStateType = string; // @public export interface ImportJob extends TrackedResource { + adminStatus?: ImportJobAdminStatus; readonly blobsImportedPerSecond?: number; readonly blobsWalkedPerSecond?: number; conflictResolutionMode?: ConflictResolutionMode; + readonly importedDirectories?: number; + readonly importedFiles?: number; + readonly importedSymlinks?: number; importPrefixes?: string[]; readonly lastCompletionTime?: Date; readonly lastStartedTime?: Date; maximumErrors?: number; + readonly preexistingDirectories?: number; + readonly preexistingFiles?: number; + readonly preexistingSymlinks?: number; readonly provisioningState?: ImportJobProvisioningStateType; readonly state?: ImportStatusType; readonly statusMessage?: string; @@ -838,6 +966,9 @@ export interface ImportJob extends TrackedResource { readonly totalErrors?: number; } +// @public +export type ImportJobAdminStatus = string; + // @public export type ImportJobProvisioningStateType = string; @@ -983,6 +1114,31 @@ export enum KnownArchiveStatusType { NotConfigured = "NotConfigured" } +// @public +export enum KnownAutoExportJobAdminStatus { + Active = "Active", + Cancel = "Cancel" +} + +// @public +export enum KnownAutoExportJobProvisioningStateType { + Canceled = "Canceled", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownAutoExportStatusType { + Disabled = "Disabled", + DisableFailed = "DisableFailed", + Disabling = "Disabling", + Failed = "Failed", + InProgress = "InProgress" +} + // @public export enum KnownConflictResolutionMode { Fail = "Fail", @@ -1034,6 +1190,12 @@ export enum KnownHealthStateType { WaitingForKey = "WaitingForKey" } +// @public +export enum KnownImportJobAdminStatus { + Active = "Active", + Cancel = "Cancel" +} + // @public export enum KnownImportJobProvisioningStateType { Canceled = "Canceled", @@ -1365,6 +1527,8 @@ export class StorageCacheManagementClient extends coreClient.ServiceClient { // (undocumented) ascUsages: AscUsages; // (undocumented) + autoExportJobs: AutoExportJobs; + // (undocumented) caches: Caches; checkAmlFSSubnets(options?: CheckAmlFSSubnetsOptionalParams): Promise; getRequiredAmlFSSubnetsSize(options?: GetRequiredAmlFSSubnetsSizeOptionalParams): Promise; diff --git a/sdk/storagecache/arm-storagecache/sample.env b/sdk/storagecache/arm-storagecache/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/storagecache/arm-storagecache/sample.env +++ b/sdk/storagecache/arm-storagecache/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/storagecache/arm-storagecache/samples-dev/amlFilesystemsArchiveSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsArchiveSample.ts index 9447fabe120b..193626c44b65 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsArchiveSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsArchiveSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Archive data from the AML file system. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Archive data from the AML file system. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_Archive.json */ -async function amlFilesystemsArchive() { +async function amlFilesystemsArchive(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -43,7 +41,7 @@ async function amlFilesystemsArchive() { console.log(result); } -async function main() { +async function main(): Promise { await amlFilesystemsArchive(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsCancelArchiveSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsCancelArchiveSample.ts index 98e09ea420d4..c6d8b3613383 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsCancelArchiveSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsCancelArchiveSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Cancel archiving data from the AML file system. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Cancel archiving data from the AML file system. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_CancelArchive.json */ -async function amlFilesystemsCancelArchive() { +async function amlFilesystemsCancelArchive(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function amlFilesystemsCancelArchive() { console.log(result); } -async function main() { +async function main(): Promise { await amlFilesystemsCancelArchive(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsCreateOrUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsCreateOrUpdateSample.ts index e8dbd900a101..6ef73ccd031a 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsCreateOrUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsCreateOrUpdateSample.ts @@ -13,9 +13,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an AML file system. @@ -23,7 +21,7 @@ dotenv.config(); * @summary Create or update an AML file system. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_CreateOrUpdate.json */ -async function amlFilesystemsCreateOrUpdate() { +async function amlFilesystemsCreateOrUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -81,7 +79,7 @@ async function amlFilesystemsCreateOrUpdate() { console.log(result); } -async function main() { +async function main(): Promise { await amlFilesystemsCreateOrUpdate(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsDeleteSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsDeleteSample.ts index a76c7b7ab743..35ddbb6a2520 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsDeleteSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsDeleteSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Schedules an AML file system for deletion. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Schedules an AML file system for deletion. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_Delete.json */ -async function amlFilesystemsDelete() { +async function amlFilesystemsDelete(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function amlFilesystemsDelete() { console.log(result); } -async function main() { +async function main(): Promise { await amlFilesystemsDelete(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsGetSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsGetSample.ts index 32021c75374f..b2796c1ac07d 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsGetSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsGetSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns an AML file system. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns an AML file system. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_Get.json */ -async function amlFilesystemsGet() { +async function amlFilesystemsGet(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function amlFilesystemsGet() { console.log(result); } -async function main() { +async function main(): Promise { await amlFilesystemsGet(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsListByResourceGroupSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsListByResourceGroupSample.ts index 54639438a488..ce974d31a8bb 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsListByResourceGroupSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsListByResourceGroupSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns all AML file systems the user has access to under a resource group. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns all AML file systems the user has access to under a resource group. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_ListByResourceGroup.json */ -async function amlFilesystemsListByResourceGroup() { +async function amlFilesystemsListByResourceGroup(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -37,7 +35,7 @@ async function amlFilesystemsListByResourceGroup() { console.log(resArray); } -async function main() { +async function main(): Promise { await amlFilesystemsListByResourceGroup(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsListSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsListSample.ts index 4a67eeff7a2d..62babae484ae 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsListSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsListSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns all AML file systems the user has access to under a subscription. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns all AML file systems the user has access to under a subscription. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_List.json */ -async function amlFilesystemsList() { +async function amlFilesystemsList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -33,7 +31,7 @@ async function amlFilesystemsList() { console.log(resArray); } -async function main() { +async function main(): Promise { await amlFilesystemsList(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsUpdateSample.ts index 83334abd73c6..ff59cd297045 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/amlFilesystemsUpdateSample.ts @@ -13,9 +13,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update an AML file system instance. @@ -23,7 +21,7 @@ dotenv.config(); * @summary Update an AML file system instance. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_Update.json */ -async function amlFilesystemsUpdate() { +async function amlFilesystemsUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -59,7 +57,7 @@ async function amlFilesystemsUpdate() { console.log(result); } -async function main() { +async function main(): Promise { await amlFilesystemsUpdate(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/ascOperationsGetSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/ascOperationsGetSample.ts index 65fd6f3a1f0a..0615653f9e16 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/ascOperationsGetSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/ascOperationsGetSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the status of an asynchronous operation for the Azure HPC Cache @@ -20,7 +18,7 @@ dotenv.config(); * @summary Gets the status of an asynchronous operation for the Azure HPC Cache * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/AscOperations_Get.json */ -async function ascOperationsGet() { +async function ascOperationsGet(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -32,7 +30,7 @@ async function ascOperationsGet() { console.log(result); } -async function main() { +async function main(): Promise { await ascOperationsGet(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/ascUsagesListSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/ascUsagesListSample.ts index 683cf87c24d1..ef870b244ec3 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/ascUsagesListSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/ascUsagesListSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the quantity used and quota limit for resources @@ -20,7 +18,7 @@ dotenv.config(); * @summary Gets the quantity used and quota limit for resources * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/AscResourceUsages_Get.json */ -async function ascUsagesList() { +async function ascUsagesList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -34,7 +32,7 @@ async function ascUsagesList() { console.log(resArray); } -async function main() { +async function main(): Promise { await ascUsagesList(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesCreateOrUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesCreateOrUpdateSample.ts index 0223fcf71ac0..c3784ba8504e 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesCreateOrUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesCreateOrUpdateSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { Cache, StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update a cache. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Create or update a cache. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_CreateOrUpdate.json */ -async function cachesCreateOrUpdate() { +async function cachesCreateOrUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -106,7 +104,7 @@ async function cachesCreateOrUpdate() { * @summary Create or update a cache. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_CreateOrUpdate_ldap_only.json */ -async function cachesCreateOrUpdateLdapOnly() { +async function cachesCreateOrUpdateLdapOnly(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -171,7 +169,7 @@ async function cachesCreateOrUpdateLdapOnly() { console.log(result); } -async function main() { +async function main(): Promise { await cachesCreateOrUpdate(); await cachesCreateOrUpdateLdapOnly(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesDebugInfoSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesDebugInfoSample.ts index af7f43843b22..bf3015503521 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesDebugInfoSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesDebugInfoSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells a cache to write generate debug info for support to process. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells a cache to write generate debug info for support to process. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_DebugInfo.json */ -async function cachesDebugInfo() { +async function cachesDebugInfo(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function cachesDebugInfo() { console.log(result); } -async function main() { +async function main(): Promise { await cachesDebugInfo(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesDeleteSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesDeleteSample.ts index d3cda7d79774..e00fee4c3dab 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesDeleteSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesDeleteSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Schedules a cache for deletion. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Schedules a cache for deletion. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Delete.json */ -async function cachesDelete() { +async function cachesDelete(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function cachesDelete() { console.log(result); } -async function main() { +async function main(): Promise { await cachesDelete(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesFlushSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesFlushSample.ts index fdd22748cd41..28d6db41bc9f 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesFlushSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesFlushSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells a cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells a cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Flush.json */ -async function cachesFlush() { +async function cachesFlush(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function cachesFlush() { console.log(result); } -async function main() { +async function main(): Promise { await cachesFlush(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesGetSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesGetSample.ts index a40658d0ea39..4d63aae7ad37 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesGetSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesGetSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns a cache. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns a cache. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Get.json */ -async function cachesGet() { +async function cachesGet(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -33,7 +31,7 @@ async function cachesGet() { console.log(result); } -async function main() { +async function main(): Promise { await cachesGet(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesListByResourceGroupSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesListByResourceGroupSample.ts index 2ac8d1989635..5fab23cc3886 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesListByResourceGroupSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesListByResourceGroupSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns all caches the user has access to under a resource group. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns all caches the user has access to under a resource group. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_ListByResourceGroup.json */ -async function cachesListByResourceGroup() { +async function cachesListByResourceGroup(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -35,7 +33,7 @@ async function cachesListByResourceGroup() { console.log(resArray); } -async function main() { +async function main(): Promise { await cachesListByResourceGroup(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesListSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesListSample.ts index 9fcb256ec9cd..6da3b816847c 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesListSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesListSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns all caches the user has access to under a subscription. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns all caches the user has access to under a subscription. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_List.json */ -async function cachesList() { +async function cachesList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -33,7 +31,7 @@ async function cachesList() { console.log(resArray); } -async function main() { +async function main(): Promise { await cachesList(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesPausePrimingJobSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesPausePrimingJobSample.ts index 6e77451ae167..49f380261d15 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesPausePrimingJobSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesPausePrimingJobSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Schedule a priming job to be paused. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Schedule a priming job to be paused. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/PausePrimingJob.json */ -async function pausePrimingJob() { +async function pausePrimingJob(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -45,7 +43,7 @@ async function pausePrimingJob() { console.log(result); } -async function main() { +async function main(): Promise { await pausePrimingJob(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesResumePrimingJobSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesResumePrimingJobSample.ts index b38403fef17c..c540082d3a72 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesResumePrimingJobSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesResumePrimingJobSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Resumes a paused priming job. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Resumes a paused priming job. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/ResumePrimingJob.json */ -async function resumePrimingJob() { +async function resumePrimingJob(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -45,7 +43,7 @@ async function resumePrimingJob() { console.log(result); } -async function main() { +async function main(): Promise { await resumePrimingJob(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesSpaceAllocationSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesSpaceAllocationSample.ts index a826ec48aad1..6e395f225914 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesSpaceAllocationSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesSpaceAllocationSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update cache space allocation. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Update cache space allocation. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/SpaceAllocation_Post.json */ -async function spaceAllocationPost() { +async function spaceAllocationPost(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -47,7 +45,7 @@ async function spaceAllocationPost() { console.log(result); } -async function main() { +async function main(): Promise { await spaceAllocationPost(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesStartPrimingJobSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesStartPrimingJobSample.ts index 436dbf0cb5c2..9d170901746b 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesStartPrimingJobSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesStartPrimingJobSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create a priming job. This operation is only allowed when the cache is healthy. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Create a priming job. This operation is only allowed when the cache is healthy. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StartPrimingJob.json */ -async function startPrimingJob() { +async function startPrimingJob(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -47,7 +45,7 @@ async function startPrimingJob() { console.log(result); } -async function main() { +async function main(): Promise { await startPrimingJob(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesStartSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesStartSample.ts index fe23d1864e28..2c368064a2da 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesStartSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesStartSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells a Stopped state cache to transition to Active state. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells a Stopped state cache to transition to Active state. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Start.json */ -async function cachesStart() { +async function cachesStart(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function cachesStart() { console.log(result); } -async function main() { +async function main(): Promise { await cachesStart(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesStopPrimingJobSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesStopPrimingJobSample.ts index 8959b8ffadef..b083a36a2f89 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesStopPrimingJobSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesStopPrimingJobSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Schedule a priming job for deletion. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Schedule a priming job for deletion. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StopPrimingJob.json */ -async function stopPrimingJob() { +async function stopPrimingJob(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -45,7 +43,7 @@ async function stopPrimingJob() { console.log(result); } -async function main() { +async function main(): Promise { await stopPrimingJob(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesStopSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesStopSample.ts index 2d4ad121dd24..1f43aa440b77 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesStopSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesStopSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells an Active cache to transition to Stopped state. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells an Active cache to transition to Stopped state. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Stop.json */ -async function cachesStop() { +async function cachesStop(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function cachesStop() { console.log(result); } -async function main() { +async function main(): Promise { await cachesStop(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesUpdateSample.ts index 10b6d3ada78b..4757ad0d3b12 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesUpdateSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update a cache instance. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Update a cache instance. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Update.json */ -async function cachesUpdate() { +async function cachesUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -122,7 +120,7 @@ async function cachesUpdate() { * @summary Update a cache instance. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Update_ldap_only.json */ -async function cachesUpdateLdapOnly() { +async function cachesUpdateLdapOnly(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -216,7 +214,7 @@ async function cachesUpdateLdapOnly() { console.log(result); } -async function main() { +async function main(): Promise { await cachesUpdate(); await cachesUpdateLdapOnly(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/cachesUpgradeFirmwareSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/cachesUpgradeFirmwareSample.ts index b62a7a663ecd..9e4120f037f2 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/cachesUpgradeFirmwareSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/cachesUpgradeFirmwareSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Upgrade a cache's firmware if a new version is available. Otherwise, this operation has no effect. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Upgrade a cache's firmware if a new version is available. Otherwise, this operation has no effect. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_UpgradeFirmware.json */ -async function cachesUpgradeFirmware() { +async function cachesUpgradeFirmware(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function cachesUpgradeFirmware() { console.log(result); } -async function main() { +async function main(): Promise { await cachesUpgradeFirmware(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/checkAmlFsSubnetsSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/checkAmlFsSubnetsSample.ts index b1ba16e26891..2ed31fc322a2 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/checkAmlFsSubnetsSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/checkAmlFsSubnetsSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Check that subnets will be valid for AML file system create calls. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Check that subnets will be valid for AML file system create calls. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/checkAmlFSSubnets.json */ -async function checkAmlFsSubnets() { +async function checkAmlFsSubnets(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -41,7 +39,7 @@ async function checkAmlFsSubnets() { console.log(result); } -async function main() { +async function main(): Promise { await checkAmlFsSubnets(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/getRequiredAmlFsSubnetsSizeSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/getRequiredAmlFsSubnetsSizeSample.ts index 0a802b98c5ff..be4bc489f6f7 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/getRequiredAmlFsSubnetsSizeSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/getRequiredAmlFsSubnetsSizeSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Get the number of available IP addresses needed for the AML file system information provided. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Get the number of available IP addresses needed for the AML file system information provided. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/getRequiredAmlFSSubnetsSize.json */ -async function getRequiredAmlFilesystemSubnetsSize() { +async function getRequiredAmlFilesystemSubnetsSize(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -30,7 +28,7 @@ async function getRequiredAmlFilesystemSubnetsSize() { console.log(result); } -async function main() { +async function main(): Promise { await getRequiredAmlFilesystemSubnetsSize(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/importJobsCreateOrUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/importJobsCreateOrUpdateSample.ts index a886255710db..a51c330b29da 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/importJobsCreateOrUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/importJobsCreateOrUpdateSample.ts @@ -13,9 +13,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an import job. Import jobs are automatically deleted 72 hours after completion. @@ -23,7 +21,7 @@ dotenv.config(); * @summary Create or update an import job. Import jobs are automatically deleted 72 hours after completion. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJobs_CreateOrUpdate.json */ -async function importJobsCreateOrUpdate() { +async function importJobsCreateOrUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -49,7 +47,7 @@ async function importJobsCreateOrUpdate() { console.log(result); } -async function main() { +async function main(): Promise { await importJobsCreateOrUpdate(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/importJobsDeleteSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/importJobsDeleteSample.ts index cf06cf0c3edd..9ac68b203436 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/importJobsDeleteSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/importJobsDeleteSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Schedules an import job for deletion. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Schedules an import job for deletion. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJobs_Delete.json */ -async function importJobsDelete() { +async function importJobsDelete(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function importJobsDelete() { console.log(result); } -async function main() { +async function main(): Promise { await importJobsDelete(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/importJobsGetSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/importJobsGetSample.ts index 7c72102e17c3..17877593ceab 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/importJobsGetSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/importJobsGetSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns an import job. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns an import job. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJobs_Get.json */ -async function importJobsGet() { +async function importJobsGet(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function importJobsGet() { console.log(result); } -async function main() { +async function main(): Promise { await importJobsGet(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/importJobsListByAmlFilesystemSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/importJobsListByAmlFilesystemSample.ts index 9f449f806472..34fe31f3d020 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/importJobsListByAmlFilesystemSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/importJobsListByAmlFilesystemSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns all import jobs the user has access to under an AML File System. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns all import jobs the user has access to under an AML File System. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJobs_ListByAmlFilesystem.json */ -async function importJobsListByAmlFilesystem() { +async function importJobsListByAmlFilesystem(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +37,7 @@ async function importJobsListByAmlFilesystem() { console.log(resArray); } -async function main() { +async function main(): Promise { await importJobsListByAmlFilesystem(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/importJobsUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/importJobsUpdateSample.ts index d9aa553985f3..928b18e18153 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/importJobsUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/importJobsUpdateSample.ts @@ -13,9 +13,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update an import job instance. @@ -23,7 +21,7 @@ dotenv.config(); * @summary Update an import job instance. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJob_Update.json */ -async function importJobsUpdate() { +async function importJobsUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -43,7 +41,7 @@ async function importJobsUpdate() { console.log(result); } -async function main() { +async function main(): Promise { await importJobsUpdate(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/operationsListSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/operationsListSample.ts index 9810ac21f74b..c0c41cf7cf46 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/operationsListSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/operationsListSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists all of the available Resource Provider operations. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Lists all of the available Resource Provider operations. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Operations_List.json */ -async function operationsList() { +async function operationsList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -33,7 +31,7 @@ async function operationsList() { console.log(resArray); } -async function main() { +async function main(): Promise { await operationsList(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/skusListSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/skusListSample.ts index 9ce4321595b9..438c4190d2f4 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/skusListSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/skusListSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Get the list of StorageCache.Cache SKUs available to this subscription. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Get the list of StorageCache.Cache SKUs available to this subscription. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Skus_List.json */ -async function skusList() { +async function skusList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -33,7 +31,7 @@ async function skusList() { console.log(resArray); } -async function main() { +async function main(): Promise { await skusList(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetFlushSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetFlushSample.ts index 2c9aad4b477b..2749f595b220 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetFlushSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetFlushSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Flush.json */ -async function storageTargetsFlush() { +async function storageTargetsFlush(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsFlush() { console.log(result); } -async function main() { +async function main(): Promise { await storageTargetsFlush(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetInvalidateSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetInvalidateSample.ts index e66605a7bd55..4d8b986c271f 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetInvalidateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetInvalidateSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Invalidate.json */ -async function storageTargetsInvalidate() { +async function storageTargetsInvalidate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsInvalidate() { console.log(result); } -async function main() { +async function main(): Promise { await storageTargetsInvalidate(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetResumeSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetResumeSample.ts index 4bf7f9eded25..479d5e9498bc 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetResumeSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetResumeSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Resumes client access to a previously suspended storage target. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Resumes client access to a previously suspended storage target. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Resume.json */ -async function storageTargetsResume() { +async function storageTargetsResume(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsResume() { console.log(result); } -async function main() { +async function main(): Promise { await storageTargetsResume(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetSuspendSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetSuspendSample.ts index a22cbfd9e225..ccd945db19cb 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetSuspendSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetSuspendSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Suspends client access to a storage target. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Suspends client access to a storage target. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Suspend.json */ -async function storageTargetsSuspend() { +async function storageTargetsSuspend(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsSuspend() { console.log(result); } -async function main() { +async function main(): Promise { await storageTargetsSuspend(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsCreateOrUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsCreateOrUpdateSample.ts index 3a8e4236c0a7..2b3b2b0afd51 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsCreateOrUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsCreateOrUpdateSample.ts @@ -13,9 +13,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again. @@ -23,7 +21,7 @@ dotenv.config(); * @summary Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_CreateOrUpdate.json */ -async function storageTargetsCreateOrUpdate() { +async function storageTargetsCreateOrUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -70,7 +68,7 @@ async function storageTargetsCreateOrUpdate() { * @summary Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_CreateOrUpdate_BlobNfs.json */ -async function storageTargetsCreateOrUpdateBlobNfs() { +async function storageTargetsCreateOrUpdateBlobNfs(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -106,7 +104,7 @@ async function storageTargetsCreateOrUpdateBlobNfs() { * @summary Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_CreateOrUpdate_NoJunctions.json */ -async function storageTargetsCreateOrUpdateNoJunctions() { +async function storageTargetsCreateOrUpdateNoJunctions(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -133,7 +131,7 @@ async function storageTargetsCreateOrUpdateNoJunctions() { console.log(result); } -async function main() { +async function main(): Promise { await storageTargetsCreateOrUpdate(); await storageTargetsCreateOrUpdateBlobNfs(); await storageTargetsCreateOrUpdateNoJunctions(); diff --git a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsDeleteSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsDeleteSample.ts index 7e64b585c1be..b587546c8ea9 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsDeleteSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsDeleteSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Removes a Storage Target from a cache. This operation is allowed at any time, but if the cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the cache is healthy again. Note that if the cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Removes a Storage Target from a cache. This operation is allowed at any time, but if the cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the cache is healthy again. Note that if the cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Delete.json */ -async function storageTargetsDelete() { +async function storageTargetsDelete(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsDelete() { console.log(result); } -async function main() { +async function main(): Promise { await storageTargetsDelete(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsDnsRefreshSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsDnsRefreshSample.ts index 760d7c996e59..bc923bb03c8c 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsDnsRefreshSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsDnsRefreshSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells a storage target to refresh its DNS information. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells a storage target to refresh its DNS information. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_DnsRefresh.json */ -async function cachesDnsRefresh() { +async function cachesDnsRefresh(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function cachesDnsRefresh() { console.log(result); } -async function main() { +async function main(): Promise { await cachesDnsRefresh(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsGetSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsGetSample.ts index 79a3e40168bf..702c898feb61 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsGetSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsGetSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns a Storage Target from a cache. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns a Storage Target from a cache. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Get.json */ -async function storageTargetsGet() { +async function storageTargetsGet(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsGet() { console.log(result); } -async function main() { +async function main(): Promise { await storageTargetsGet(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsListByCacheSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsListByCacheSample.ts index dd6791c7bfe5..5f2e19010804 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsListByCacheSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsListByCacheSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns a list of Storage Targets for the specified cache. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns a list of Storage Targets for the specified cache. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_ListByCache.json */ -async function storageTargetsList() { +async function storageTargetsList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +37,7 @@ async function storageTargetsList() { console.log(resArray); } -async function main() { +async function main(): Promise { await storageTargetsList(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsRestoreDefaultsSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsRestoreDefaultsSample.ts index dcb185ba1a10..a831629db511 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsRestoreDefaultsSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/storageTargetsRestoreDefaultsSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells a storage target to restore its settings to their default values. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells a storage target to restore its settings to their default values. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_RestoreDefaults.json */ -async function storageTargetsRestoreDefaults() { +async function storageTargetsRestoreDefaults(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsRestoreDefaults() { console.log(result); } -async function main() { +async function main(): Promise { await storageTargetsRestoreDefaults(); } diff --git a/sdk/storagecache/arm-storagecache/samples-dev/usageModelsListSample.ts b/sdk/storagecache/arm-storagecache/samples-dev/usageModelsListSample.ts index 4891ea6f21d0..fc8e42e5c2c8 100644 --- a/sdk/storagecache/arm-storagecache/samples-dev/usageModelsListSample.ts +++ b/sdk/storagecache/arm-storagecache/samples-dev/usageModelsListSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Get the list of cache usage models available to this subscription. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Get the list of cache usage models available to this subscription. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/UsageModels_List.json */ -async function usageModelsList() { +async function usageModelsList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -33,7 +31,7 @@ async function usageModelsList() { console.log(resArray); } -async function main() { +async function main(): Promise { await usageModelsList(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsArchiveSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsArchiveSample.ts index 7a2366b7f5df..fca4f688437a 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsArchiveSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsArchiveSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Archive data from the AML file system. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Archive data from the AML file system. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_Archive.json */ -async function amlFilesystemsArchive() { +async function amlFilesystemsArchive(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -43,7 +41,7 @@ async function amlFilesystemsArchive() { console.log(result); } -async function main() { +async function main(): Promise { amlFilesystemsArchive(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsCancelArchiveSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsCancelArchiveSample.ts index f224fcde73bb..b6b77ed238af 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsCancelArchiveSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsCancelArchiveSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Cancel archiving data from the AML file system. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Cancel archiving data from the AML file system. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_CancelArchive.json */ -async function amlFilesystemsCancelArchive() { +async function amlFilesystemsCancelArchive(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function amlFilesystemsCancelArchive() { console.log(result); } -async function main() { +async function main(): Promise { amlFilesystemsCancelArchive(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsCreateOrUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsCreateOrUpdateSample.ts index 5417f1b8b2f2..3062bda285f6 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsCreateOrUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsCreateOrUpdateSample.ts @@ -13,9 +13,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an AML file system. @@ -23,7 +21,7 @@ dotenv.config(); * @summary Create or update an AML file system. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_CreateOrUpdate.json */ -async function amlFilesystemsCreateOrUpdate() { +async function amlFilesystemsCreateOrUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -81,7 +79,7 @@ async function amlFilesystemsCreateOrUpdate() { console.log(result); } -async function main() { +async function main(): Promise { amlFilesystemsCreateOrUpdate(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsDeleteSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsDeleteSample.ts index f4accdb255aa..0de663d9e155 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsDeleteSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsDeleteSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Schedules an AML file system for deletion. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Schedules an AML file system for deletion. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_Delete.json */ -async function amlFilesystemsDelete() { +async function amlFilesystemsDelete(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function amlFilesystemsDelete() { console.log(result); } -async function main() { +async function main(): Promise { amlFilesystemsDelete(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsGetSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsGetSample.ts index de024717099e..a8bf6cea3a1a 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsGetSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsGetSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns an AML file system. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns an AML file system. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_Get.json */ -async function amlFilesystemsGet() { +async function amlFilesystemsGet(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function amlFilesystemsGet() { console.log(result); } -async function main() { +async function main(): Promise { amlFilesystemsGet(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsListByResourceGroupSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsListByResourceGroupSample.ts index a0b2fd6dae3c..7ba4a4c492fc 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsListByResourceGroupSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsListByResourceGroupSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns all AML file systems the user has access to under a resource group. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns all AML file systems the user has access to under a resource group. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_ListByResourceGroup.json */ -async function amlFilesystemsListByResourceGroup() { +async function amlFilesystemsListByResourceGroup(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -37,7 +35,7 @@ async function amlFilesystemsListByResourceGroup() { console.log(resArray); } -async function main() { +async function main(): Promise { amlFilesystemsListByResourceGroup(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsListSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsListSample.ts index a679a51cfc74..747e7099e71f 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsListSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsListSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns all AML file systems the user has access to under a subscription. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns all AML file systems the user has access to under a subscription. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_List.json */ -async function amlFilesystemsList() { +async function amlFilesystemsList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -33,7 +31,7 @@ async function amlFilesystemsList() { console.log(resArray); } -async function main() { +async function main(): Promise { amlFilesystemsList(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsUpdateSample.ts index 200de2e8fdd7..8634b9f659c7 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/amlFilesystemsUpdateSample.ts @@ -13,9 +13,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update an AML file system instance. @@ -23,7 +21,7 @@ dotenv.config(); * @summary Update an AML file system instance. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/amlFilesystems_Update.json */ -async function amlFilesystemsUpdate() { +async function amlFilesystemsUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -59,7 +57,7 @@ async function amlFilesystemsUpdate() { console.log(result); } -async function main() { +async function main(): Promise { amlFilesystemsUpdate(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/ascOperationsGetSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/ascOperationsGetSample.ts index acc05cb59fe0..2f536569e5fb 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/ascOperationsGetSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/ascOperationsGetSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the status of an asynchronous operation for the Azure HPC Cache @@ -20,7 +18,7 @@ dotenv.config(); * @summary Gets the status of an asynchronous operation for the Azure HPC Cache * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/AscOperations_Get.json */ -async function ascOperationsGet() { +async function ascOperationsGet(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -32,7 +30,7 @@ async function ascOperationsGet() { console.log(result); } -async function main() { +async function main(): Promise { ascOperationsGet(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/ascUsagesListSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/ascUsagesListSample.ts index ab8a42cce3fc..45362511247a 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/ascUsagesListSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/ascUsagesListSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the quantity used and quota limit for resources @@ -20,7 +18,7 @@ dotenv.config(); * @summary Gets the quantity used and quota limit for resources * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/AscResourceUsages_Get.json */ -async function ascUsagesList() { +async function ascUsagesList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -34,7 +32,7 @@ async function ascUsagesList() { console.log(resArray); } -async function main() { +async function main(): Promise { ascUsagesList(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesCreateOrUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesCreateOrUpdateSample.ts index a439ca3326e5..e85375b221b9 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesCreateOrUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesCreateOrUpdateSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { Cache, StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update a cache. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Create or update a cache. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_CreateOrUpdate.json */ -async function cachesCreateOrUpdate() { +async function cachesCreateOrUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -106,7 +104,7 @@ async function cachesCreateOrUpdate() { * @summary Create or update a cache. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_CreateOrUpdate_ldap_only.json */ -async function cachesCreateOrUpdateLdapOnly() { +async function cachesCreateOrUpdateLdapOnly(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -171,7 +169,7 @@ async function cachesCreateOrUpdateLdapOnly() { console.log(result); } -async function main() { +async function main(): Promise { cachesCreateOrUpdate(); cachesCreateOrUpdateLdapOnly(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesDebugInfoSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesDebugInfoSample.ts index a3590be0917e..8b62f07d05e2 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesDebugInfoSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesDebugInfoSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells a cache to write generate debug info for support to process. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells a cache to write generate debug info for support to process. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_DebugInfo.json */ -async function cachesDebugInfo() { +async function cachesDebugInfo(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function cachesDebugInfo() { console.log(result); } -async function main() { +async function main(): Promise { cachesDebugInfo(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesDeleteSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesDeleteSample.ts index 930df3d3c77f..15941d679e74 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesDeleteSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesDeleteSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Schedules a cache for deletion. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Schedules a cache for deletion. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Delete.json */ -async function cachesDelete() { +async function cachesDelete(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function cachesDelete() { console.log(result); } -async function main() { +async function main(): Promise { cachesDelete(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesFlushSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesFlushSample.ts index 6f8bc93746db..a799fb3edaac 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesFlushSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesFlushSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells a cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells a cache to write all dirty data to the Storage Target(s). During the flush, clients will see errors returned until the flush is complete. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Flush.json */ -async function cachesFlush() { +async function cachesFlush(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function cachesFlush() { console.log(result); } -async function main() { +async function main(): Promise { cachesFlush(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesGetSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesGetSample.ts index c760186910fd..9d2829c06935 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesGetSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesGetSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns a cache. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns a cache. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Get.json */ -async function cachesGet() { +async function cachesGet(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -33,7 +31,7 @@ async function cachesGet() { console.log(result); } -async function main() { +async function main(): Promise { cachesGet(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesListByResourceGroupSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesListByResourceGroupSample.ts index 951649d9bbd8..2e4cfb3fa11f 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesListByResourceGroupSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesListByResourceGroupSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns all caches the user has access to under a resource group. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns all caches the user has access to under a resource group. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_ListByResourceGroup.json */ -async function cachesListByResourceGroup() { +async function cachesListByResourceGroup(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -35,7 +33,7 @@ async function cachesListByResourceGroup() { console.log(resArray); } -async function main() { +async function main(): Promise { cachesListByResourceGroup(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesListSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesListSample.ts index d219e5201fd8..d4248953e218 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesListSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesListSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns all caches the user has access to under a subscription. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns all caches the user has access to under a subscription. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_List.json */ -async function cachesList() { +async function cachesList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -33,7 +31,7 @@ async function cachesList() { console.log(resArray); } -async function main() { +async function main(): Promise { cachesList(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesPausePrimingJobSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesPausePrimingJobSample.ts index fb5eef17d4fa..451ccff12a45 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesPausePrimingJobSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesPausePrimingJobSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Schedule a priming job to be paused. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Schedule a priming job to be paused. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/PausePrimingJob.json */ -async function pausePrimingJob() { +async function pausePrimingJob(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -45,7 +43,7 @@ async function pausePrimingJob() { console.log(result); } -async function main() { +async function main(): Promise { pausePrimingJob(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesResumePrimingJobSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesResumePrimingJobSample.ts index 4a49d1a2026b..9f13668d706d 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesResumePrimingJobSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesResumePrimingJobSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Resumes a paused priming job. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Resumes a paused priming job. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/ResumePrimingJob.json */ -async function resumePrimingJob() { +async function resumePrimingJob(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -45,7 +43,7 @@ async function resumePrimingJob() { console.log(result); } -async function main() { +async function main(): Promise { resumePrimingJob(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesSpaceAllocationSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesSpaceAllocationSample.ts index b0f18637b1f2..a343f9cdf8ef 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesSpaceAllocationSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesSpaceAllocationSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update cache space allocation. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Update cache space allocation. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/SpaceAllocation_Post.json */ -async function spaceAllocationPost() { +async function spaceAllocationPost(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -47,7 +45,7 @@ async function spaceAllocationPost() { console.log(result); } -async function main() { +async function main(): Promise { spaceAllocationPost(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStartPrimingJobSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStartPrimingJobSample.ts index 4c3dcee835ce..2dd69edb3ecd 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStartPrimingJobSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStartPrimingJobSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create a priming job. This operation is only allowed when the cache is healthy. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Create a priming job. This operation is only allowed when the cache is healthy. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StartPrimingJob.json */ -async function startPrimingJob() { +async function startPrimingJob(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -47,7 +45,7 @@ async function startPrimingJob() { console.log(result); } -async function main() { +async function main(): Promise { startPrimingJob(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStartSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStartSample.ts index ba3e53366b0e..4f884777392b 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStartSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStartSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells a Stopped state cache to transition to Active state. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells a Stopped state cache to transition to Active state. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Start.json */ -async function cachesStart() { +async function cachesStart(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function cachesStart() { console.log(result); } -async function main() { +async function main(): Promise { cachesStart(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStopPrimingJobSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStopPrimingJobSample.ts index 5502a2a2c573..e111238e2815 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStopPrimingJobSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStopPrimingJobSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Schedule a priming job for deletion. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Schedule a priming job for deletion. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StopPrimingJob.json */ -async function stopPrimingJob() { +async function stopPrimingJob(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -45,7 +43,7 @@ async function stopPrimingJob() { console.log(result); } -async function main() { +async function main(): Promise { stopPrimingJob(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStopSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStopSample.ts index cefe1d66fc4a..4caf72d0a37d 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStopSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesStopSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells an Active cache to transition to Stopped state. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells an Active cache to transition to Stopped state. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Stop.json */ -async function cachesStop() { +async function cachesStop(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function cachesStop() { console.log(result); } -async function main() { +async function main(): Promise { cachesStop(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesUpdateSample.ts index 28680b7385fd..a5ab2cd90df4 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesUpdateSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update a cache instance. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Update a cache instance. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Update.json */ -async function cachesUpdate() { +async function cachesUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -122,7 +120,7 @@ async function cachesUpdate() { * @summary Update a cache instance. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_Update_ldap_only.json */ -async function cachesUpdateLdapOnly() { +async function cachesUpdateLdapOnly(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -216,7 +214,7 @@ async function cachesUpdateLdapOnly() { console.log(result); } -async function main() { +async function main(): Promise { cachesUpdate(); cachesUpdateLdapOnly(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesUpgradeFirmwareSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesUpgradeFirmwareSample.ts index 393ae8822b3d..66da3b4575f6 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesUpgradeFirmwareSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/cachesUpgradeFirmwareSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Upgrade a cache's firmware if a new version is available. Otherwise, this operation has no effect. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Upgrade a cache's firmware if a new version is available. Otherwise, this operation has no effect. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Caches_UpgradeFirmware.json */ -async function cachesUpgradeFirmware() { +async function cachesUpgradeFirmware(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -36,7 +34,7 @@ async function cachesUpgradeFirmware() { console.log(result); } -async function main() { +async function main(): Promise { cachesUpgradeFirmware(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/checkAmlFsSubnetsSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/checkAmlFsSubnetsSample.ts index ba68a3ed10ff..7a6546d49959 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/checkAmlFsSubnetsSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/checkAmlFsSubnetsSample.ts @@ -14,9 +14,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Check that subnets will be valid for AML file system create calls. @@ -24,7 +22,7 @@ dotenv.config(); * @summary Check that subnets will be valid for AML file system create calls. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/checkAmlFSSubnets.json */ -async function checkAmlFsSubnets() { +async function checkAmlFsSubnets(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -41,7 +39,7 @@ async function checkAmlFsSubnets() { console.log(result); } -async function main() { +async function main(): Promise { checkAmlFsSubnets(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/getRequiredAmlFsSubnetsSizeSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/getRequiredAmlFsSubnetsSizeSample.ts index bec27c1ca0a6..6ae27dd8345c 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/getRequiredAmlFsSubnetsSizeSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/getRequiredAmlFsSubnetsSizeSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Get the number of available IP addresses needed for the AML file system information provided. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Get the number of available IP addresses needed for the AML file system information provided. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/getRequiredAmlFSSubnetsSize.json */ -async function getRequiredAmlFilesystemSubnetsSize() { +async function getRequiredAmlFilesystemSubnetsSize(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -30,7 +28,7 @@ async function getRequiredAmlFilesystemSubnetsSize() { console.log(result); } -async function main() { +async function main(): Promise { getRequiredAmlFilesystemSubnetsSize(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsCreateOrUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsCreateOrUpdateSample.ts index bb889e51bd63..81d40c3dcae7 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsCreateOrUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsCreateOrUpdateSample.ts @@ -13,9 +13,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an import job. Import jobs are automatically deleted 72 hours after completion. @@ -23,7 +21,7 @@ dotenv.config(); * @summary Create or update an import job. Import jobs are automatically deleted 72 hours after completion. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJobs_CreateOrUpdate.json */ -async function importJobsCreateOrUpdate() { +async function importJobsCreateOrUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -49,7 +47,7 @@ async function importJobsCreateOrUpdate() { console.log(result); } -async function main() { +async function main(): Promise { importJobsCreateOrUpdate(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsDeleteSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsDeleteSample.ts index ca18a2ca2a51..9acf1ab17b64 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsDeleteSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsDeleteSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Schedules an import job for deletion. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Schedules an import job for deletion. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJobs_Delete.json */ -async function importJobsDelete() { +async function importJobsDelete(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function importJobsDelete() { console.log(result); } -async function main() { +async function main(): Promise { importJobsDelete(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsGetSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsGetSample.ts index 17f82fc19733..3892d64324ee 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsGetSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsGetSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns an import job. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns an import job. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJobs_Get.json */ -async function importJobsGet() { +async function importJobsGet(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function importJobsGet() { console.log(result); } -async function main() { +async function main(): Promise { importJobsGet(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsListByAmlFilesystemSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsListByAmlFilesystemSample.ts index 97c4ce11d35e..3bcd08569a9c 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsListByAmlFilesystemSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsListByAmlFilesystemSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns all import jobs the user has access to under an AML File System. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns all import jobs the user has access to under an AML File System. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJobs_ListByAmlFilesystem.json */ -async function importJobsListByAmlFilesystem() { +async function importJobsListByAmlFilesystem(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +37,7 @@ async function importJobsListByAmlFilesystem() { console.log(resArray); } -async function main() { +async function main(): Promise { importJobsListByAmlFilesystem(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsUpdateSample.ts index 2bbe88a19ef1..7f5856b84972 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/importJobsUpdateSample.ts @@ -13,9 +13,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update an import job instance. @@ -23,7 +21,7 @@ dotenv.config(); * @summary Update an import job instance. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/importJob_Update.json */ -async function importJobsUpdate() { +async function importJobsUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -43,7 +41,7 @@ async function importJobsUpdate() { console.log(result); } -async function main() { +async function main(): Promise { importJobsUpdate(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/operationsListSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/operationsListSample.ts index a7291b06ae4c..cfb14cc70adb 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/operationsListSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/operationsListSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists all of the available Resource Provider operations. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Lists all of the available Resource Provider operations. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Operations_List.json */ -async function operationsList() { +async function operationsList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -33,7 +31,7 @@ async function operationsList() { console.log(resArray); } -async function main() { +async function main(): Promise { operationsList(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/skusListSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/skusListSample.ts index 01c4adc383d1..da23c792278b 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/skusListSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/skusListSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Get the list of StorageCache.Cache SKUs available to this subscription. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Get the list of StorageCache.Cache SKUs available to this subscription. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/Skus_List.json */ -async function skusList() { +async function skusList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -33,7 +31,7 @@ async function skusList() { console.log(resArray); } -async function main() { +async function main(): Promise { skusList(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetFlushSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetFlushSample.ts index 443dd0a56ca6..fa11a6a4df04 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetFlushSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetFlushSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests to this storage target's namespace will return errors until the flush operation completes. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Flush.json */ -async function storageTargetsFlush() { +async function storageTargetsFlush(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsFlush() { console.log(result); } -async function main() { +async function main(): Promise { storageTargetsFlush(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetInvalidateSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetInvalidateSample.ts index bf37c37d5770..8ea42490ca77 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetInvalidateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetInvalidateSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Invalidate all cached data for a storage target. Cached files are discarded and fetched from the back end on the next request. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Invalidate.json */ -async function storageTargetsInvalidate() { +async function storageTargetsInvalidate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsInvalidate() { console.log(result); } -async function main() { +async function main(): Promise { storageTargetsInvalidate(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetResumeSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetResumeSample.ts index 8a888819ef5e..136fdb9dfd8f 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetResumeSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetResumeSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Resumes client access to a previously suspended storage target. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Resumes client access to a previously suspended storage target. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Resume.json */ -async function storageTargetsResume() { +async function storageTargetsResume(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsResume() { console.log(result); } -async function main() { +async function main(): Promise { storageTargetsResume(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetSuspendSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetSuspendSample.ts index 220b8bf55acf..b3eed4c96a90 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetSuspendSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetSuspendSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Suspends client access to a storage target. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Suspends client access to a storage target. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Suspend.json */ -async function storageTargetsSuspend() { +async function storageTargetsSuspend(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsSuspend() { console.log(result); } -async function main() { +async function main(): Promise { storageTargetsSuspend(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsCreateOrUpdateSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsCreateOrUpdateSample.ts index ecca87510c49..d00b36dd580a 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsCreateOrUpdateSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsCreateOrUpdateSample.ts @@ -13,9 +13,7 @@ import { StorageCacheManagementClient, } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again. @@ -23,7 +21,7 @@ dotenv.config(); * @summary Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_CreateOrUpdate.json */ -async function storageTargetsCreateOrUpdate() { +async function storageTargetsCreateOrUpdate(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -70,7 +68,7 @@ async function storageTargetsCreateOrUpdate() { * @summary Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_CreateOrUpdate_BlobNfs.json */ -async function storageTargetsCreateOrUpdateBlobNfs() { +async function storageTargetsCreateOrUpdateBlobNfs(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -106,7 +104,7 @@ async function storageTargetsCreateOrUpdateBlobNfs() { * @summary Create or update a Storage Target. This operation is allowed at any time, but if the cache is down or unhealthy, the actual creation/modification of the Storage Target may be delayed until the cache is healthy again. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_CreateOrUpdate_NoJunctions.json */ -async function storageTargetsCreateOrUpdateNoJunctions() { +async function storageTargetsCreateOrUpdateNoJunctions(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -133,7 +131,7 @@ async function storageTargetsCreateOrUpdateNoJunctions() { console.log(result); } -async function main() { +async function main(): Promise { storageTargetsCreateOrUpdate(); storageTargetsCreateOrUpdateBlobNfs(); storageTargetsCreateOrUpdateNoJunctions(); diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsDeleteSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsDeleteSample.ts index 3a55f222fcaa..b82e6c6c151d 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsDeleteSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsDeleteSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Removes a Storage Target from a cache. This operation is allowed at any time, but if the cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the cache is healthy again. Note that if the cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Removes a Storage Target from a cache. This operation is allowed at any time, but if the cache is down or unhealthy, the actual removal of the Storage Target may be delayed until the cache is healthy again. Note that if the cache has data to flush to the Storage Target, the data will be flushed before the Storage Target will be deleted. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Delete.json */ -async function storageTargetsDelete() { +async function storageTargetsDelete(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsDelete() { console.log(result); } -async function main() { +async function main(): Promise { storageTargetsDelete(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsDnsRefreshSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsDnsRefreshSample.ts index 1b8c4e30c1e4..9ad48f26c309 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsDnsRefreshSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsDnsRefreshSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells a storage target to refresh its DNS information. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells a storage target to refresh its DNS information. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_DnsRefresh.json */ -async function cachesDnsRefresh() { +async function cachesDnsRefresh(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function cachesDnsRefresh() { console.log(result); } -async function main() { +async function main(): Promise { cachesDnsRefresh(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsGetSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsGetSample.ts index 430c5bb3b58d..020084efa2ba 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsGetSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsGetSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns a Storage Target from a cache. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns a Storage Target from a cache. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_Get.json */ -async function storageTargetsGet() { +async function storageTargetsGet(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsGet() { console.log(result); } -async function main() { +async function main(): Promise { storageTargetsGet(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsListByCacheSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsListByCacheSample.ts index 9d9a5810324d..ca3e9531c546 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsListByCacheSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsListByCacheSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Returns a list of Storage Targets for the specified cache. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Returns a list of Storage Targets for the specified cache. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_ListByCache.json */ -async function storageTargetsList() { +async function storageTargetsList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +37,7 @@ async function storageTargetsList() { console.log(resArray); } -async function main() { +async function main(): Promise { storageTargetsList(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsRestoreDefaultsSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsRestoreDefaultsSample.ts index ce493afcc68f..9e59bdf75fcb 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsRestoreDefaultsSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/storageTargetsRestoreDefaultsSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Tells a storage target to restore its settings to their default values. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Tells a storage target to restore its settings to their default values. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/StorageTargets_RestoreDefaults.json */ -async function storageTargetsRestoreDefaults() { +async function storageTargetsRestoreDefaults(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +36,7 @@ async function storageTargetsRestoreDefaults() { console.log(result); } -async function main() { +async function main(): Promise { storageTargetsRestoreDefaults(); } diff --git a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/usageModelsListSample.ts b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/usageModelsListSample.ts index 67d129f1e635..14a6c14192bc 100644 --- a/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/usageModelsListSample.ts +++ b/sdk/storagecache/arm-storagecache/samples/v8/typescript/src/usageModelsListSample.ts @@ -10,9 +10,7 @@ // Licensed under the MIT License. import { StorageCacheManagementClient } from "@azure/arm-storagecache"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Get the list of cache usage models available to this subscription. @@ -20,7 +18,7 @@ dotenv.config(); * @summary Get the list of cache usage models available to this subscription. * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2024-03-01/examples/UsageModels_List.json */ -async function usageModelsList() { +async function usageModelsList(): Promise { const subscriptionId = process.env["STORAGECACHE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -33,7 +31,7 @@ async function usageModelsList() { console.log(resArray); } -async function main() { +async function main(): Promise { usageModelsList(); } diff --git a/sdk/storagecache/arm-storagecache/src/index.ts b/sdk/storagecache/arm-storagecache/src/index.ts index c75de029f0fa..fad4ff623c84 100644 --- a/sdk/storagecache/arm-storagecache/src/index.ts +++ b/sdk/storagecache/arm-storagecache/src/index.ts @@ -7,7 +7,7 @@ */ /// -export { getContinuationToken } from "./pagingHelper"; -export * from "./models"; -export { StorageCacheManagementClient } from "./storageCacheManagementClient"; -export * from "./operationsInterfaces"; +export { getContinuationToken } from "./pagingHelper.js"; +export * from "./models/index.js"; +export { StorageCacheManagementClient } from "./storageCacheManagementClient.js"; +export * from "./operationsInterfaces/index.js"; diff --git a/sdk/storagecache/arm-storagecache/src/models/index.ts b/sdk/storagecache/arm-storagecache/src/models/index.ts index 137376218243..42f2f57f8c8a 100644 --- a/sdk/storagecache/arm-storagecache/src/models/index.ts +++ b/sdk/storagecache/arm-storagecache/src/models/index.ts @@ -357,6 +357,20 @@ export interface ErrorAdditionalInfo { readonly info?: Record; } +/** An auto export job update instance. */ +export interface AutoExportJobUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** Result of the request to list auto export jobs. It contains a list of auto export jobs and a URL link to get the next set of results. */ +export interface AutoExportJobsListResult { + /** URL to get the next set of auto export job list results, if there are any. */ + nextLink?: string; + /** List of auto export jobs. */ + value?: AutoExportJob[]; +} + /** An import job update instance. */ export interface ImportJobUpdate { /** Resource tags. */ @@ -1175,6 +1189,91 @@ export interface AmlFilesystem extends TrackedResource { rootSquashSettings?: AmlFilesystemRootSquashSettings; } +/** An auto export job instance. Follows Azure Resource Manager standards: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md */ +export interface AutoExportJob extends TrackedResource { + /** + * ARM provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: AutoExportJobProvisioningStateType; + /** The administrative status of the auto export job. Possible values: 'Enable', 'Disable'. Passing in a value of 'Disable' will disable the current active auto export job. By default it is set to 'Enable'. */ + adminStatus?: AutoExportJobAdminStatus; + /** An array of blob paths/prefixes that get auto exported to the cluster namespace. It has '/' as the default value. Number of maximum allowed paths for now is 1. */ + autoExportPrefixes?: string[]; + /** The operational state of auto export. InProgress indicates the export is running. Disabling indicates the user has requested to disable the export but the disabling is still in progress. Disabled indicates auto export has been disabled. DisableFailed indicates the disabling has failed. Failed means the export was unable to continue, due to a fatal error. */ + state?: AutoExportStatusType; + /** + * Server-defined status code for auto export job. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statusCode?: string; + /** + * Server-defined status message for auto export job. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statusMessage?: string; + /** + * Total files exported since the start of the export. This is accumulative, some files may be counted repeatedly. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalFilesExported?: number; + /** + * Total data (in MiB) exported since the start of the export. This is accumulative, some files may be counted repeatedly. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalMiBExported?: number; + /** + * Total files failed to be export since the last successfully completed iteration. This is accumulative, some files may be counted repeatedly. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalFilesFailed?: number; + /** + * Number of iterations completed since the start of the export. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly exportIterationCount?: number; + /** + * Time (in UTC) of the last successfully completed export iteration. Look at logging container for details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastSuccessfulIterationCompletionTimeUTC?: Date; + /** + * Files discovered for export in current iteration. It may increase while more export items are found. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currentIterationFilesDiscovered?: number; + /** + * Data (in MiB) discovered for export in current iteration. It may increase while more export items are found. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currentIterationMiBDiscovered?: number; + /** + * Files that have been exported in current iteration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currentIterationFilesExported?: number; + /** + * Data (in MiB) that have been exported in current iteration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currentIterationMiBExported?: number; + /** + * Files failed to export in current iteration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currentIterationFilesFailed?: number; + /** + * The time (in UTC) the latest auto export job started. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastStartedTimeUTC?: Date; + /** + * The time (in UTC) of the last completed auto export job. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastCompletionTimeUTC?: Date; +} + /** An import job instance. Follows Azure Resource Manager standards: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md */ export interface ImportJob extends TrackedResource { /** @@ -1182,6 +1281,8 @@ export interface ImportJob extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ImportJobProvisioningStateType; + /** The administrative status of the import job. Possible values: 'Enable', 'Disable'. Passing in a value of 'Disable' will cancel the current active import job. By default it is set to 'Enable'. */ + adminStatus?: ImportJobAdminStatus; /** An array of blob paths/prefixes that get imported into the cluster namespace. It has '/' as the default value. */ importPrefixes?: string[]; /** How the import job will handle conflicts. For example, if the import job is trying to bring in a directory, but a file is at that path, how it handles it. Fail indicates that the import job should stop immediately and not do anything with the conflict. Skip indicates that it should pass over the conflict. OverwriteIfDirty causes the import job to delete and re-import the file or directory if it is a conflicting type, is dirty, or was not previously imported. OverwriteAlways extends OverwriteIfDirty to include releasing files that had been restored but were not dirty. Please reference https://learn.microsoft.com/en-us/azure/azure-managed-lustre/ for a thorough explanation of these resolution modes. */ @@ -1189,7 +1290,7 @@ export interface ImportJob extends TrackedResource { /** Total non-conflict oriented errors the import job will tolerate before exiting with failure. -1 means infinite. 0 means exit immediately and is the default. */ maximumErrors?: number; /** - * The state of the import job. InProgress indicates the import is still running. Canceled indicates it has been canceled by the user. Completed indicates import finished, successfully importing all discovered blobs into the Lustre namespace. CompletedPartial indicates the import finished but some blobs either were found to be conflicting and could not be imported or other errors were encountered. Failed means the import was unable to complete due to a fatal error. + * The operational state of the import job. InProgress indicates the import is still running. Canceled indicates it has been canceled by the user. Completed indicates import finished, successfully importing all discovered blobs into the Lustre namespace. CompletedPartial indicates the import finished but some blobs either were found to be conflicting and could not be imported or other errors were encountered. Failed means the import was unable to complete due to a fatal error. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly state?: ImportStatusType; @@ -1213,18 +1314,48 @@ export interface ImportJob extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly totalBlobsImported?: number; + /** + * New or modified files that have been imported into the filesystem. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly importedFiles?: number; + /** + * New or modified directories that have been imported into the filesystem. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly importedDirectories?: number; + /** + * Newly added symbolic links into the filesystem. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly importedSymlinks?: number; + /** + * Files that already exist in the filesystem and have not been modified. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly preexistingFiles?: number; + /** + * Directories that already exist in the filesystem and have not been modified. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly preexistingDirectories?: number; + /** + * Symbolic links that already exist in the filesystem and have not been modified. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly preexistingSymlinks?: number; /** * A recent and frequently updated rate of total files, directories, and symlinks imported per second. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly blobsImportedPerSecond?: number; /** - * The time of the last completed archive operation + * The time (in UTC) of the last completed import job. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastCompletionTime?: Date; /** - * The time the latest archive operation started + * The time (in UTC) the latest import job started. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastStartedTime?: Date; @@ -1262,6 +1393,28 @@ export interface AmlFilesystemsUpdateHeaders { azureAsyncOperation?: string; } +/** Defines headers for AutoExportJobs_delete operation. */ +export interface AutoExportJobsDeleteHeaders { + /** Location URI to poll for result */ + location?: string; + /** URI to poll for the operation status */ + azureAsyncOperation?: string; +} + +/** Defines headers for AutoExportJobs_createOrUpdate operation. */ +export interface AutoExportJobsCreateOrUpdateHeaders { + /** URI to poll for the operation status */ + azureAsyncOperation?: string; +} + +/** Defines headers for AutoExportJobs_update operation. */ +export interface AutoExportJobsUpdateHeaders { + /** URI to poll for the operation status */ + location?: string; + /** URI to poll for the operation status */ + azureAsyncOperation?: string; +} + /** Defines headers for ImportJobs_delete operation. */ export interface ImportJobsDeleteHeaders { /** Location URI to poll for result */ @@ -1574,6 +1727,81 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Known values of {@link AutoExportJobProvisioningStateType} that the service accepts. */ +export enum KnownAutoExportJobProvisioningStateType { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Creating */ + Creating = "Creating", + /** Deleting */ + Deleting = "Deleting", + /** Updating */ + Updating = "Updating", + /** Canceled */ + Canceled = "Canceled", +} + +/** + * Defines values for AutoExportJobProvisioningStateType. \ + * {@link KnownAutoExportJobProvisioningStateType} can be used interchangeably with AutoExportJobProvisioningStateType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Creating** \ + * **Deleting** \ + * **Updating** \ + * **Canceled** + */ +export type AutoExportJobProvisioningStateType = string; + +/** Known values of {@link AutoExportJobAdminStatus} that the service accepts. */ +export enum KnownAutoExportJobAdminStatus { + /** Active */ + Active = "Active", + /** Cancel */ + Cancel = "Cancel", +} + +/** + * Defines values for AutoExportJobAdminStatus. \ + * {@link KnownAutoExportJobAdminStatus} can be used interchangeably with AutoExportJobAdminStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active** \ + * **Cancel** + */ +export type AutoExportJobAdminStatus = string; + +/** Known values of {@link AutoExportStatusType} that the service accepts. */ +export enum KnownAutoExportStatusType { + /** InProgress */ + InProgress = "InProgress", + /** Disabling */ + Disabling = "Disabling", + /** Disabled */ + Disabled = "Disabled", + /** DisableFailed */ + DisableFailed = "DisableFailed", + /** Failed */ + Failed = "Failed", +} + +/** + * Defines values for AutoExportStatusType. \ + * {@link KnownAutoExportStatusType} can be used interchangeably with AutoExportStatusType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **InProgress** \ + * **Disabling** \ + * **Disabled** \ + * **DisableFailed** \ + * **Failed** + */ +export type AutoExportStatusType = string; + /** Known values of {@link ImportJobProvisioningStateType} that the service accepts. */ export enum KnownImportJobProvisioningStateType { /** Succeeded */ @@ -1604,6 +1832,24 @@ export enum KnownImportJobProvisioningStateType { */ export type ImportJobProvisioningStateType = string; +/** Known values of {@link ImportJobAdminStatus} that the service accepts. */ +export enum KnownImportJobAdminStatus { + /** Active */ + Active = "Active", + /** Cancel */ + Cancel = "Cancel", +} + +/** + * Defines values for ImportJobAdminStatus. \ + * {@link KnownImportJobAdminStatus} can be used interchangeably with ImportJobAdminStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active** \ + * **Cancel** + */ +export type ImportJobAdminStatus = string; + /** Known values of {@link ConflictResolutionMode} that the service accepts. */ export enum KnownConflictResolutionMode { /** Fail */ @@ -2101,6 +2347,65 @@ export interface AmlFilesystemsListByResourceGroupNextOptionalParams export type AmlFilesystemsListByResourceGroupNextResponse = AmlFilesystemsListResult; +/** Optional parameters. */ +export interface AutoExportJobsDeleteOptionalParams + 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 AutoExportJobsDeleteResponse = AutoExportJobsDeleteHeaders; + +/** Optional parameters. */ +export interface AutoExportJobsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AutoExportJobsGetResponse = AutoExportJob; + +/** Optional parameters. */ +export interface AutoExportJobsCreateOrUpdateOptionalParams + 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 AutoExportJobsCreateOrUpdateResponse = AutoExportJob; + +/** Optional parameters. */ +export interface AutoExportJobsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type AutoExportJobsUpdateResponse = AutoExportJob; + +/** Optional parameters. */ +export interface AutoExportJobsListByAmlFilesystemOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByAmlFilesystem operation. */ +export type AutoExportJobsListByAmlFilesystemResponse = + AutoExportJobsListResult; + +/** Optional parameters. */ +export interface AutoExportJobsListByAmlFilesystemNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByAmlFilesystemNext operation. */ +export type AutoExportJobsListByAmlFilesystemNextResponse = + AutoExportJobsListResult; + /** Optional parameters. */ export interface ImportJobsDeleteOptionalParams extends coreClient.OperationOptions { diff --git a/sdk/storagecache/arm-storagecache/src/models/mappers.ts b/sdk/storagecache/arm-storagecache/src/models/mappers.ts index fc23520bd57f..4fcd24e6c479 100644 --- a/sdk/storagecache/arm-storagecache/src/models/mappers.ts +++ b/sdk/storagecache/arm-storagecache/src/models/mappers.ts @@ -802,6 +802,49 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { }, }; +export const AutoExportJobUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoExportJobUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const AutoExportJobsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoExportJobsListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutoExportJob", + }, + }, + }, + }, + }, + }, +}; + export const ImportJobUpdate: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2957,6 +3000,146 @@ export const AmlFilesystem: coreClient.CompositeMapper = { }, }; +export const AutoExportJob: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoExportJob", + modelProperties: { + ...TrackedResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + adminStatus: { + defaultValue: "Active", + serializedName: "properties.adminStatus", + type: { + name: "String", + }, + }, + autoExportPrefixes: { + serializedName: "properties.autoExportPrefixes", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + state: { + serializedName: "properties.status.state", + type: { + name: "String", + }, + }, + statusCode: { + serializedName: "properties.status.statusCode", + readOnly: true, + type: { + name: "String", + }, + }, + statusMessage: { + serializedName: "properties.status.statusMessage", + readOnly: true, + type: { + name: "String", + }, + }, + totalFilesExported: { + serializedName: "properties.status.totalFilesExported", + readOnly: true, + type: { + name: "Number", + }, + }, + totalMiBExported: { + serializedName: "properties.status.totalMiBExported", + readOnly: true, + type: { + name: "Number", + }, + }, + totalFilesFailed: { + serializedName: "properties.status.totalFilesFailed", + readOnly: true, + type: { + name: "Number", + }, + }, + exportIterationCount: { + serializedName: "properties.status.exportIterationCount", + readOnly: true, + type: { + name: "Number", + }, + }, + lastSuccessfulIterationCompletionTimeUTC: { + serializedName: + "properties.status.lastSuccessfulIterationCompletionTimeUTC", + readOnly: true, + type: { + name: "DateTime", + }, + }, + currentIterationFilesDiscovered: { + serializedName: "properties.status.currentIterationFilesDiscovered", + readOnly: true, + type: { + name: "Number", + }, + }, + currentIterationMiBDiscovered: { + serializedName: "properties.status.currentIterationMiBDiscovered", + readOnly: true, + type: { + name: "Number", + }, + }, + currentIterationFilesExported: { + serializedName: "properties.status.currentIterationFilesExported", + readOnly: true, + type: { + name: "Number", + }, + }, + currentIterationMiBExported: { + serializedName: "properties.status.currentIterationMiBExported", + readOnly: true, + type: { + name: "Number", + }, + }, + currentIterationFilesFailed: { + serializedName: "properties.status.currentIterationFilesFailed", + readOnly: true, + type: { + name: "Number", + }, + }, + lastStartedTimeUTC: { + serializedName: "properties.status.lastStartedTimeUTC", + readOnly: true, + type: { + name: "DateTime", + }, + }, + lastCompletionTimeUTC: { + serializedName: "properties.status.lastCompletionTimeUTC", + readOnly: true, + type: { + name: "DateTime", + }, + }, + }, + }, +}; + export const ImportJob: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2970,6 +3153,13 @@ export const ImportJob: coreClient.CompositeMapper = { name: "String", }, }, + adminStatus: { + defaultValue: "Active", + serializedName: "properties.adminStatus", + type: { + name: "String", + }, + }, importPrefixes: { serializedName: "properties.importPrefixes", type: { @@ -3030,6 +3220,48 @@ export const ImportJob: coreClient.CompositeMapper = { name: "Number", }, }, + importedFiles: { + serializedName: "properties.status.importedFiles", + readOnly: true, + type: { + name: "Number", + }, + }, + importedDirectories: { + serializedName: "properties.status.importedDirectories", + readOnly: true, + type: { + name: "Number", + }, + }, + importedSymlinks: { + serializedName: "properties.status.importedSymlinks", + readOnly: true, + type: { + name: "Number", + }, + }, + preexistingFiles: { + serializedName: "properties.status.preexistingFiles", + readOnly: true, + type: { + name: "Number", + }, + }, + preexistingDirectories: { + serializedName: "properties.status.preexistingDirectories", + readOnly: true, + type: { + name: "Number", + }, + }, + preexistingSymlinks: { + serializedName: "properties.status.preexistingSymlinks", + readOnly: true, + type: { + name: "Number", + }, + }, blobsImportedPerSecond: { serializedName: "properties.status.blobsImportedPerSecond", readOnly: true, @@ -3126,6 +3358,63 @@ export const AmlFilesystemsUpdateHeaders: coreClient.CompositeMapper = { }, }; +export const AutoExportJobsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoExportJobsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AutoExportJobsCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoExportJobsCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-async-operation", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AutoExportJobsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoExportJobsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + azureAsyncOperation: { + serializedName: "azure-async-operation", + type: { + name: "String", + }, + }, + }, + }, +}; + export const ImportJobsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/storagecache/arm-storagecache/src/models/parameters.ts b/sdk/storagecache/arm-storagecache/src/models/parameters.ts index df3b4a880087..6488715569ac 100644 --- a/sdk/storagecache/arm-storagecache/src/models/parameters.ts +++ b/sdk/storagecache/arm-storagecache/src/models/parameters.ts @@ -15,6 +15,8 @@ import { AmlFilesystem as AmlFilesystemMapper, AmlFilesystemUpdate as AmlFilesystemUpdateMapper, AmlFilesystemArchiveInfo as AmlFilesystemArchiveInfoMapper, + AutoExportJob as AutoExportJobMapper, + AutoExportJobUpdate as AutoExportJobUpdateMapper, ImportJob as ImportJobMapper, ImportJobUpdate as ImportJobUpdateMapper, AmlFilesystemSubnetInfo as AmlFilesystemSubnetInfoMapper, @@ -23,7 +25,7 @@ import { PrimingJob as PrimingJobMapper, PrimingJobIdParameter as PrimingJobIdParameterMapper, StorageTarget as StorageTargetMapper, -} from "../models/mappers"; +} from "../models/mappers.js"; export const accept: OperationParameter = { parameterPath: "accept", @@ -52,7 +54,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2024-03-01", + defaultValue: "2024-07-01", isConstant: true, serializedName: "api-version", type: { @@ -145,6 +147,32 @@ export const nextLink: OperationURLParameter = { skipEncoding: true, }; +export const autoExportJobName: OperationURLParameter = { + parameterPath: "autoExportJobName", + mapper: { + constraints: { + Pattern: new RegExp("^[0-9a-zA-Z][-0-9a-zA-Z_]{0,78}[0-9a-zA-Z]$"), + MaxLength: 80, + MinLength: 2, + }, + serializedName: "autoExportJobName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const autoExportJob: OperationParameter = { + parameterPath: "autoExportJob", + mapper: AutoExportJobMapper, +}; + +export const autoExportJob1: OperationParameter = { + parameterPath: "autoExportJob", + mapper: AutoExportJobUpdateMapper, +}; + export const importJobName: OperationURLParameter = { parameterPath: "importJobName", mapper: { diff --git a/sdk/storagecache/arm-storagecache/src/operations/amlFilesystems.ts b/sdk/storagecache/arm-storagecache/src/operations/amlFilesystems.ts index 7f99b885449d..14621b320ce3 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/amlFilesystems.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/amlFilesystems.ts @@ -7,18 +7,18 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { AmlFilesystems } from "../operationsInterfaces"; +import { setContinuationToken } from "../pagingHelper.js"; +import { AmlFilesystems } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { StorageCacheManagementClient } from "../storageCacheManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { StorageCacheManagementClient } from "../storageCacheManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { AmlFilesystem, AmlFilesystemsListNextOptionalParams, @@ -39,7 +39,7 @@ import { AmlFilesystemsCancelArchiveOptionalParams, AmlFilesystemsListNextResponse, AmlFilesystemsListByResourceGroupNextResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing AmlFilesystems operations. */ diff --git a/sdk/storagecache/arm-storagecache/src/operations/ascOperations.ts b/sdk/storagecache/arm-storagecache/src/operations/ascOperations.ts index c2cdbfbe8212..8b5e39b3388b 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/ascOperations.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/ascOperations.ts @@ -6,15 +6,15 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { AscOperations } from "../operationsInterfaces"; +import { AscOperations } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { StorageCacheManagementClient } from "../storageCacheManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { StorageCacheManagementClient } from "../storageCacheManagementClient.js"; import { AscOperationsGetOptionalParams, AscOperationsGetResponse, -} from "../models"; +} from "../models/index.js"; /** Class containing AscOperations operations. */ export class AscOperationsImpl implements AscOperations { diff --git a/sdk/storagecache/arm-storagecache/src/operations/ascUsages.ts b/sdk/storagecache/arm-storagecache/src/operations/ascUsages.ts index 3e6dfe2fc238..b218556a4c5d 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/ascUsages.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/ascUsages.ts @@ -7,19 +7,19 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { AscUsages } from "../operationsInterfaces"; +import { setContinuationToken } from "../pagingHelper.js"; +import { AscUsages } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { StorageCacheManagementClient } from "../storageCacheManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { StorageCacheManagementClient } from "../storageCacheManagementClient.js"; import { ResourceUsage, AscUsagesListNextOptionalParams, AscUsagesListOptionalParams, AscUsagesListResponse, AscUsagesListNextResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing AscUsages operations. */ diff --git a/sdk/storagecache/arm-storagecache/src/operations/autoExportJobs.ts b/sdk/storagecache/arm-storagecache/src/operations/autoExportJobs.ts new file mode 100644 index 000000000000..03d0957326cf --- /dev/null +++ b/sdk/storagecache/arm-storagecache/src/operations/autoExportJobs.ts @@ -0,0 +1,687 @@ +/* + * 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.js"; +import { AutoExportJobs } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { StorageCacheManagementClient } from "../storageCacheManagementClient.js"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import { + AutoExportJob, + AutoExportJobsListByAmlFilesystemNextOptionalParams, + AutoExportJobsListByAmlFilesystemOptionalParams, + AutoExportJobsListByAmlFilesystemResponse, + AutoExportJobsDeleteOptionalParams, + AutoExportJobsDeleteResponse, + AutoExportJobsGetOptionalParams, + AutoExportJobsGetResponse, + AutoExportJobsCreateOrUpdateOptionalParams, + AutoExportJobsCreateOrUpdateResponse, + AutoExportJobUpdate, + AutoExportJobsUpdateOptionalParams, + AutoExportJobsUpdateResponse, + AutoExportJobsListByAmlFilesystemNextResponse, +} from "../models/index.js"; + +/// +/** Class containing AutoExportJobs operations. */ +export class AutoExportJobsImpl implements AutoExportJobs { + private readonly client: StorageCacheManagementClient; + + /** + * Initialize a new instance of the class AutoExportJobs class. + * @param client Reference to the service client + */ + constructor(client: StorageCacheManagementClient) { + this.client = client; + } + + /** + * Returns all the auto export jobs the user has access to under an AML File System. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param options The options parameters. + */ + public listByAmlFilesystem( + resourceGroupName: string, + amlFilesystemName: string, + options?: AutoExportJobsListByAmlFilesystemOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByAmlFilesystemPagingAll( + resourceGroupName, + amlFilesystemName, + 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.listByAmlFilesystemPagingPage( + resourceGroupName, + amlFilesystemName, + options, + settings, + ); + }, + }; + } + + private async *listByAmlFilesystemPagingPage( + resourceGroupName: string, + amlFilesystemName: string, + options?: AutoExportJobsListByAmlFilesystemOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: AutoExportJobsListByAmlFilesystemResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByAmlFilesystem( + resourceGroupName, + amlFilesystemName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByAmlFilesystemNext( + resourceGroupName, + amlFilesystemName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByAmlFilesystemPagingAll( + resourceGroupName: string, + amlFilesystemName: string, + options?: AutoExportJobsListByAmlFilesystemOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByAmlFilesystemPagingPage( + resourceGroupName, + amlFilesystemName, + options, + )) { + yield* page; + } + } + + /** + * Schedules an auto export job for deletion. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + options?: AutoExportJobsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AutoExportJobsDeleteResponse + > + > { + 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, + amlFilesystemName, + autoExportJobName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + AutoExportJobsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Schedules an auto export job for deletion. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + options?: AutoExportJobsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + amlFilesystemName, + autoExportJobName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Returns an auto export job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + options?: AutoExportJobsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, amlFilesystemName, autoExportJobName, options }, + getOperationSpec, + ); + } + + /** + * Create or update an auto export job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJob Object containing the user-selectable properties of the auto export job. If + * read-only properties are included, they must match the existing values of those properties. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + autoExportJob: AutoExportJob, + options?: AutoExportJobsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AutoExportJobsCreateOrUpdateResponse + > + > { + 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, + amlFilesystemName, + autoExportJobName, + autoExportJob, + options, + }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + AutoExportJobsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create or update an auto export job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJob Object containing the user-selectable properties of the auto export job. If + * read-only properties are included, they must match the existing values of those properties. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + autoExportJob: AutoExportJob, + options?: AutoExportJobsCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + amlFilesystemName, + autoExportJobName, + autoExportJob, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update an auto export job instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJob Object containing the user-selectable properties of the auto export job. If + * read-only properties are included, they must match the existing values of those properties. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + autoExportJob: AutoExportJobUpdate, + options?: AutoExportJobsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AutoExportJobsUpdateResponse + > + > { + 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, + amlFilesystemName, + autoExportJobName, + autoExportJob, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + AutoExportJobsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Update an auto export job instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJob Object containing the user-selectable properties of the auto export job. If + * read-only properties are included, they must match the existing values of those properties. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + autoExportJob: AutoExportJobUpdate, + options?: AutoExportJobsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + amlFilesystemName, + autoExportJobName, + autoExportJob, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Returns all the auto export jobs the user has access to under an AML File System. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param options The options parameters. + */ + private _listByAmlFilesystem( + resourceGroupName: string, + amlFilesystemName: string, + options?: AutoExportJobsListByAmlFilesystemOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, amlFilesystemName, options }, + listByAmlFilesystemOperationSpec, + ); + } + + /** + * ListByAmlFilesystemNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param nextLink The nextLink from the previous successful call to the ListByAmlFilesystem method. + * @param options The options parameters. + */ + private _listByAmlFilesystemNext( + resourceGroupName: string, + amlFilesystemName: string, + nextLink: string, + options?: AutoExportJobsListByAmlFilesystemNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, amlFilesystemName, nextLink, options }, + listByAmlFilesystemNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageCache/amlFilesystems/{amlFilesystemName}/autoExportJobs/{autoExportJobName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.AutoExportJobsDeleteHeaders, + }, + 201: { + headersMapper: Mappers.AutoExportJobsDeleteHeaders, + }, + 202: { + headersMapper: Mappers.AutoExportJobsDeleteHeaders, + }, + 204: { + headersMapper: Mappers.AutoExportJobsDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.amlFilesystemName, + Parameters.autoExportJobName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageCache/amlFilesystems/{amlFilesystemName}/autoExportJobs/{autoExportJobName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AutoExportJob, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.amlFilesystemName, + Parameters.autoExportJobName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageCache/amlFilesystems/{amlFilesystemName}/autoExportJobs/{autoExportJobName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AutoExportJob, + }, + 201: { + bodyMapper: Mappers.AutoExportJob, + }, + 202: { + bodyMapper: Mappers.AutoExportJob, + }, + 204: { + bodyMapper: Mappers.AutoExportJob, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.autoExportJob, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.amlFilesystemName, + Parameters.autoExportJobName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageCache/amlFilesystems/{amlFilesystemName}/autoExportJobs/{autoExportJobName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.AutoExportJob, + }, + 201: { + bodyMapper: Mappers.AutoExportJob, + }, + 202: { + bodyMapper: Mappers.AutoExportJob, + }, + 204: { + bodyMapper: Mappers.AutoExportJob, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.autoExportJob1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.amlFilesystemName, + Parameters.autoExportJobName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByAmlFilesystemOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageCache/amlFilesystems/{amlFilesystemName}/autoExportJobs", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AutoExportJobsListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.amlFilesystemName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByAmlFilesystemNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AutoExportJobsListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.amlFilesystemName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/storagecache/arm-storagecache/src/operations/caches.ts b/sdk/storagecache/arm-storagecache/src/operations/caches.ts index bc2105be0948..6d34179231bd 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/caches.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/caches.ts @@ -7,18 +7,18 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { Caches } from "../operationsInterfaces"; +import { setContinuationToken } from "../pagingHelper.js"; +import { Caches } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { StorageCacheManagementClient } from "../storageCacheManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { StorageCacheManagementClient } from "../storageCacheManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { Cache, CachesListNextOptionalParams, @@ -51,7 +51,7 @@ import { CachesSpaceAllocationResponse, CachesListNextResponse, CachesListByResourceGroupNextResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing Caches operations. */ diff --git a/sdk/storagecache/arm-storagecache/src/operations/importJobs.ts b/sdk/storagecache/arm-storagecache/src/operations/importJobs.ts index 8787cd4cce81..607651064099 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/importJobs.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/importJobs.ts @@ -7,18 +7,18 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { ImportJobs } from "../operationsInterfaces"; +import { setContinuationToken } from "../pagingHelper.js"; +import { ImportJobs } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { StorageCacheManagementClient } from "../storageCacheManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { StorageCacheManagementClient } from "../storageCacheManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { ImportJob, ImportJobsListByAmlFilesystemNextOptionalParams, @@ -34,7 +34,7 @@ import { ImportJobsUpdateOptionalParams, ImportJobsUpdateResponse, ImportJobsListByAmlFilesystemNextResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing ImportJobs operations. */ @@ -255,7 +255,7 @@ export class ImportJobsImpl implements ImportJobs { } /** - * Create or update an import job. Import jobs are automatically deleted 72 hours after completion. + * Create or update an import job. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and * hyphens. Start and end with alphanumeric. @@ -339,7 +339,7 @@ export class ImportJobsImpl implements ImportJobs { } /** - * Create or update an import job. Import jobs are automatically deleted 72 hours after completion. + * Create or update an import job. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and * hyphens. Start and end with alphanumeric. diff --git a/sdk/storagecache/arm-storagecache/src/operations/index.ts b/sdk/storagecache/arm-storagecache/src/operations/index.ts index ed65f0e35a67..5f18d939fbad 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/index.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/index.ts @@ -6,13 +6,14 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./amlFilesystems"; -export * from "./importJobs"; -export * from "./operations"; -export * from "./skus"; -export * from "./usageModels"; -export * from "./ascOperations"; -export * from "./ascUsages"; -export * from "./caches"; -export * from "./storageTargets"; -export * from "./storageTargetOperations"; +export * from "./amlFilesystems.js"; +export * from "./autoExportJobs.js"; +export * from "./importJobs.js"; +export * from "./operations.js"; +export * from "./skus.js"; +export * from "./usageModels.js"; +export * from "./ascOperations.js"; +export * from "./ascUsages.js"; +export * from "./caches.js"; +export * from "./storageTargets.js"; +export * from "./storageTargetOperations.js"; diff --git a/sdk/storagecache/arm-storagecache/src/operations/operations.ts b/sdk/storagecache/arm-storagecache/src/operations/operations.ts index 74a952242dbe..3af8d805564e 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/operations.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/operations.ts @@ -7,19 +7,19 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { Operations } from "../operationsInterfaces"; +import { setContinuationToken } from "../pagingHelper.js"; +import { Operations } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { StorageCacheManagementClient } from "../storageCacheManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { StorageCacheManagementClient } from "../storageCacheManagementClient.js"; import { ApiOperation, OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, OperationsListNextResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing Operations operations. */ diff --git a/sdk/storagecache/arm-storagecache/src/operations/skus.ts b/sdk/storagecache/arm-storagecache/src/operations/skus.ts index 5cc958232bb4..4aef05b4252c 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/skus.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/skus.ts @@ -7,19 +7,19 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { Skus } from "../operationsInterfaces"; +import { setContinuationToken } from "../pagingHelper.js"; +import { Skus } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { StorageCacheManagementClient } from "../storageCacheManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { StorageCacheManagementClient } from "../storageCacheManagementClient.js"; import { ResourceSku, SkusListNextOptionalParams, SkusListOptionalParams, SkusListResponse, SkusListNextResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing Skus operations. */ diff --git a/sdk/storagecache/arm-storagecache/src/operations/storageTargetOperations.ts b/sdk/storagecache/arm-storagecache/src/operations/storageTargetOperations.ts index 8ac2f481f551..2e28c6f3c58a 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/storageTargetOperations.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/storageTargetOperations.ts @@ -6,23 +6,23 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { StorageTargetOperations } from "../operationsInterfaces"; +import { StorageTargetOperations } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { StorageCacheManagementClient } from "../storageCacheManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { StorageCacheManagementClient } from "../storageCacheManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { StorageTargetFlushOptionalParams, StorageTargetSuspendOptionalParams, StorageTargetResumeOptionalParams, StorageTargetInvalidateOptionalParams, -} from "../models"; +} from "../models/index.js"; /** Class containing StorageTargetOperations operations. */ export class StorageTargetOperationsImpl implements StorageTargetOperations { diff --git a/sdk/storagecache/arm-storagecache/src/operations/storageTargets.ts b/sdk/storagecache/arm-storagecache/src/operations/storageTargets.ts index bca2c79e2ebb..99223a8fdf28 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/storageTargets.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/storageTargets.ts @@ -7,18 +7,18 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { StorageTargets } from "../operationsInterfaces"; +import { setContinuationToken } from "../pagingHelper.js"; +import { StorageTargets } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { StorageCacheManagementClient } from "../storageCacheManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { StorageCacheManagementClient } from "../storageCacheManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { StorageTarget, StorageTargetsListByCacheNextOptionalParams, @@ -32,7 +32,7 @@ import { StorageTargetsCreateOrUpdateResponse, StorageTargetsRestoreDefaultsOptionalParams, StorageTargetsListByCacheNextResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing StorageTargets operations. */ diff --git a/sdk/storagecache/arm-storagecache/src/operations/usageModels.ts b/sdk/storagecache/arm-storagecache/src/operations/usageModels.ts index 74574e8e8fe2..9aeb0bee84be 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/usageModels.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/usageModels.ts @@ -7,19 +7,19 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { UsageModels } from "../operationsInterfaces"; +import { setContinuationToken } from "../pagingHelper.js"; +import { UsageModels } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { StorageCacheManagementClient } from "../storageCacheManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { StorageCacheManagementClient } from "../storageCacheManagementClient.js"; import { UsageModel, UsageModelsListNextOptionalParams, UsageModelsListOptionalParams, UsageModelsListResponse, UsageModelsListNextResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing UsageModels operations. */ diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/amlFilesystems.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/amlFilesystems.ts index 7fd8d036e31f..43bf2a355ea8 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/amlFilesystems.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/amlFilesystems.ts @@ -22,7 +22,7 @@ import { AmlFilesystemsUpdateResponse, AmlFilesystemsArchiveOptionalParams, AmlFilesystemsCancelArchiveOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a AmlFilesystems. */ diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/ascOperations.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/ascOperations.ts index 21c7a0a69523..297d9525e82d 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/ascOperations.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/ascOperations.ts @@ -9,7 +9,7 @@ import { AscOperationsGetOptionalParams, AscOperationsGetResponse, -} from "../models"; +} from "../models/index.js"; /** Interface representing a AscOperations. */ export interface AscOperations { diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/ascUsages.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/ascUsages.ts index 6ce97cf55715..a72f12062b5d 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/ascUsages.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/ascUsages.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { ResourceUsage, AscUsagesListOptionalParams } from "../models"; +import { ResourceUsage, AscUsagesListOptionalParams } from "../models/index.js"; /// /** Interface representing a AscUsages. */ diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/autoExportJobs.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/autoExportJobs.ts new file mode 100644 index 000000000000..37e3b127312a --- /dev/null +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/autoExportJobs.ts @@ -0,0 +1,172 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + AutoExportJob, + AutoExportJobsListByAmlFilesystemOptionalParams, + AutoExportJobsDeleteOptionalParams, + AutoExportJobsDeleteResponse, + AutoExportJobsGetOptionalParams, + AutoExportJobsGetResponse, + AutoExportJobsCreateOrUpdateOptionalParams, + AutoExportJobsCreateOrUpdateResponse, + AutoExportJobUpdate, + AutoExportJobsUpdateOptionalParams, + AutoExportJobsUpdateResponse, +} from "../models/index.js"; + +/// +/** Interface representing a AutoExportJobs. */ +export interface AutoExportJobs { + /** + * Returns all the auto export jobs the user has access to under an AML File System. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param options The options parameters. + */ + listByAmlFilesystem( + resourceGroupName: string, + amlFilesystemName: string, + options?: AutoExportJobsListByAmlFilesystemOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Schedules an auto export job for deletion. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + options?: AutoExportJobsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AutoExportJobsDeleteResponse + > + >; + /** + * Schedules an auto export job for deletion. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + options?: AutoExportJobsDeleteOptionalParams, + ): Promise; + /** + * Returns an auto export job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + options?: AutoExportJobsGetOptionalParams, + ): Promise; + /** + * Create or update an auto export job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJob Object containing the user-selectable properties of the auto export job. If + * read-only properties are included, they must match the existing values of those properties. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + autoExportJob: AutoExportJob, + options?: AutoExportJobsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AutoExportJobsCreateOrUpdateResponse + > + >; + /** + * Create or update an auto export job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJob Object containing the user-selectable properties of the auto export job. If + * read-only properties are included, they must match the existing values of those properties. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + autoExportJob: AutoExportJob, + options?: AutoExportJobsCreateOrUpdateOptionalParams, + ): Promise; + /** + * Update an auto export job instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJob Object containing the user-selectable properties of the auto export job. If + * read-only properties are included, they must match the existing values of those properties. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + autoExportJob: AutoExportJobUpdate, + options?: AutoExportJobsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AutoExportJobsUpdateResponse + > + >; + /** + * Update an auto export job instance. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJobName Name for the auto export job. Allows alphanumerics, underscores, and + * hyphens. Start and end with alphanumeric. + * @param autoExportJob Object containing the user-selectable properties of the auto export job. If + * read-only properties are included, they must match the existing values of those properties. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + amlFilesystemName: string, + autoExportJobName: string, + autoExportJob: AutoExportJobUpdate, + options?: AutoExportJobsUpdateOptionalParams, + ): Promise; +} diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/caches.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/caches.ts index e7fbc01edc10..dcc7f62969ec 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/caches.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/caches.ts @@ -34,7 +34,7 @@ import { CachesUpgradeFirmwareOptionalParams, CachesSpaceAllocationOptionalParams, CachesSpaceAllocationResponse, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a Caches. */ diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/importJobs.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/importJobs.ts index 7cb0294b2dde..0effc408ded1 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/importJobs.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/importJobs.ts @@ -20,7 +20,7 @@ import { ImportJobUpdate, ImportJobsUpdateOptionalParams, ImportJobsUpdateResponse, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a ImportJobs. */ @@ -88,7 +88,7 @@ export interface ImportJobs { options?: ImportJobsGetOptionalParams, ): Promise; /** - * Create or update an import job. Import jobs are automatically deleted 72 hours after completion. + * Create or update an import job. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and * hyphens. Start and end with alphanumeric. @@ -111,7 +111,7 @@ export interface ImportJobs { > >; /** - * Create or update an import job. Import jobs are automatically deleted 72 hours after completion. + * Create or update an import job. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param amlFilesystemName Name for the AML file system. Allows alphanumerics, underscores, and * hyphens. Start and end with alphanumeric. diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/index.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/index.ts index ed65f0e35a67..5f18d939fbad 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/index.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/index.ts @@ -6,13 +6,14 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./amlFilesystems"; -export * from "./importJobs"; -export * from "./operations"; -export * from "./skus"; -export * from "./usageModels"; -export * from "./ascOperations"; -export * from "./ascUsages"; -export * from "./caches"; -export * from "./storageTargets"; -export * from "./storageTargetOperations"; +export * from "./amlFilesystems.js"; +export * from "./autoExportJobs.js"; +export * from "./importJobs.js"; +export * from "./operations.js"; +export * from "./skus.js"; +export * from "./usageModels.js"; +export * from "./ascOperations.js"; +export * from "./ascUsages.js"; +export * from "./caches.js"; +export * from "./storageTargets.js"; +export * from "./storageTargetOperations.js"; diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/operations.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/operations.ts index 9e4b31475719..9b7cbbaaf99e 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/operations.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/operations.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { ApiOperation, OperationsListOptionalParams } from "../models"; +import { ApiOperation, OperationsListOptionalParams } from "../models/index.js"; /// /** Interface representing a Operations. */ diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/skus.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/skus.ts index e567d29ea5f9..ac5fc125e48d 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/skus.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/skus.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { ResourceSku, SkusListOptionalParams } from "../models"; +import { ResourceSku, SkusListOptionalParams } from "../models/index.js"; /// /** Interface representing a Skus. */ diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/storageTargetOperations.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/storageTargetOperations.ts index 5111f18040c8..1d0159d31ca4 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/storageTargetOperations.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/storageTargetOperations.ts @@ -12,7 +12,7 @@ import { StorageTargetSuspendOptionalParams, StorageTargetResumeOptionalParams, StorageTargetInvalidateOptionalParams, -} from "../models"; +} from "../models/index.js"; /** Interface representing a StorageTargetOperations. */ export interface StorageTargetOperations { diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/storageTargets.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/storageTargets.ts index a151b6c0a5a7..d170b850f314 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/storageTargets.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/storageTargets.ts @@ -18,7 +18,7 @@ import { StorageTargetsCreateOrUpdateOptionalParams, StorageTargetsCreateOrUpdateResponse, StorageTargetsRestoreDefaultsOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a StorageTargets. */ diff --git a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/usageModels.ts b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/usageModels.ts index cad18b2fbac4..f1ddd7fb002e 100644 --- a/sdk/storagecache/arm-storagecache/src/operationsInterfaces/usageModels.ts +++ b/sdk/storagecache/arm-storagecache/src/operationsInterfaces/usageModels.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { UsageModel, UsageModelsListOptionalParams } from "../models"; +import { UsageModel, UsageModelsListOptionalParams } from "../models/index.js"; /// /** Interface representing a UsageModels. */ diff --git a/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts b/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts index c44a85cd4570..0ee88ac9c9a8 100644 --- a/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts +++ b/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts @@ -16,6 +16,7 @@ import { import * as coreAuth from "@azure/core-auth"; import { AmlFilesystemsImpl, + AutoExportJobsImpl, ImportJobsImpl, OperationsImpl, SkusImpl, @@ -25,9 +26,10 @@ import { CachesImpl, StorageTargetsImpl, StorageTargetOperationsImpl, -} from "./operations"; +} from "./operations/index.js"; import { AmlFilesystems, + AutoExportJobs, ImportJobs, Operations, Skus, @@ -37,15 +39,15 @@ import { Caches, StorageTargets, StorageTargetOperations, -} from "./operationsInterfaces"; -import * as Parameters from "./models/parameters"; -import * as Mappers from "./models/mappers"; +} from "./operationsInterfaces/index.js"; +import * as Parameters from "./models/parameters.js"; +import * as Mappers from "./models/mappers.js"; import { StorageCacheManagementClientOptionalParams, CheckAmlFSSubnetsOptionalParams, GetRequiredAmlFSSubnetsSizeOptionalParams, GetRequiredAmlFSSubnetsSizeResponse, -} from "./models"; +} from "./models/index.js"; export class StorageCacheManagementClient extends coreClient.ServiceClient { $host: string; @@ -79,7 +81,7 @@ export class StorageCacheManagementClient extends coreClient.ServiceClient { credential: credentials, }; - const packageDetails = `azsdk-js-arm-storagecache/8.0.1`; + const packageDetails = `azsdk-js-arm-storagecache/8.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -133,8 +135,9 @@ export class StorageCacheManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2024-03-01"; + this.apiVersion = options.apiVersion || "2024-07-01"; this.amlFilesystems = new AmlFilesystemsImpl(this); + this.autoExportJobs = new AutoExportJobsImpl(this); this.importJobs = new ImportJobsImpl(this); this.operations = new OperationsImpl(this); this.skus = new SkusImpl(this); @@ -200,6 +203,7 @@ export class StorageCacheManagementClient extends coreClient.ServiceClient { } amlFilesystems: AmlFilesystems; + autoExportJobs: AutoExportJobs; importJobs: ImportJobs; operations: Operations; skus: Skus; diff --git a/sdk/storagecache/arm-storagecache/test/sampleTest.ts b/sdk/storagecache/arm-storagecache/test/sampleTest.ts new file mode 100644 index 000000000000..a1cf7c25afd2 --- /dev/null +++ b/sdk/storagecache/arm-storagecache/test/sampleTest.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, +} from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/storagecache/arm-storagecache/test/storagecache_operations_test.spec.ts b/sdk/storagecache/arm-storagecache/test/storagecache_operations_test.spec.ts index e09e72e6033c..cc610583cad8 100644 --- a/sdk/storagecache/arm-storagecache/test/storagecache_operations_test.spec.ts +++ b/sdk/storagecache/arm-storagecache/test/storagecache_operations_test.spec.ts @@ -10,13 +10,11 @@ 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 { StorageCacheManagementClient } from "../src/storageCacheManagementClient"; +import { StorageCacheManagementClient } from "../src/storageCacheManagementClient.js"; +import { describe, it, assert, beforeEach, afterEach } from "vitest"; const replaceableVariables: Record = { SUBSCRIPTION_ID: "azure_subscription_id" @@ -42,67 +40,23 @@ describe("StorageCache test", () => { let resourceGroup: string; let resourcename: 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 StorageCacheManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "myjstest"; - resourcename = "resourcetest"; - }); + beforeEach(async (ctx) => { + recorder = new Recorder(ctx); + await recorder.start(recorderOptions); + subscriptionId = env.SUBSCRIPTION_ID || ''; + // This is an example of how the environment variables are used + const credential = createTestCredential(); + client = new StorageCacheManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); + location = "eastus"; + resourceGroup = "myjstest"; + resourcename = "resourcetest"; + }); - afterEach(async function () { - await recorder.stop(); - }); + afterEach(async () => { + await recorder.stop(); + }); it("caches create test", async function () { - const res = await client.caches.beginCreateOrUpdateAndWait( - resourceGroup, - resourcename, - { - networkSettings: { - mtu: 1500, - utilityAddresses: [ - "10.0.0.10", - "10.0.0.11", - "10.0.0.12" - ], - ntpServer: "time.windows.com" - }, - cacheSizeGB: 3072, - directoryServicesSettings: {}, - location, - securitySettings: { - accessPolicies: [ - { - name: "default", - accessRules: [ - { - access: "rw", - rootSquash: false, - scope: "default", - submountAccess: true, - suid: false - } - ] - } - ] - }, - sku: { name: "Standard_2G" }, - subnet: - "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroup + "/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1", - tags: { dept: "Contoso" }, - zones: ["1"], - mountAddresses: [ - "10.0.0.7", - "10.0.0.8", - "10.0.0.9" - ], - }, - testPollingOptions); }); it("caches get test", async function () { @@ -120,7 +74,6 @@ describe("StorageCache test", () => { it("caches delete test", async function () { const resArray = new Array(); - const res = await client.caches.beginDeleteAndWait(resourceGroup, resourcename, testPollingOptions) for await (let item of client.caches.listByResourceGroup(resourceGroup)) { resArray.push(item); } diff --git a/sdk/storagecache/arm-storagecache/tsconfig.browser.config.json b/sdk/storagecache/arm-storagecache/tsconfig.browser.config.json new file mode 100644 index 000000000000..0c8bafa97126 --- /dev/null +++ b/sdk/storagecache/arm-storagecache/tsconfig.browser.config.json @@ -0,0 +1,6 @@ +{ + "extends": [ + "./tsconfig.test.json", + "../../../tsconfig.browser.base.json" + ] +} diff --git a/sdk/storagecache/arm-storagecache/tsconfig.json b/sdk/storagecache/arm-storagecache/tsconfig.json index 1054055624f9..b35d05ad6e9d 100644 --- a/sdk/storagecache/arm-storagecache/tsconfig.json +++ b/sdk/storagecache/arm-storagecache/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-storagecache": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "src/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules" diff --git a/sdk/storagecache/arm-storagecache/tsconfig.samples.json b/sdk/storagecache/arm-storagecache/tsconfig.samples.json new file mode 100644 index 000000000000..71bd0bc8eccf --- /dev/null +++ b/sdk/storagecache/arm-storagecache/tsconfig.samples.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.samples.base.json", + "compilerOptions": { + "paths": { + "@azure/arm-storagecache": [ + "./dist/esm" + ] + } + } +} diff --git a/sdk/storagecache/arm-storagecache/tsconfig.src.json b/sdk/storagecache/arm-storagecache/tsconfig.src.json new file mode 100644 index 000000000000..bae70752dd38 --- /dev/null +++ b/sdk/storagecache/arm-storagecache/tsconfig.src.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.lib.json" +} diff --git a/sdk/storagecache/arm-storagecache/tsconfig.test.json b/sdk/storagecache/arm-storagecache/tsconfig.test.json new file mode 100644 index 000000000000..3c2b783a8c1b --- /dev/null +++ b/sdk/storagecache/arm-storagecache/tsconfig.test.json @@ -0,0 +1,6 @@ +{ + "extends": [ + "./tsconfig.src.json", + "../../../tsconfig.test.base.json" + ] +} diff --git a/sdk/storagecache/arm-storagecache/vitest.browser.config.ts b/sdk/storagecache/arm-storagecache/vitest.browser.config.ts new file mode 100644 index 000000000000..182729ab5ce9 --- /dev/null +++ b/sdk/storagecache/arm-storagecache/vitest.browser.config.ts @@ -0,0 +1,17 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig, mergeConfig } from "vitest/config"; +import viteConfig from "../../../vitest.browser.shared.config.ts"; + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + include: ["dist-test/browser/test/**/*.spec.js",], + testTimeout: 1200000, + hookTimeout: 1200000, + }, + }), +); diff --git a/sdk/storagecache/arm-storagecache/vitest.config.ts b/sdk/storagecache/arm-storagecache/vitest.config.ts new file mode 100644 index 000000000000..40e031385dd8 --- /dev/null +++ b/sdk/storagecache/arm-storagecache/vitest.config.ts @@ -0,0 +1,16 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig, mergeConfig } from "vitest/config"; +import viteConfig from "../../../vitest.shared.config.ts"; + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + testTimeout: 1200000, + hookTimeout: 1200000, + }, + }), +); diff --git a/sdk/storagecache/arm-storagecache/vitest.esm.config.ts b/sdk/storagecache/arm-storagecache/vitest.esm.config.ts new file mode 100644 index 000000000000..a70127279fc9 --- /dev/null +++ b/sdk/storagecache/arm-storagecache/vitest.esm.config.ts @@ -0,0 +1,12 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { mergeConfig } from "vitest/config"; +import vitestConfig from "./vitest.config.ts"; +import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; + +export default mergeConfig( + vitestConfig, + vitestEsmConfig +);